定制 oskonnikov/alfabank-rest 二次开发

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

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

oskonnikov/alfabank-rest

最新稳定版本:1.3.1

Composer 安装命令:

composer require oskonnikov/alfabank-rest

包简介

Alfabank REST API integration

README 文档

README

FORKED AND BASED ON https://gitlab.com/maximAbdalov/alfabank-rest

Installation

Install this package with composer:

composer require oskonnikov/alfabank-rest

Usage

use Oskonnikov\Alfabank\AlfaBankClient;
use Oskonnikov\Alfabank\Models\Request\Order;
use Oskonnikov\Alfabank\Models\Request\OrderPosition;

Create new order in bank

$bank = new AlfaBankClient('login-api', 'password-api', true);
// register order
$res = $bank->getPaymentUrl(new Order('123', 'test', 500, 'descr'), 'http://app.com');

Fiscalization (optional)

If you use fiscalization via Alfabank, you need send items in order

$order = new Order('123', 'test', 500, 'descr', 'customer@email.com', [
    new OrderPosition('123', 'test', 500, 'descr')
]);
$res = $bank->getPaymentUrl($order, 'http://app.com');

Check order status

// get order status
$status = $bank->checkStatus('alfabank order id', 'order id in your system');

Logging actions (optional)

You can use custom logger for this package. Just create logger class implement from package LoggerContract interface.

use Oskonnikov\Alfabank\Logger\LoggerContract;

class MyLog implements LoggerContract
{
    public static function push(...);
}

$logger = new MyLog();

$bank = new AlfaBankClient('login-api', 'password-api', true, $logger);

Test cards for check integration

https://pay.alfabank.ru/ecommerce/instructions/test_cards.pdf

Telegram channel about PHP packages

Subscribe - https://t.me/php_package

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-22