单元 / laravel-payone
Laravel 的 PAYONE 支付网关
v1.0.1
2022-11-25 08:06 UTC
Requires
- php: >=7.3
This package is auto-updated.
Last update: 2024-09-25 12:13:13 UTC
README
官方 PAYONE 文档: https://docs.payone.com
注意:代码未经过安全审计,不提供任何保证。
安装
您可以通过 composer 安装此包
composer require birim/laravel-payone
您可以使用以下命令发布配置文件
php artisan vendor:publish --tag=laravel-payone
这是发布配置文件的内容
return [
// PAYONE API Version
'version' => '3.11',
// Mode for transactions, either ‘live’ or ‘test’
'mode' => 'test',
// The type of character encoding used in the request.
'encoding' => 'UTF-8',
// Name of the developer
'integrator_name' => '',
// Sub-Account ID, defined by PAYONE
'sub_account_id' => '',
// Portal ID, defined by PAYONE
'portal_id' => '',
// Merchant ID, defined by PAYONE
'merchant_id' => '',
// Payment portal key as MD5 value
'key' => ''
];
更新日志
有关最近更改的更多信息,请阅读 更新日志
使用示例
启动支付预留(预授权)
Payone::sendRequest([
'request' => 'preauthorization',
'clearingtype' => 'cc',
'reference' => uniqid(),
'amount' => 1500,
'currency' => 'EUR',
'lastname' => 'CUSTOMERS_LASTNAME',
'country' => 'DE',
'items' => [
[
'id' => 1,
'type' => 'goods',
'sku' => 'QL-NBB-477-48',
'price' => 1500,
'description' => 'Lorem ipsum'
]
],
'successurl' => route('payone_success_url'),
'errorurl' => route('payone_error_url'),
'backurl' => route('payone_back_url'),
'pseudocardpan' => $pseudoCardPan
]);
创建合同(createaccess)
Payone::sendRequest([
'aid' => Payone::getSubAccountId(),
'request' => 'createaccess',
'clearingtype' => 'elv',
'reference' => uniqid(),
'productid' => $productId,
'settle_period_length' => 1,
'settle_period_unit' => 'M',
'lastname' => 'CUSTOMERS_LASTNAME',
'country' => 'DE',
'bankcountry' => 'DE',
'iban' => '2599100003'
]);
覆盖 PAYONE API 配置
Payone::setSubAccountId(12345)