erdaldemirci / laravel-ininal
Laravel plugin for Ininal.
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/erdaldemirci/laravel-ininal
Requires
- php: >=7.2|^8.0
- guzzlehttp/guzzle: ~7.0
- illuminate/support: ~6.0|~7.0|~8.0|~9.0
- nesbot/carbon: ~2.0
Requires (Dev)
- phpunit/phpunit: ^8.0|^9.0
- symfony/var-dumper: ~5.0
README
Documentation
The documentation for the package can be viewed by clicking the following link:
Usage
Following are some ways through which you can access the ininal provider:
// Import the class namespaces first, before using it directly use ErdalDemirci\Ininal\Services\Ininal as IninalClient; $provider = new IninalClient; // Through facade. No need to import namespaces $provider = \Ininal::setProvider();
Configuration File
The configuration file ininal.php is located in the config folder. Following are its contents when published:
return [ 'mode' => env('ININAL_MODE', 'sandbox'), // Can only be 'sandbox' Or 'live'. If empty or invalid, 'live' will be used. 'api_key' => env('ININAL_API_KEY', ''), 'api_secret' => env('ININAL_API_SECRET', ''), 'locale' => env('ININAL_LOCALE', 'TR'), // force gateway language i.e. TR, EN ];
Override Ininal API Configuration
You can override Ininal API configuration by calling setApiCredentials method:
$provider->setApiCredentials($config);
Get Access Token
After setting the Ininal API configuration by calling setApiCredentials method. You need to get access token before
performing any API calls
$provider->accessToken();
User Creation
$response = $provider->userCreation(['name'=>'Ahmet','surname'=>'Ozperson','email'=>'ahmet@ahmet.com','gsmNumber'=>'5330000000','tcIdentificationNumber'=>'91111111119' ,'password'=>'123qweasd','birthDate'=>'1982-04-03','motherMaidenName'=>'yilmaz']);
{
"httpCode": 201,
"description": "string",
"response": {
"userToken": "0014c0b5-6bf0-467f-bbf4-7a100b06927e"
},
"validationErrors": {
"property1": "string",
"property2": "string"
}
}
User information
$response = $provider->userInformation($user_token = '0014c0b5-6bf0-467f-bbf4-7a100b06927e');
{
"httpCode": 200,
"description": "string",
"response": {
"userToken": "0014c0b5-6bf0-467f-bbf4-7a100b06927e",
"name": "Ahmet",
"surname": "Ozperson",
"email": "ahmet.ozperson@ininal.com",
"gsmNumber": "5500000000",
"tckn": "11111111111",
"birthdate": "1992-05-26",
"status": "ACTIVE"
},
"validationErrors": {
"property1": "string",
"property2": "string"
}
}
Support
This version supports Laravel 6 or greater.
- In case of any issues, kindly create one on the Issues section.
- If you would like to contribute:
- Fork this repository.
- Implement your features.
- Generate pull request.