承接 jesobreira/bankly 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

jesobreira/bankly

Composer 安装命令:

composer require jesobreira/bankly

包简介

PHP SDK for Bankly (Acesso)

关键字:

README 文档

README

Unnofficial PHP class to access Bankly (by Acesso) API.

API Docs here.

Javascript port here.

Usage

Authentication and token refreshing is handled by the class itself.

Start by including the class and creating an instance supplying your client_id and client_secret provided by Acesso.

composer require jesobreira/bankly
use BanklyPHP\Bankly;
use BanklyPHP\BankAccount;
$bankly = new Bankly('client_id', 'client_secret');

Getting account balance

Provide the branch and account number (without hyphen) to get the balance.

$bankly->getBalance('0001', '1234');

This method returns a JSON object.

Getting account statement

Provide:

  • Branch (string)
  • Account number (string)
  • Offset (number, starts at 0)
  • Limit (number, > 0)
  • Details (optional, boolean, default true)
  • DetailsLevelBasic (optional, boolean, default true)
$bankly->getStatement('0001', '1234', 0, 10);

This method returns a JSON object.

Getting account events

Provide:

  • Branch (string)
  • Account number (string)
  • Page (number, starts at 1)
  • Pagesize (number, > 0)
  • IncludeDetails (optional, boolean, default true)
$bankly->getEvents('0001', '1234', 1, 10);

This method returns a JSON object.

Performing transfers

Note: this method causes subtraction of real money.

In order to specify an origin and destination bank account, you must create two BankAccount objects.

A bank account instance must be created receiving an object with the following properties:

  • branch (string): account branch
  • account (string): account number (no hyphen)
  • document (string): account holder's CPF or CNPJ (numbers only)
  • name (string): account holder name
  • bankCode (string, optional): bank code (see below, defaults to Acesso's 332)

Then you will use the transfer() method to perform the actual transfer, providing:

  • The amount in centavos (1 BRL = 100 centavos)
  • Reference or description (human-readable string)
  • Sender (a BankAccount object)
  • Recipient (a BankAccount Object)

Example:

$from = new BankAccount;
$from->branch = '0001';
$from->account = '1234';
$from->document = '00000000000000';
$from->name = 'Company LTDA';

$to = new BankAccount;
$to->bankCode = '123';
$to->branch = '1234';
$to->account = '12345';
$to->document = '00000000000';
$to->name = 'John Doe';

// transfer BRL 5 (R$ 5)
$bankly->transfer(500, 'test', $from, $to);

This method returns an object. This object contains an "authenticationCode" property with a string, with a reference code for the transaction that you will use to check its status later.

Getting transfer status

Use the following method to retrieve a transaction's status. You will need to provide:

  • The origin branch
  • The origin account number
  • The AuthenticationId (that you receive as authenticationCode from the transfer method)
$bankly->getTransferStatus('0001', '1234', 'AuthenticationId');

This method returns a JSON object.

Getting banks list

You can get a list of banks and payment institutions with respective codes from the Central Bank (Bacen). No authentication is needed. You can either call this getter from your instance:

$banks = bankly->bankList;

Or use this static method directly (no class instancing needed):

$banks = Bankly::bankList();

This returns a JSON array. You can also perform this request using your browser by clicking here.

Debugging

You can define a function that receives debug logs (as strings) from your instance of the class.

$bankly.debug = function ($msg) {
	echo $msg . "\r\n";
};

jesobreira/bankly 适用场景与选型建议

jesobreira/bankly 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 28 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 04 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「Bank」 「baas」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 jesobreira/bankly 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 jesobreira/bankly 我们能提供哪些服务?
定制开发 / 二次开发

基于 jesobreira/bankly 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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