mirror of
http://124.126.16.154:8888/singularity/hdk-pay.git
synced 2026-01-15 07:35:09 +08:00
- 移除 CreateInvoiceCmd 中的 uid 字段 - 更新 InvoiceRepo 中的 create 方法,移除 URL 中的 uid - 修改 PointLogRepo 中的 getList 方法,增加 type 参数并更新 API 调用 - 更新相关测试文件以适应这些变更
44 lines
1.2 KiB
PHP
44 lines
1.2 KiB
PHP
<?php
|
|
|
|
/**
|
|
* StripeTest.php@Pay
|
|
*
|
|
* @author 李东云 <Dongyun.Li@LuxCreo.Ai>
|
|
* Powered by PhpStorm
|
|
* Created on 2023/9/19
|
|
*/
|
|
|
|
/** @var StripeRpc $service */
|
|
|
|
use Money\Money;
|
|
use Singularity\HDK\Core\I18n\Enum\Languages;
|
|
use Singularity\HDK\Pay\Resource\Order;
|
|
use Singularity\HDK\Pay\Resource\StripeConfiguration;
|
|
use Singularity\HDK\Pay\Sdk\StripeRpc;
|
|
|
|
test('能够正常创建 Stripe 订单', function () {
|
|
/** @var StripeRpc $service */
|
|
$service = \Hyperf\Support\make(StripeRpc::class, ['baseUrl' => 'http://192.168.2.246:9611']);
|
|
$order = $service->createSession(
|
|
money: Money::USD(51),
|
|
uid: uniqid('NAT_'),
|
|
goodsId: 1,
|
|
goodsName: 'HDK-Pay Test',
|
|
goodsDetail: [],
|
|
locale: Languages::EN,
|
|
service: 1
|
|
);
|
|
expect($order)->toBeInstanceOf(Order::class);
|
|
})->skip();
|
|
|
|
test('能够正常获取 Stripe 配置信息', function () {
|
|
/** @var StripeRpc $service */
|
|
$service = \Hyperf\Support\make(StripeRpc::class, ['baseUrl' => 'http://192.168.2.246:9611']);
|
|
$configures = $service->getConfigurations();
|
|
|
|
expect($configures)
|
|
->toBeInstanceOf(StripeConfiguration::class)
|
|
->toHaveKeys(['id', 'pk'])
|
|
->and($configures->resolve())->toBeArray();
|
|
})->skip();
|