plaramart/tbi-bank 问题修复 & 功能扩展

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

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

plaramart/tbi-bank

Composer 安装命令:

composer require plaramart/tbi-bank

包简介

Bulgarian TBI bank API wrapper

README 文档

README

This is standalone API wrapper for Bulgarian TBI Bank. Implement as payment method / recurring payment. Ask for calculations for single/all schemes and more;

Installation

composer require plaramart/tbi-bank

Usage

Initialization

Initialize without framework

$client = new \Plaramart\TbiBank\Client('your-api-secret', __DIR__.'/folder/pub.pem');

Initialize using laravel framework, or you can install my laravel implementation

// Inside AppServiceProvider.php
$this->app->singleton(\Plaramart\TbiBank\Client::class, function () {    
    $apiSecretKey = 'your-api-secret';
    $pathToCert = storage_path('app/pub.pem');
    return new \Plaramart\TbiBank\Client($apiSecretKey, $pathToCert);
});

Get calculation

all schemes

Get calculations for all schemes. You can only pass first param (price) to get all data you need. Other params are not mandatory but you can fill them if needed.

// (float $price, float $initialPayment = 0, int $category = 10, $insurance = 'n')
$calculationRequest = new \Plaramart\TbiBank\Requests\CalculateForAllPeriodSchemesRequest(
    price: 113
);

$response = $client->execute($calculationRequest);

single scheme

Second parameter is $period. That's the specific schema u want e.g calc(price: 113, period: 3)

// (float $price, int $period = 3, float $initialPayment = 0, int $category = 10, $insurance = 'n')
$calculationRequest = new \Plaramart\TbiBank\Requests\CalculateForPeriodRequest(
    price: 113, 
    period: 3
);

$response = $client->execute($calculationRequest);

Submit order to TBI

$order = new CreateOrderRequest(price: 113, months: 3, initialPayment: 50);

$order->setUser(
    name: 'Zgdevv LordGeorgex', 
    id: 9808027528, 
    address: 'Na borovets batko', 
    phone: '+35988888888', 
    email: 'me@gmail.com'
);

// You can add as much as u want products. 
// Product ID from your database. nothing to do with their API
$order->addProduct(
    id: 1, 
    name: 'test', 
    quantity: 2, 
    price: 113
);

$response = $client->execute($order);

Contribution

Send PR for bug fixes or improvements. For contact zgdevv@gmail.com

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-06-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固