dnc-grafmen/white-pay-sdk
Composer 安装命令:
composer require dnc-grafmen/white-pay-sdk
包简介
README 文档
README
Simple PHP sdk for WhitePay api
Installation
composer require dnc-grafmen/white-pay-sdk
Usage
Make the WhitePayClientFactory and call his method create with parameters for create the WhitePayClient
Example
$apikey = 2300142124; $slug = 'my_super_secret_slug_from_account'; $factory = new \WhitePaySdk\Factory\WhitePayClientFactory(); $clientSandbox = $factory->create($apikey, $slug, new \GuzzleHttp\Client(), \WhitePaySdk\Constants::URL_SANDBOX); // or for production $clientProduction = $factory->create($apikey, $slug, new \GuzzleHttp\Client());
The next step - make the factory which implemented the PaymentFactoryInterface.
Example
$factory = new \WhitePaySdk\Factory\CreatePaymentFactory();
And we also need to create a DTO that implements DataDTOInterface
Example
$dto = new \WhitePaySdk\DTO\CreatePaymentDTO( new \WhitePaySdk\DTO\TransactionDTO( 300, 'USDT', '00231' 'https://my.site.com/payment/ok', 'https://my.site.com/payment/fail' ) );
And put this data to client send method.
Example
$response = $client->send($factory, $dto);
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2024-04-01