sergiodlopes / omnipay-eupago-multibanco
Eupago - 多银行支付
dev-master / 2.1.x-dev
2018-01-22 18:32 UTC
Requires
- omnipay/common: ~2.0
Requires (Dev)
- omnipay/tests: ~2.0
This package is not auto-updated.
Last update: 2024-09-22 13:50:38 UTC
README
这是 omnipay 支付处理库的 Eupago 解决方案
Eupago 是一种葡萄牙支付方式,允许客户通过银行参考号支付。要使用它,您需要在 Eupago 网站上创建一个账户。一旦安装并配置完毕,您就可以使用我们 API 的所有功能。
安装
有关安装详情,请查阅 omnipay 的 git 页面。
必填字段
apiKey -> 生成您的 API 密钥,请在我们的网站上 创建一个账户
currency -> 货币是必填的,必须是 'EUR' 或 '€'
ammount ->
transactionId -> transactionId(通常是订单号)
示例
$gateway = Omnipay::create('Eupago_Multibanco'); //required fields $gateway->setApiKey('xxx-xxx-xxx-xxx'); $gateway->setCurrency('EUR'); $gateway->setTransactionId('xxxxx'); $response = $gateway->purchase(['amount' => '10.00'])->send(); // return the Eupago api response with payment credentials // see src/message/response.php methods for more information $payment_data = $response->getData(); // return the Transaction Reference // the transaction Reference is required for call the status of payment, you should store them in your "orders" table related database $ref = $response->getTransactionReference(); //return the status of transaction (pendent, paid , not_exist, etc) $PaymentStatus = $gateway->checkStatus(['TransactionReference' => 'xxxxxx'])->send(); if ($response->isSuccessful()) { // payment was successful: update database // you will nedd to store some adicional data like transaction reference, } else { // payment failed: display message to customer echo $response->getMessage(); }