escapeboy/borica

Borica支付包

1.0.0 2018-03-04 15:02 UTC

This package is auto-updated.

Last update: 2024-09-17 02:00:30 UTC


README

所有赞誉归功于原作者 https://github.com/mirovit/borica-api 请给它加星!我只为了方便与Laravel集成而移植它。

安装

composer require escapeboy/borica

此包支持自动发现。对于Laravel <5.5,您应手动注册它

//config/app.php
Borica\ServiceProvider::class,

发布包配置

php artisan vendor:publish --provider="Borica\BoricaServiceProvider"

使用

$borica = new \Borica\Factory();

注册交易

$borica->request()
        ->amount('1') // 1 EUR
        ->orderID(1) // Unique identifier in your system
        ->description('testing the process') // Short description of the purchase (up to 125 chars)
        ->currency('EUR') // The currency of the payment
        ->register(); // Type of the request

检查交易状态

$factory->request()
        ->amount('1') // 1 EUR
        ->orderID(1) // Unique identifier in your system
        ->description('testing the process') // Short description of the purchase (up to 125 chars)
        ->currency('EUR') // The currency of the payment
        ->status(); // Type of the request

撤销交易

$factory->request()
        ->amount('1') // 1 EUR - partial reversal (amount less than the original), full reversal the original amount
        ->orderID(1) // Unique identifier in your system
        ->reverse(); // Type of the request

解析响应

$borica = new \Borica\Factory();
$borica = $borica->response($request->eBorica);
//Methods
$borica->transactionCode();
$borica->transactionTime();
$borica->amount();
$borica->terminalID();
$borica->orderID();
$borica->notSuccessful();
$borica->isSuccessful();
$borica->responseCode();