@nvwa-app/sdk-functions 6.30.0 → 6.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -20,6 +20,8 @@ declare function getRequestUser(req: Request, baseUrlOverride?: string): Promise
|
|
|
20
20
|
|
|
21
21
|
/** 支付端类型:与 integrations/payment 中的 supportedPlatforms 一致,用于按端过滤可用 provider。 */
|
|
22
22
|
type PaymentPlatform = "web" | "uniapp" | "wechat-miniprogram" | "alipay-miniprogram";
|
|
23
|
+
/** 项目平台类型(透传到 payment-gateway 的 platformType 字段)。 */
|
|
24
|
+
type ProjectPlatformType = "DesktopWeb" | "MobileWeb" | "AndroidApp" | "IosApp" | "HarmonyApp" | "WechatMiniProgram" | "AlipayMiniProgram" | "DouyinMiniProgram";
|
|
23
25
|
interface PaymentGatewayClientOptions {
|
|
24
26
|
baseUrl: string;
|
|
25
27
|
/** Project key (PAYMENT_PROJECT_KEY) for project-side auth; gateway validates via X-Payment-Project-Key */
|
|
@@ -37,8 +39,8 @@ interface CreateOrderParams {
|
|
|
37
39
|
metadata?: Record<string, unknown>;
|
|
38
40
|
workspaceId?: string;
|
|
39
41
|
projectId?: string;
|
|
40
|
-
/**
|
|
41
|
-
|
|
42
|
+
/** 项目平台类型。 */
|
|
43
|
+
platformType?: ProjectPlatformType;
|
|
42
44
|
}
|
|
43
45
|
interface CreateOrderResult {
|
|
44
46
|
platformOrderId: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ declare function getRequestUser(req: Request, baseUrlOverride?: string): Promise
|
|
|
20
20
|
|
|
21
21
|
/** 支付端类型:与 integrations/payment 中的 supportedPlatforms 一致,用于按端过滤可用 provider。 */
|
|
22
22
|
type PaymentPlatform = "web" | "uniapp" | "wechat-miniprogram" | "alipay-miniprogram";
|
|
23
|
+
/** 项目平台类型(透传到 payment-gateway 的 platformType 字段)。 */
|
|
24
|
+
type ProjectPlatformType = "DesktopWeb" | "MobileWeb" | "AndroidApp" | "IosApp" | "HarmonyApp" | "WechatMiniProgram" | "AlipayMiniProgram" | "DouyinMiniProgram";
|
|
23
25
|
interface PaymentGatewayClientOptions {
|
|
24
26
|
baseUrl: string;
|
|
25
27
|
/** Project key (PAYMENT_PROJECT_KEY) for project-side auth; gateway validates via X-Payment-Project-Key */
|
|
@@ -37,8 +39,8 @@ interface CreateOrderParams {
|
|
|
37
39
|
metadata?: Record<string, unknown>;
|
|
38
40
|
workspaceId?: string;
|
|
39
41
|
projectId?: string;
|
|
40
|
-
/**
|
|
41
|
-
|
|
42
|
+
/** 项目平台类型。 */
|
|
43
|
+
platformType?: ProjectPlatformType;
|
|
42
44
|
}
|
|
43
45
|
interface CreateOrderResult {
|
|
44
46
|
platformOrderId: string;
|
package/dist/index.js
CHANGED
|
@@ -236,7 +236,7 @@ function createPaymentClient(options) {
|
|
|
236
236
|
successNotifyUrl: params.successNotifyUrl,
|
|
237
237
|
successNotifySecret: params.successNotifySecret,
|
|
238
238
|
metadata: params.metadata,
|
|
239
|
-
|
|
239
|
+
platformType: params.platformType
|
|
240
240
|
};
|
|
241
241
|
const data = await post("/api/platform/payment/create", payload);
|
|
242
242
|
return { platformOrderId: data.platformOrderId, payParams: data.payParams };
|
package/dist/index.mjs
CHANGED
|
@@ -188,7 +188,7 @@ function createPaymentClient(options) {
|
|
|
188
188
|
successNotifyUrl: params.successNotifyUrl,
|
|
189
189
|
successNotifySecret: params.successNotifySecret,
|
|
190
190
|
metadata: params.metadata,
|
|
191
|
-
|
|
191
|
+
platformType: params.platformType
|
|
192
192
|
};
|
|
193
193
|
const data = await post("/api/platform/payment/create", payload);
|
|
194
194
|
return { platformOrderId: data.platformOrderId, payParams: data.payParams };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nvwa-app/sdk-functions",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.32.0",
|
|
4
4
|
"description": "NVWA Edge Functions SDK: db, payment gateway, auth, provider list. Use in Deno: import from 'npm:@nvwa-app/sdk-functions'.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|