bmatovu/laravel-beyonic

Beyonic API 的 Laravel 封装

v0.0.1 2023-03-26 19:02 UTC

This package is auto-updated.

Last update: 2024-08-26 21:58:17 UTC


README

Total Downloads Latest Stable Version License Code Quality Code Coverage Tests Documentation

介绍

本软件包帮助您将 Beyonic 集成到 Laravel 应用程序中。Beyonic

注册并创建您的客户端应用程序

沙盒

实时

安装

要开始,请通过 Composer 软件包管理器安装该软件包

composer require bmatovu/laravel-beyonic

配置定制

如果您想定制默认配置,可以使用以下方法导出默认配置

php artisan vendor:publish --provider="Bmatovu\Beyonic\BeyonicServiceProvider" --tag="config"

在您的环境文件中更新以下设置。

.env

+ BEYONIC_API_URI=https://api.beyonic.com/api/
+ BEYONIC_API_TOKEN=...
+ BEYONIC_API_VERSION=v3
+ BEYONIC_CURRENCY=BXC
+ BEYONIC_SEND_INSTRUCTIONS=true

用法

use Bmatovu\Beyonic\Services\Collection;

$collection = new Collection();

// Request a user to pay you
$apiTransactionResponse = $collection->ask('+80000000004', 500);
$transaction = json_decode($apiTransactionResponse);

// Get transaction details
$apiTransactionResponse = $collection->get($transaction->id);

// Get transactions
$apiTransactionsResponse = $collection->all();

报告错误

如果您遇到错误,请尽可能多地提供有关错误的信息,例如

  • 重放步骤
  • 预期结果
  • 实际结果

这将帮助我们尽快修复错误,如果您想自行修复,请随意 分支软件包 并提交拉取请求!