dpsoft / mellat
Mellat银行在线支付 - PHP语言编写的Mellat银行支付网关
v1.1
2022-07-22 20:55 UTC
Requires
- php: ^7.1|^8
- ext-soap: *
Requires (Dev)
- phpunit/phpunit: ^7.0|^9.0
This package is auto-updated.
Last update: 2024-09-23 01:30:32 UTC
README
基于php soap扩展的Mellat银行交易库。
安装
您可以通过composer安装此包
composer require dpsoft/mellat
用法
1- 请求交易并重定向到银行
try{ $mellat = new \Dpsoft\Mellat\Mellat($terminalId, $userName, $userPassword); $response = $mellat->request($amount); //save $response info like token($response['token']) and orderId($response['order_id']) then redirect to bank echo "redirecting to bank..."; $response->redirectToBank(); }catch(\Throwable $e){ echo "error: ".$e->getMessage(); }
2- 处理银行响应
try{ $mellat = new \Dpsoft\Mellat\Mellat($terminalId, $userName, $userPassword); $response = $mellat->verify(); //successful payment. save $response info like reference id($response['reference_id']) echo "successful payment.Thanks..."; }catch(\Throwable $e){ echo "error: ".$e->getMessage(); }
测试
composer test
安全
如果您发现任何与安全相关的问题,请通过电子邮件sadeghpm@gmail.com联系,而不是使用问题跟踪器。
鸣谢
许可证
GNU GPLv3。有关更多信息,请参阅许可证文件。