@bi-nova/services 1.4.0 → 1.4.1-beta.202606181754

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 CHANGED
@@ -278,6 +278,17 @@ interface HandleDyJsapiPayFlowResult {
278
278
  /** 抖音支付回调结果,type 为 pay_result 时返回 */
279
279
  payResult?: DouyinPayResult;
280
280
  }
281
+ /** 抖音授权代扣签约聚合流程返回数据 */
282
+ interface HandleDyAuthDebitSignFlowResult {
283
+ /** 结果类型:auth_redirect 表示已跳转授权,sign_result 表示已完成签约 SDK 调起 */
284
+ type: 'auth_redirect' | 'sign_result';
285
+ /** 抖音授权地址,type 为 auth_redirect 时返回 */
286
+ authUrl?: string;
287
+ /** 签约订单号,type 为 sign_result 时返回 */
288
+ orderNo?: string;
289
+ /** 抖音支付/签约回调结果,type 为 sign_result 时返回 */
290
+ payResult?: DouyinPayResult;
291
+ }
281
292
  /** handleDyPayFlow 入参 */
282
293
  interface HandleDyPayFlowParams {
283
294
  /** 商品金额(必传,单位:元) */
@@ -345,8 +356,8 @@ interface HandleDyPayFlowResult {
345
356
  interface GetDyPayRtaDataParams {
346
357
  /** 商品金额(非必传,单位:元) */
347
358
  price?: number;
348
- /** 手机号(必传) */
349
- telephone: string;
359
+ /** 手机号(非必传) */
360
+ telephone?: string;
350
361
  /** 设备编号(必传) */
351
362
  equipmentValue: string;
352
363
  }
@@ -367,8 +378,8 @@ interface GetDyPayRtaDataResult {
367
378
  }
368
379
  /** handleDyPayCommandFlow 入参 */
369
380
  interface HandleDyPayCommandFlowParams {
370
- /** 用户手机号,RTA 和口令接口都会使用 */
371
- telephone: string;
381
+ /** 用户手机号,未传时 RTA 和口令接口按空字符串透传 */
382
+ telephone?: string;
372
383
  /** 设备编号 */
373
384
  equipmentValue: string;
374
385
  /** RTA 查询金额,可选;不传则按 RTA 接口默认逻辑处理 */
@@ -423,7 +434,7 @@ declare function handleDyPayFlow(params: HandleDyPayFlowParams): Promise<BuildRe
423
434
  declare function getDyPayRtaData(params: GetDyPayRtaDataParams): Promise<BuildResultReturn<GetDyPayRtaDataResult>>;
424
435
  /**
425
436
  * 处理抖音支付口令完整流程
426
- * @param params.telephone 用户手机号,RTA 和口令接口都会使用
437
+ * @param params.telephone 用户手机号,非必传;未传时 RTA 和口令接口按空字符串透传
427
438
  * @param params.equipmentValue 设备编号
428
439
  * @param params.price RTA 查询金额,可选
429
440
  * @param params.commandUrl 指定生成口令的地址,不传则使用服务端默认地址
@@ -442,6 +453,15 @@ declare function handleDyPayCommandFlow(params: HandleDyPayCommandFlowParams): P
442
453
  * @returns 返回标准化结果,授权跳转时 type=auth_redirect,支付调起完成时 type=pay_result
443
454
  */
444
455
  declare function handleDyJsapiPayFlow(params: HandleDyJsapiPayFlowParams): Promise<BuildResultReturn<HandleDyJsapiPayFlowResult>>;
456
+ /**
457
+ * 处理抖音授权代扣签约聚合流程
458
+ *
459
+ * 内部完成授权 token 检查、requestId 读取、授权代扣签约接口调用、JSSDK 验签初始化和 dypay 调起。
460
+ * 无授权 token 时,会自动跳转抖音授权;授权回跳地址会保留当前页面参数并移除 url_token。
461
+ *
462
+ * @returns 返回标准化结果,授权跳转时 type=auth_redirect,签约调起完成时 type=sign_result
463
+ */
464
+ declare function handleDyAuthDebitSignFlow(): Promise<BuildResultReturn<HandleDyAuthDebitSignFlowResult>>;
445
465
 
446
466
  /**
447
467
  * @Description: 业务错误码定义
@@ -581,7 +601,13 @@ declare enum DyErrorCode {
581
601
  /** 抖音支付口令复制失败 */
582
602
  DY_PAY_COMMAND__COPY_FAILED = 3034,
583
603
  /** 抖音支付口令 RTA 数据无效 */
584
- DY_PAY_COMMAND__INVALID_RTA_DATA = 3035
604
+ DY_PAY_COMMAND__INVALID_RTA_DATA = 3035,
605
+ /** 缺少授权代扣签约 requestId */
606
+ DY_PAY__MISSING_AUTH_DEBIT_SIGN_REQUEST_ID = 3036,
607
+ /** 授权代扣签约失败 */
608
+ DY_PAY__AUTH_DEBIT_SIGN_FAILED = 3037,
609
+ /** 授权代扣签约请求失败 */
610
+ DY_PAY__REQUEST_AUTH_DEBIT_SIGN_FAILED = 3038
585
611
  }
586
612
  /**
587
613
  * 抖音业务错误信息映射
@@ -788,4 +814,4 @@ declare function normalizeDisplayAdData(advertConfigs: AdvertConfigItem[], fallb
788
814
  */
789
815
  declare function getDisplayAdConfig(options: GetDisplayAdOptions): Promise<BuildResultReturn<DisplayAdResult>>;
790
816
 
791
- export { type DisplayAdResult, DyErrorCode, DyErrorMessage, ENV_TYPE, EXTERNAL_ENV_TYPE, type GetDisplayAdOptions, type HandleDyJsapiPayFlowParams, type HandleDyJsapiPayFlowResult, type HandleDyPayCommandFlowParams, type HandleDyPayCommandFlowResult, type HandleDyPayFlowParams, type HandleDyPayFlowResult, JdErrorCode, JdErrorMessage, type JdInsuranceExternalOptions, type JdInsuranceOptions, type JdInsuranceResult, type JdjrCashLoanExternalOptions, type JdjrCashLoanOptions, type ServicesOptions, createServices, getDisplayAdConfig, getDyPayRtaData, handleDyJsapiPayFlow, handleDyPayCommandFlow, handleDyPayFlow, handleJdInsurance, handleJdInsuranceExt, handleJdjrCashLoanExt, handleJdjrCashLoanFlow, normalizeDisplayAdData };
817
+ export { type DisplayAdResult, DyErrorCode, DyErrorMessage, ENV_TYPE, EXTERNAL_ENV_TYPE, type GetDisplayAdOptions, type HandleDyAuthDebitSignFlowResult, type HandleDyJsapiPayFlowParams, type HandleDyJsapiPayFlowResult, type HandleDyPayCommandFlowParams, type HandleDyPayCommandFlowResult, type HandleDyPayFlowParams, type HandleDyPayFlowResult, JdErrorCode, JdErrorMessage, type JdInsuranceExternalOptions, type JdInsuranceOptions, type JdInsuranceResult, type JdjrCashLoanExternalOptions, type JdjrCashLoanOptions, type ServicesOptions, createServices, getDisplayAdConfig, getDyPayRtaData, handleDyAuthDebitSignFlow, handleDyJsapiPayFlow, handleDyPayCommandFlow, handleDyPayFlow, handleJdInsurance, handleJdInsuranceExt, handleJdjrCashLoanExt, handleJdjrCashLoanFlow, normalizeDisplayAdData };
package/dist/index.d.ts CHANGED
@@ -278,6 +278,17 @@ interface HandleDyJsapiPayFlowResult {
278
278
  /** 抖音支付回调结果,type 为 pay_result 时返回 */
279
279
  payResult?: DouyinPayResult;
280
280
  }
281
+ /** 抖音授权代扣签约聚合流程返回数据 */
282
+ interface HandleDyAuthDebitSignFlowResult {
283
+ /** 结果类型:auth_redirect 表示已跳转授权,sign_result 表示已完成签约 SDK 调起 */
284
+ type: 'auth_redirect' | 'sign_result';
285
+ /** 抖音授权地址,type 为 auth_redirect 时返回 */
286
+ authUrl?: string;
287
+ /** 签约订单号,type 为 sign_result 时返回 */
288
+ orderNo?: string;
289
+ /** 抖音支付/签约回调结果,type 为 sign_result 时返回 */
290
+ payResult?: DouyinPayResult;
291
+ }
281
292
  /** handleDyPayFlow 入参 */
282
293
  interface HandleDyPayFlowParams {
283
294
  /** 商品金额(必传,单位:元) */
@@ -345,8 +356,8 @@ interface HandleDyPayFlowResult {
345
356
  interface GetDyPayRtaDataParams {
346
357
  /** 商品金额(非必传,单位:元) */
347
358
  price?: number;
348
- /** 手机号(必传) */
349
- telephone: string;
359
+ /** 手机号(非必传) */
360
+ telephone?: string;
350
361
  /** 设备编号(必传) */
351
362
  equipmentValue: string;
352
363
  }
@@ -367,8 +378,8 @@ interface GetDyPayRtaDataResult {
367
378
  }
368
379
  /** handleDyPayCommandFlow 入参 */
369
380
  interface HandleDyPayCommandFlowParams {
370
- /** 用户手机号,RTA 和口令接口都会使用 */
371
- telephone: string;
381
+ /** 用户手机号,未传时 RTA 和口令接口按空字符串透传 */
382
+ telephone?: string;
372
383
  /** 设备编号 */
373
384
  equipmentValue: string;
374
385
  /** RTA 查询金额,可选;不传则按 RTA 接口默认逻辑处理 */
@@ -423,7 +434,7 @@ declare function handleDyPayFlow(params: HandleDyPayFlowParams): Promise<BuildRe
423
434
  declare function getDyPayRtaData(params: GetDyPayRtaDataParams): Promise<BuildResultReturn<GetDyPayRtaDataResult>>;
424
435
  /**
425
436
  * 处理抖音支付口令完整流程
426
- * @param params.telephone 用户手机号,RTA 和口令接口都会使用
437
+ * @param params.telephone 用户手机号,非必传;未传时 RTA 和口令接口按空字符串透传
427
438
  * @param params.equipmentValue 设备编号
428
439
  * @param params.price RTA 查询金额,可选
429
440
  * @param params.commandUrl 指定生成口令的地址,不传则使用服务端默认地址
@@ -442,6 +453,15 @@ declare function handleDyPayCommandFlow(params: HandleDyPayCommandFlowParams): P
442
453
  * @returns 返回标准化结果,授权跳转时 type=auth_redirect,支付调起完成时 type=pay_result
443
454
  */
444
455
  declare function handleDyJsapiPayFlow(params: HandleDyJsapiPayFlowParams): Promise<BuildResultReturn<HandleDyJsapiPayFlowResult>>;
456
+ /**
457
+ * 处理抖音授权代扣签约聚合流程
458
+ *
459
+ * 内部完成授权 token 检查、requestId 读取、授权代扣签约接口调用、JSSDK 验签初始化和 dypay 调起。
460
+ * 无授权 token 时,会自动跳转抖音授权;授权回跳地址会保留当前页面参数并移除 url_token。
461
+ *
462
+ * @returns 返回标准化结果,授权跳转时 type=auth_redirect,签约调起完成时 type=sign_result
463
+ */
464
+ declare function handleDyAuthDebitSignFlow(): Promise<BuildResultReturn<HandleDyAuthDebitSignFlowResult>>;
445
465
 
446
466
  /**
447
467
  * @Description: 业务错误码定义
@@ -581,7 +601,13 @@ declare enum DyErrorCode {
581
601
  /** 抖音支付口令复制失败 */
582
602
  DY_PAY_COMMAND__COPY_FAILED = 3034,
583
603
  /** 抖音支付口令 RTA 数据无效 */
584
- DY_PAY_COMMAND__INVALID_RTA_DATA = 3035
604
+ DY_PAY_COMMAND__INVALID_RTA_DATA = 3035,
605
+ /** 缺少授权代扣签约 requestId */
606
+ DY_PAY__MISSING_AUTH_DEBIT_SIGN_REQUEST_ID = 3036,
607
+ /** 授权代扣签约失败 */
608
+ DY_PAY__AUTH_DEBIT_SIGN_FAILED = 3037,
609
+ /** 授权代扣签约请求失败 */
610
+ DY_PAY__REQUEST_AUTH_DEBIT_SIGN_FAILED = 3038
585
611
  }
586
612
  /**
587
613
  * 抖音业务错误信息映射
@@ -788,4 +814,4 @@ declare function normalizeDisplayAdData(advertConfigs: AdvertConfigItem[], fallb
788
814
  */
789
815
  declare function getDisplayAdConfig(options: GetDisplayAdOptions): Promise<BuildResultReturn<DisplayAdResult>>;
790
816
 
791
- export { type DisplayAdResult, DyErrorCode, DyErrorMessage, ENV_TYPE, EXTERNAL_ENV_TYPE, type GetDisplayAdOptions, type HandleDyJsapiPayFlowParams, type HandleDyJsapiPayFlowResult, type HandleDyPayCommandFlowParams, type HandleDyPayCommandFlowResult, type HandleDyPayFlowParams, type HandleDyPayFlowResult, JdErrorCode, JdErrorMessage, type JdInsuranceExternalOptions, type JdInsuranceOptions, type JdInsuranceResult, type JdjrCashLoanExternalOptions, type JdjrCashLoanOptions, type ServicesOptions, createServices, getDisplayAdConfig, getDyPayRtaData, handleDyJsapiPayFlow, handleDyPayCommandFlow, handleDyPayFlow, handleJdInsurance, handleJdInsuranceExt, handleJdjrCashLoanExt, handleJdjrCashLoanFlow, normalizeDisplayAdData };
817
+ export { type DisplayAdResult, DyErrorCode, DyErrorMessage, ENV_TYPE, EXTERNAL_ENV_TYPE, type GetDisplayAdOptions, type HandleDyAuthDebitSignFlowResult, type HandleDyJsapiPayFlowParams, type HandleDyJsapiPayFlowResult, type HandleDyPayCommandFlowParams, type HandleDyPayCommandFlowResult, type HandleDyPayFlowParams, type HandleDyPayFlowResult, JdErrorCode, JdErrorMessage, type JdInsuranceExternalOptions, type JdInsuranceOptions, type JdInsuranceResult, type JdjrCashLoanExternalOptions, type JdjrCashLoanOptions, type ServicesOptions, createServices, getDisplayAdConfig, getDyPayRtaData, handleDyAuthDebitSignFlow, handleDyJsapiPayFlow, handleDyPayCommandFlow, handleDyPayFlow, handleJdInsurance, handleJdInsuranceExt, handleJdjrCashLoanExt, handleJdjrCashLoanFlow, normalizeDisplayAdData };