eupago/omnipay-eupago-multibanco

Eupago - 通过多银行支付

dev-master / 2.0.x-dev 2015-12-01 23:04 UTC

This package is not auto-updated.

Last update: 2024-09-18 18:28:34 UTC


README

这是 Eupago 为 omnipay 支付处理库提供的解决方案

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();
}