mirror of
http://124.126.16.154:8888/singularity/hdk-pay.git
synced 2026-01-15 03:35:06 +08:00
feat(stripe): 实现了 stripe 获取配置信息的服务方法
This commit is contained in:
@@ -12,11 +12,12 @@
|
||||
|
||||
use Money\Money;
|
||||
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.218:9611']);
|
||||
$service = \Hyperf\Support\make(StripeRpc::class, ['baseUrl' => 'http://192.168.2.218:9611']);
|
||||
$order = $service->createSession(
|
||||
money: Money::USD(51),
|
||||
uid: uniqid('NAT_'),
|
||||
@@ -27,3 +28,14 @@ test('能够正常创建 Stripe 订单', function () {
|
||||
);
|
||||
expect($order)->toBeInstanceOf(Order::class);
|
||||
});
|
||||
|
||||
test('能够正常获取 Stripe 配置信息', function () {
|
||||
/** @var StripeRpc $service */
|
||||
$service = \Hyperf\Support\make(StripeRpc::class, ['baseUrl' => 'http://192.168.2.218:9611']);
|
||||
$configures = $service->getConfigurations();
|
||||
|
||||
expect($configures)
|
||||
->toBeInstanceOf(StripeConfiguration::class)
|
||||
->toHaveKeys(['id', 'pk'])
|
||||
->and($configures->resolve())->toBeArray();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user