bizpay / payments
此包最新版本(v1.0.1)没有可用的许可证信息。
BizPay Payments API的客户端SDK包
v1.0.1
2018-11-07 14:06 UTC
Requires
- php: ^5.4 || ^7.0
- defuse/php-encryption: ^2.2
- guzzlehttp/guzzle: ~6.0
Requires (Dev)
- phpunit/phpunit: ^6.5
This package is not auto-updated.
Last update: 2024-09-20 19:40:24 UTC
README
要实现bizpay api,可以使用此SDK。
示例实现可以在examples目录中找到。
API文档可以在以下位置找到:https://payments.bizpay.nl/swagger/
安装
通过运行以下命令包含此包
composer require bizpay/payments
获取交易URL
实现交易api的代码如下
$transaction = new \BizPay\Payments\Transaction();
$transaction->setApiKey("api key");
$transaction->setPassword("password");
$data = [
"webshop_customer_info" => [
"company_identification" => "30172890",
"company_name" => "Test",
"firstname" => "Test",
"surname_1" => null,
"surname_2" => "Test",
"title" => null,
"email" => "Test",
"phone" => "Test",
"street" => "Test",
"number" => "Test",
"extension" => null,
"city" => "Test",
"postcode" => "Test",
"state" => null,
"country" => "NL",
"gender" => 1
],
"order_details" => [
"order_created_date" => date('d-m-Y h:i'),
"webshop_redirect_url" => "https:///bizpay_apicall/response.php",
"webshop_webhook_url" => 'https:///bizpay_apicall/response.php',
"currency" => "eur",
"total_amount" => "100.00",
"order_internal_id" => "25",
"order_tax_amount" => "0.00",
"shipment_amount" => "5.00",
"shipment_tax_amount" => "0.00",
"shipment_with_tax" => "5.00",
"items" => []
]
];
try {
$response = $transaction->create($data);
echo $response->transaction_url;
} catch (Exception $e) {
// An error occured, check for specific exceptions and handle them gracefully
}