lionweng / laravel_4_allpay
Laravel 4 的 Allpay 服务提供商。
dev-master
2015-05-27 09:56 UTC
This package is auto-updated.
Last update: 2024-09-19 09:24:05 UTC
README
设置
composer.json
"require": { "lionweng/laravel_4_allpay": "dev-master"
}
composer:
$ composer update
包
app/config/app.php -> providers
'providers' => array(
// ...
'Lionweng\Allpay\AllpayServiceProvider',
)
app/config/app.php -> aliases
'aliases' => array(
// ...
'Allpay' => 'Lionweng\Allpay\Facade\Allpay',
)
设置
config -> app/config/laravel_4_allpay.php:
<?php return array(
'ServiceURL' => "https://payment.allpay.com.tw/Cashier/AioCheckOut",
'HashKey' => "hashkey",
'HashIV' => "hashiv",
'MerchantID' => "merchantid"
);
示例
Allpay::instance()->Send['ReturnURL'] = "<<收到付款完成通知的服务器端网址>>"; Allpay::instance()->Send['ClientBackURL'] = "<<欧付宝返回按钮导向的浏览器端网址>>"; Allpay::instance()->Send['OrderResultURL'] = "<<收到付款完成通知的浏览器端网址>>"; Allpay::instance()->Send['ChoosePayment'] = PaymentMethod::ALL; .... array_push(Allpay::instance()->Send['Items'], array('Name' => "<<产品C>>", 'Price' => (int)"<<单价>>", 'Currency' => "<<币别>>", 'Quantity' => (int) "<<数量>>", 'URL' => "<<产品说明地址>>"));