sharik709/larawise

该包已被废弃且不再维护。未建议替代包。

laravel wise 包

dev-master 2022-07-16 22:17 UTC

This package is auto-updated.

Last update: 2023-11-17 01:06:35 UTC


README

Larawise 是一个 Laravel 包,用于帮助 Laravel 开发者更容易地与 Wise 平台 API 通信。

我正在努力添加更多方法以充分利用平台 API 服务。请捐赠以支持我的工作。谢谢!

Watch on GitHub Star on GitHub Tweet

安装

您可以使用以下命令使用 composer 安装它:composer require sharik709/larawise

使用方法

确保使用 Larawise 使用声明,如下命名空间:use Larawise\Larawise;

Larawise 将允许您访问所需的所有功能。

获取沙盒和生产环境 API 许可证

您可以通过访问 wise business api 页面来获取有关如何获取沙盒 API 令牌和生产 API 令牌的详细信息。

1. 用户资料

Wise 平台 API 需要接收用户资料 ID 才能获取余额,因为所有余额都与用户的资料相关联。

1.1 获取所有用户资料

以下方法将允许您接收您 API 令牌下所有资料的数组。

use Larawise\Larawise;

/** @var array */
$profiles = Larawise::profiles()->all();

1.2 获取特定用户资料

use Larawise\Larawise;

$profileId = 12345; // Wise's profile id. Which you can get by calling `all` method above.

/** @var array */
$profile = Larawise::profiles()->get($profileId);

2. 余额

余额需要用户资料 ID,您可以从 1.1 中获取。

2.1 获取所有余额

use Larawise\Larawise;

$profileId = 12345; // Wise's profile id. Which you can get by calling `all` method above.

/** @var array */
$profiles = Larawise::balance($profileId)->all();

2.2 获取特定余额

use Larawise\Larawise;

$profileId = 12345; // Wise's profile id. Which you can get by calling `all` method above.
$balanceId = 54321;

/** @var array */
$profile = Larawise::balance($profileId)->get($balanceId);

许可证

MIT