gentor/omnipay-sofort
最新稳定版本:2.3.0
Composer 安装命令:
composer require gentor/omnipay-sofort
包简介
SOFORT Überweisung gateway for Omnipay payment processing library
README 文档
README
SOFORT Überweisung gateway for awesome Omnipay library.
API Notes
This gateway only provides 2 methods to place a successful transaction. The first one is purchase which initializes a purchase and returns a redirect url.
The second one is acceptNotification. This method receives status notification from SOFORT Überweisung and validates it by getting transaction_details from the API.
Installation
Omnipay is installed via Composer. To install, simply run:
composer require gentor/omnipay-sofort
Usage
For general usage instructions, please see the main Omnipay repository.
1. Purchase
$gateway = Omnipay::create('Sofort'); $gateway->initialize(array( 'username' => 'sofort_customer_id', 'password' => 'sofort_api_key', 'projectId' => 'sofort_project_id', 'testMode' => true )); $response = $gateway->purchase(array( 'amount' => 199.00, 'description' => 'Google Nexus 4', ))->send(); if ($response->isSuccessful() && $response->isRedirect()) { // redirect to offsite payment gateway $transactionReference = $response->getTransactionReference(); $transactionStatus = $response->getTransactionStatus(); $response->redirect(); } else { // payment failed: display message to customer echo $response->getMessage(); }
2. Accept Notification
$gateway = Omnipay::create('Sofort'); $gateway->initialize(array( 'username' => 'sofort_customer_id', 'password' => 'sofort_api_key', 'projectId' => 'sofort_project_id', 'testMode' => true )); $response = $gateway->acceptNotification()->send(); if ($response->isSuccessful()) { // payment was successful $transactionReference = $response->getTransactionReference(); $transactionStatus = $response->getTransactionStatus(); print_r($response); } else { // payment failed: display message to customer echo $response->getMessage(); }
统计信息
- 总下载量: 3.33k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-05-09