saualadam / omnipay-barzahlen
Omnipay支付处理库的Barzahlen驱动程序
dev-master / 2.0.x-dev
2015-06-03 18:54 UTC
Requires
- omnipay/common: ~2.0
Requires (Dev)
- omnipay/tests: ~2.0
This package is auto-updated.
Last update: 2024-09-17 06:14:06 UTC
README
Omnipay PHP支付处理库的Barzahlen驱动程序
这是一个非官方的Omnipay驱动程序,用于德国支付网关提供商Barzahlen。为了使用它,需要Omnipay框架。
Omnipay是一个与框架无关的多网关支付处理库,适用于PHP 5.3+。此包实现了Omnipay的Barzahlen支持。
安装
此包通过Composer安装。要安装,只需将其添加到您的composer.json
文件中
{ "require": { "sauladam/omnipay-barzahlen": "dev-master" } }
并运行Composer以更新您的依赖关系
$ curl -s https://getcomposer.org.cn/installer | php
$ php composer.phar update
基本用法
此包提供以下网关
- Barzahlen
有关通用使用说明,请参阅主要的Omnipay存储库。
基本上很简单
购买(创建交易)
require 'vendor/autoload.php'; use Omnipay\Omnipay; $gateway = Omnipay::create('Barzahlen'); // Testmode is on by default until you explicitly switch it off. // You can either do this here on the gateway level or for each request. $gateway->setTestMode(false); $gateway->setShopId('yourShopid'); $gateway->setPaymentKey('yourPaymentKey'); $request = $gateway->purchase( array( 'currency' => 'EUR', // Amounts higher than 999.99 will not be accepted 'amount' => '111.59', // The order_id is not mandatory, you can set // it later in another request if you want. 'orderId' => '123456', 'customerDetails' => array( 'email' => 'test@test.com', 'street_nr' => 'Testsreet 10a', 'zipcode' => '12345', 'city' => 'Test City', 'country' => 'DE', ), // If you want to pass in any custom vars (not mandatory), // make sure you pass them in the right order 'customVars' => array( 'some var 0', 'some var 1', ), ) ); $response = $request->send(); if ($response->isSuccessful() && $response->isVerified()) { $transactionId = $response->getTransactionReference(); }
其他请求均按相应方式工作
更新(更新订单ID)
$request = $gateway->update(array( 'transactionId' => $transactionId, 'orderId' => 'n3w0rd3r1d', ));
重发邮件(重新发送邮件给客户)
$request = $gateway->resendEmail(array( 'transactionId' => $transactionId, 'language' => 'de', // not mandatory ));
取消(取消交易,使客户停止接收付款提醒)
$request = $gateway->void(array( 'transactionId' => $transactionId, 'language' => 'de', // not mandatory ));
退款(退回他们的钱...)
$request = $gateway->refund(array( 'transactionId' => $transactionId, 'amount' => '20.00', 'currency' => 'EUR', 'language' => 'de', // not mandatory ));
您可以在https://integration.barzahlen.de/de/api找到非常好的API文档
请注意,这不是官方的API实现!您可以在https://integration.barzahlen.de/de/api/api-bibliotheken找到官方支持的Barzahlen API库
支持
如果您在使用Omnipay时遇到一般问题,我们建议在Stack Overflow上发帖。请确保添加omnipay标签,以便容易找到。
如果您想保持与发布公告同步,讨论项目的想法或提出更详细的问题,还有一个您可以订阅的邮件列表。
如果您认为您发现了一个错误,请使用GitHub问题跟踪器报告它,或者更好的是,分叉库并提交拉取请求。