deh4eg/omnipay-blueorange 问题修复 & 功能扩展

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

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

deh4eg/omnipay-blueorange

Composer 安装命令:

composer require deh4eg/omnipay-blueorange

包简介

BlueOrange gateway for omnipay library

README 文档

README

Omnipay BlueOrange Gateway is a payment processing library for PHP. It's based on Omnipay package

Latest Stable Version Total Downloads Latest Unstable Version License

Installation

Omnipay is installed via Composer. To install, simply require league/omnipay and deh4eg/omnipay-blueorange with Composer:

composer require league/omnipay deh4eg/omnipay-blueorange

API docs

BlueOrange Gateway API documentation you can find here

Usage

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

Currently, library implements 2 endpoints:

  1. Create a Purchase
  2. Retrieve an object by id

Code Examples

1. Create a Purchase

Method Endpoint
POST /purchases/
use Omnipay\BlueOrange\Gateway;
use Omnipay\BlueOrange\Message\Response\PurchaseResponse;
use Omnipay\Omnipay;

/** @var Gateway $gateway */
$gateway = Omnipay::create(Gateway::getGatewayClass());

$gateway->setBrandId('123456789');
$gateway->setSecretKey('abcde123456');

$options = [
    'client' => [
        'email' => 'test@test.com'
    ],
    'purchase' => [
        'currency' => 'EUR', // Currency code in the ISO 4217 standard,
        'language' => 'lv', // Language code in the ISO 639-1 format
        'total_override' => 100, // (optional) [type: int] If set, will override total sum from products[],
        'products' => [
            [
                'name' => 'Product name',
                'price' => 100, // [type: int],
                'quantity' => 1
            ]
        ]
    ],
    'reference' => '#1234', // (optional) Max length: 128
    'success_redirect' => 'https://www.example.com/success/',
    'failure_redirect' => 'https://www.example.com/failure/',
    'cancel_redirect' => 'https://www.example.com/cancel/' // (optional)
];

/** @var PurchaseResponse $response */
$response = $gateway->completePurchase($options)->send();

if ($response->isRedirect()) {
    $response->redirect();
}

2. Retrieve an object by id

Method Endpoint
GET /purchases/{id}/
use Omnipay\BlueOrange\Gateway;
use Omnipay\BlueOrange\Message\Response\FetchTransactionResponse;
use Omnipay\Omnipay;

/** @var Gateway $gateway */
$gateway = Omnipay::create(Gateway::getGatewayClass());

$gateway->setBrandId('123456789');
$gateway->setSecretKey('abcde123456');

$options = [
    'transaction_reference' => 'abc123' // Object ID (UUID) from purchase response
];

/** @var FetchTransactionResponse $response */
$response = $gateway->fetchTransaction($options)->send();

if ($response->isSuccessful()) {
    // Do code
}

Changelog

Please see CHANGELOG for more information what has changed recently.

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-04-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固