towoju5/bitnob
Composer 安装命令:
composer require towoju5/bitnob
包简介
Laravel wrapper around Bitnob virtual cards Rest API.
README 文档
README
This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors.
Installation
You can install the package via composer:
composer require towoju5/bitnob
Setup your base url and api key via the env file
BITNOB_API_KEY=pk.f75b136.8a9babaec7ce729be883a7111 BITNOB_BASE_URL='https://sandboxapi.bitnob.co/api/v1'
use Towoju5\Bitnob\Bitnob; $bitnob = new Bitnob;
Virtual cards Management
$bitnob = new Bitnob();
$cards = $bitnob->cards();
$regUser = $cards->regUser(array $data)
$create = $cards->create(array $data)
$topup = $cards->topup(array $data)
$action = $cards->action(string $action, string $cardId)
$getCard = $cards->getCard(string $cardId)
$getTransaction = $cards->getTransaction(string $cardId)
Manage Bitnob Customers
$bitnob = new Bitnob(); $customer = $bitnob->customer(); $createCustomer = $customer->createCustomer(array $data); $updateCustomer = $customer->updateCustomer(string $id, array $data); $listCustomer = $customer->listCustomer(string $id); $getCustomer = $customer->getCustomer(string $id);
Transfer/Payout
$bitnob = new Bitnob(); $transfer = $bitnob->transfer(); $initPayout = $transfer->initPayout(array $arrays) $completePayout = $transfer->completePayout(string $payoutInitId) $countryRequirements = $transfer->countryRequirements(string $country_code) $supportedCountries = $transfer->supportedCountries()
Beneficiary
$bitnob = new Bitnob(); $beneficiary = $bitnob->beneficiary(); $createBeneficiary = $beneficiary->createBeneficiary(array $data) $listBeneficiaries = $beneficiary->listBeneficiaries() $getBeneficiary = $beneficiary->getBeneficiary($beneficiary_id)
Hosted Checkout - BTC Payment
Note: Amount in Bitcoin and not satoshi
$bitnob = new Bitnob(); $checkout = $bitnob->checkout(); $createHostedCheckout = $checkout->createHostedCheckout(array $data) $getCheckoutStatus = $checkout->getCheckoutStatus($checkoutId) $getCheckouts = $checkout->getCheckouts($param = null) $getCheckout = $checkout->getCheckout($checkoutId)
Enroll user for card creation
// enroll user for card creation $data = [ 'customerEmail' => 'johnsmith@gmail.com', 'idNumber' => 'A00100010', 'idType' => 'PASSPORT', 'firstName' => 'Smith', 'lastName' => 'John', 'phoneNumber' => '08012345678', 'city' => 'ILORIN', 'state' => 'KWARA', 'country' => 'NIGERIA', 'zipCode' => '90011', 'line1' => 'ABC street, klotovan road', 'houseNumber' => 15, 'idImage' => 'https://example.com/image.png', ]; app('bitnob')->regUser($data);
Create card.
NOTE: user must be firstly enrolled for this service
$data = [
'customerEmail' => 'johndoe@gmail.com',
'cardBrand' => 'visa', // cardBrand should be "visa" or "mastercard"
'cardType' => 'virtual',
'reference' => '4f644a2c-3c4f-48c7-a3fa-e896b544d546',
'amount' => 5000,
];
app('bitnob')->create($data);
Card Topup.
NOTE: user must be firstly enrolled for this service
$arr = [
'cardId' => $data['cardId'],
'reference' => $data['reference'],
'amount' => $data['amount'],
];
app('bitnob')->topup($arr);
Perform action on card
$action = 'freeze'; // unfreeze
$cardId = '4f644a2c-3c4f-48c7-a3fa-e896b544d546';
app('bitnob')->action($action, $cardId);
Get single card
$cardId = '4f644a2c-3c4f-48c7-a3fa-e896b544d546';
app('bitnob')->getCard($cardId);
Get card getTransaction
$cardId = '4f644a2c-3c4f-48c7-a3fa-e896b544d546';
app('bitnob')->getTransaction($cardId);
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email towojuads@gmail.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Todo List
- ✅ Virtual Card
- ✅ Customers
- ✅ Payouts/Mobile Transfers
- ✅ Hosted Checkout
- ✅ Beneficiary
- ❌ Bitcoin Onchain
- ❌ Wallet
- ❌ Transactions
- ❌ StableCoins
towoju5/bitnob 适用场景与选型建议
towoju5/bitnob 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3.13k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2022 年 12 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「towoju5」 「bitnob」 「virtual cards」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 towoju5/bitnob 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 towoju5/bitnob 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 towoju5/bitnob 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Scroller is a virtual rendering plug-in for DataTables which allows large datasets to be drawn on screen very quickly. Virtual rendering means is that only the visible portion of the table is drawn, while the scrolling container gives the visual impression that the whole table is visible, allowing e
It's easy to work with a virtual wallet.
Scroller is a virtual rendering plug-in for DataTables which allows large datasets to be drawn on screen very quickly. Virtual rendering means is that only the visible portion of the table is drawn, while the scrolling container gives the visual impression that the whole table is visible, allowing e
Localpayment offers a fully localized payments solution that connects you with several local payment methods in many countries in emerging markets.
Laravel Virtual Classroom using Braincert Virtual Classroom API.
Bitpowr Laravel package for wallet address
统计信息
- 总下载量: 3.13k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-25