payprocessing / connectum-sdk
Connectum SDK
Installs: 10 774
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 11
Open Issues: 0
Requires (Dev)
- php: >=5.6
- phpunit/phpunit: 5.7
- dev-master
- 2.3.1
- 2.3.0
- 2.2.0
- 2.1.1
- 2.1.0
- 2.0.7
- 2.0.6
- 2.0.5
- 2.0.2
- 2.0.1
- 2.0.0
- v1.4.0
- v1.3.10
- v1.3.9
- v1.3.8
- v1.3.7
- 1.3.6
- 1.3.5
- v1.3.4
- v1.3.3
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.21
- v1.0.20
- v1.0.19
- v1.0.18
- v1.0.17
- v1.0.16
- v1.0.15
- v1.0.14
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- dev-develop
This package is auto-updated.
Last update: 2024-11-30 01:56:54 UTC
README
Install
composer require platron/connectum-sdk
To use SDK you need to generate pem certificate and private key. You could use this command
openssl pkcs12 -in login.p12 -out private.key -nocerts -nodes
openssl pkcs12 -in login.p12 -out certificate.cer -nokeys
Start tests
composer install
To use tests copy tests/integration/MerchantSettingsSample.php and delete Sample substring. Than use
vendor/bin/phpunit tests/integration
Samples
- Set connection settings in object
$connectionSettings = new Platron\Connectum\data_objects\ConnectionSettingsData(); $connectionSettings->login = 'login'; $connectionSettings->password = 'password'; $connectionSettings->certificatePath = 'path_to_cert.pem'; $connectionSettings->certificatePassword = 'certificate_password;
- Auth
$client = new Platron\Connectum\clients\PostClient($connectionSettings); $card = new Platron\Connectum\data_objects\CardData(); $card->holder = 'test test'; $card->cvv = '123'; $card->expiration_month = '06'; $card->expiration_year = '2022'; $location = new Platron\Connectum\data_objects\LocationData(); $location->ip = '8.8.8.8'; $request = new Platron\Connectum\services\order_authorize\OrderAuthorizeRequest(10, 'RUB', '4111111111111111', $card, $location); $response = new Platron\Connectum\services\order_authorize\OrderAuthorizeResponse($client->sendRequest($request));
- Capture
$client = new Platron\Connectum\clients\PutClient($connectionSettings); $request = new Platron\Connectum\services\order_charge\OrderChargeRequest(111, 10.00); $response = new Platron\Connectum\services\order_charge\OrderChargeResponse($client->sendRequest($request));
- Order list
$client = new Platron\Connectum\clients\GetClient($this->connectionSettings); $request = new Platron\Connectum\services\order_list\OrderListRequest(); $card = new Platron\Connectum\data_objects\CardData(); $card->type = Platron\Connectum\handbooks\OrderStatus::PREPARED; $request->setCard($card); $response = new Platron\Connectum\services\order_list\OrderListResponse($client->sendRequest($request));