定制 waldson/omnipay-rede-rest-api 二次开发

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

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

waldson/omnipay-rede-rest-api

Composer 安装命令:

composer require waldson/omnipay-rede-rest-api

包简介

Rede driver for the Omnipay payment processing library

README 文档

README

Rede Rest API's driver for the Omnipay PHP payment processing library

Installation

This library is installed via Composer. To install it, call:

composer require waldson/omnipay-rede-rest-api

Supported Methods

The following methods are supported by this package:

  • authorize
  • capture
  • purchase (authorize + catpure in a single step)
  • refund
  • fetchTransaction

Basic Usage

The following gateway is provided by this package:

  • Rede

Example

use Omnipay\Omnipay;

$gateway = Omnipay::create('Rede');
$gateway->setMerchantId($yourCV); // Filiação
$gateway->setMerchantKey($yourToken); // Token

$card     = array('number' => '4242424242424242', 'expiryMonth' => '6', 'expiryYear' => '2030', 'cvv' => '123', 'name' => 'Holder name');
$response = $gateway->purchase(array('amount' => '10.00', 'reference' => '1', 'card' => $card))->send(); //or authorize(...)

if ($response->isSuccessful()) {
    // payment was successful: update database
    $transactionId = $response->getTransactionId();

    //with transactionId you can fetch...
    $transactionInfo = $gateway->fetchTransaction(['transactionId' => $transactionId]); //you can pass 'reference' too

    //refund...
    $response = $gateway->refund(['transactionId' => $transactionId, 'amount' => '10.00']);

    //or capture (don't work with purchase, you can only capture authorized requests)
    $response = $gateway->capture(['transactionId' => $transactionId, 'amount' => '10.00']);

} else {
    // payment failed: display message to customer
    $errorMessage = $response->getMessage();
    $errorCode    = $response->getCode();
    ...
}

Support

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.

PS: Rede is a brazillian payment gateway.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-11-08