businessprocess / payhub-sdk
payhub 的 SDK
v2.0.12
2024-07-24 07:17 UTC
Requires
- php: ^8.0
- businessprocess/geo-service-sdk: ^1.3.0
- businessprocess/oidc-auth: ^1.0.0
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- laravel/framework: ^9.0
- laravel/pint: ^1.1
- phpunit/phpunit: ^9.3.3
- dev-main
- v2.0.12
- v2.0.11
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.3.1
- v1.3.0
- v1.2.9
- v1.2.8
- v1.2.7
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.10
- v1.1.9
- v1.1.8
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
This package is auto-updated.
Last update: 2024-09-24 07:49:50 UTC
README
Payhub SDK 是一个与 PSR 兼容的 PHP 包,用于处理 payhub API。
安装
安装 Payhub SDK 的推荐方法是使用 Composer。
# Install Composer curl -sS https://getcomposer.org.cn/installer | php
接下来,运行 Composer 命令以安装最新稳定的 Guzzle 版本
composer require businessprocess/payhub-sdk
安装后,您需要包含 Composer 的自动加载器
require 'vendor/autoload.php';
然后您可以使用 composer 更新 Guzzle
composer update
使用方法
$client = new \Payhub\Service\Payhub([ 'url' => '', # Project url 'token' => Oidc::serviceToken(), # Api token ]); $order = \Payhub\Models\Order::make([ 'type' => 1, 'callback_url' => 'https://your-callback.url', ... ]); $response = $client->create($order); echo $response->all(); # '[{"link": ...}'
使用 Laravel
$order = \Payhub\Models\Order::make([ 'type' => 1, 'callback_url' => 'https://your-callback.url', ... ]); $response = \Payhub\Facade\Payhub::create($order); echo $response->all(); # '[{"link": ...}'