卡瑞传媒 / ipay88
iPay88支付网关模块
dev-master
2023-08-22 08:29 UTC
Requires (Dev)
- phpunit/phpunit: 5.4.*
This package is not auto-updated.
Last update: 2024-09-25 20:41:22 UTC
README
iPay88支付网关模块。
注意:您需要从techsupport@ipay88.com.my请求演示账户。
安装
我已经通过以下命令使用Composer使此项目可用于安装:
$ composer require karyamedia/ipay88 dev-master
示例控制器
<?php class Payment { protected $_merchantCode; protected $_merchantKey; public function __construct(){ parent::__construct(); /** * MerchantCode confidential * MerchantKey confidential */ $this->_merchantCode = 'xxxxxx'; $this->_merchantKey = 'xxxxxxxxx'; } public function index(){ $request = new IPay88\Payment\Request($this->_merchantKey); $this->_data['merchantCode'] = $request->setMerchantCode($this->_merchantCode); $this->_data['paymentId'] = $request->setPaymentId(1); $this->_data['refNo'] = $request->setRefNo('EXAMPLE0001'); $this->_data['amount'] = $request->setAmount('0.50'); $this->_data['currency'] = $request->setCurrency('MYR'); $this->_data['prodDesc'] = $request->setProdDesc('Testing'); $this->_data['userName'] = $request->setUserName('Your name'); $this->_data['userEmail'] = $request->setUserEmail('email@example.com'); $this->_data['userContact'] = $request->setUserContact('0123456789'); $this->_data['remark'] = $request->setRemark('Some remarks here..'); $this->_data['lang'] = $request->setLang('UTF-8'); $this->_data['signature'] = $request->getSignature(); $this->_data['responseUrl'] = $request->setResponseUrl('http://example.com/response'); $this->_data['backendUrl'] = $request->setBackendUrl('http://example.com/backend'); IPay88\Payment\Request::make($this->_merchantKey, $this->_data); } public function response(){ $response = (new IPay88\Payment\Response)->init($this->_merchantCode); echo "<pre>"; print_r($response); } }
致谢
参考
https://github.com/cchitsiang/ipay88
https://github.com/fastsafety/ipay88
许可证
MIT © Karyamedia。请参阅许可证文件获取更多信息。