定制 gentor/omnipay-sofort 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gentor/omnipay-sofort

最新稳定版本:2.3.0

Composer 安装命令:

composer require gentor/omnipay-sofort

包简介

SOFORT Überweisung gateway for Omnipay payment processing library

README 文档

README

Build Status Coverage Status Scrutinizer Code Quality

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 17
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-05-09