asci/omnipay-sofort 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

asci/omnipay-sofort

Composer 安装命令:

composer require asci/omnipay-sofort

包简介

SOFORT Überweisung gateway for Omnipay payment processing library

README 文档

README

Build Status Latest Stable Version Total Downloads

SOFORT Überweisung gateway for awesome Omnipay library.

Important Note: Omnipay 1.x Users

If you are using Omnipay 1.x versions please use 1.x tree. For detailed information you can check Omnipay's 2.0 release notes.

API Notes

This gateway only provides 2 methods to place a successful transaction. The first one is authorize which initializes an authorization and returns a redirect url.

The second one is completeAuthorize. This method doesn't actually complete anything. Since SOFORT Überweisung doesn't have a capture functionality, the only way to know about a transaction is checking that transaction details. According to official docs, if there is no any successful or failed transactions, the API will return empty transactions XML object.

Installation

To install, simply add it to your composer.json file:

{
    "require": {
        "asci/omnipay-sofort": "~2.0"
    }
}

and run composer update

Usage

For general usage instructions, please see the main Omnipay repository.

1. Authorize

$gateway = Omnipay::create('Sofort');
$gateway->initialize(array(
    'username' => 'your_account_id',
    'password' => 'password',
    'projectId' => 'sofort_project_id',
    'testMode' => true
));

$response = $gateway->authorize(array(
    'amount' => 199.00,
    'description' => 'Google Nexus 4',
))->send();

$transactionReference = $response->getTransactionReference();

if ($response->isRedirect()) {
    // redirect to offsite payment gateway
    $response->redirect();
} else {
    // payment failed: display message to customer
    echo $response->getMessage();
}

2. Complete Authorize

$gateway = Omnipay::create('Sofort');
$gateway->initialize(array(
    'username' => 'your_account_id',
    'password' => 'password',
    'projectId' => 'sofort_project_id',
    'testMode' => true
));

$response = $gateway->completeAuthorize(array(
    'transactionId' => $transactionReference,
))->send();

if ($response->isSuccessful()) {
    // payment was successful
    print_r($response);
} else {
    // payment failed: display message to customer
    echo $response->getMessage();
}

统计信息

  • 总下载量: 127.81k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 20
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-09-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固