payprocessing / connectum-sdk
该软件包最新版本(2.3.1)没有可用的许可信息。
Connectum SDK
2.3.1
2023-09-01 11:10 UTC
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-08-30 01:26:57 UTC
README
安装
composer require platron/connectum-sdk
要使用SDK,您需要生成pem证书和私钥。您可以使用以下命令
openssl pkcs12 -in login.p12 -out private.key -nocerts -nodes
openssl pkcs12 -in login.p12 -out certificate.cer -nokeys
开始测试
composer install
要使用测试,请复制tests/integration/MerchantSettingsSample.php并删除Sample子串。然后使用
vendor/bin/phpunit tests/integration
示例
- 在对象中设置连接设置
$connectionSettings = new Platron\Connectum\data_objects\ConnectionSettingsData(); $connectionSettings->login = 'login'; $connectionSettings->password = 'password'; $connectionSettings->certificatePath = 'path_to_cert.pem'; $connectionSettings->certificatePassword = 'certificate_password;
- 认证
$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));
- 捕获
$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));
- 订单列表
$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));