wxpay-nodejs-sdk 0.2.2 → 0.2.3

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
@@ -8,7 +8,7 @@ interface WxPayResponse<T = unknown> {
8
8
  data: T;
9
9
  }
10
10
  /** 微信支付 API 错误信息 */
11
- interface WxPayErrorDetail {
11
+ interface WxPayErrorDetail$1 {
12
12
  /** 错误码 */
13
13
  code: string;
14
14
  /** 错误描述 */
@@ -4782,6 +4782,22 @@ declare class WxPayClient {
4782
4782
  private createVerifier;
4783
4783
  }
4784
4784
 
4785
+ /**
4786
+ * 微信支付 API 错误信息
4787
+ */
4788
+ interface WxPayErrorDetail {
4789
+ /** 错误码 */
4790
+ code: string;
4791
+ /** 错误描述 */
4792
+ message: string;
4793
+ /** 详细错误信息 */
4794
+ detail?: {
4795
+ field: string;
4796
+ value: string;
4797
+ issue: string;
4798
+ location?: string;
4799
+ }[];
4800
+ }
4785
4801
  /**
4786
4802
  * 微信支付 API V3 自定义错误类
4787
4803
  */
@@ -4797,7 +4813,132 @@ declare class WxPayError extends Error {
4797
4813
  get isClientError(): boolean;
4798
4814
  /** 是否为服务端错误 (5xx) */
4799
4815
  get isServerError(): boolean;
4816
+ /**
4817
+ * 判断是否为特定错误码
4818
+ *
4819
+ * @param code - 错误码
4820
+ * @returns 是否匹配
4821
+ */
4822
+ isApiError(code: string): boolean;
4823
+ }
4824
+ /**
4825
+ * 服务异常
4826
+ *
4827
+ * HTTP 状态码非 2xx 时抛出,包含微信支付返回的业务错误码和错误信息。
4828
+ */
4829
+ declare class ServiceException extends WxPayError {
4830
+ /** 微信支付业务错误码 */
4831
+ readonly errorCode: string;
4832
+ /** 微信支付业务错误信息 */
4833
+ readonly errorMessage: string;
4834
+ constructor(status: number, headers: Record<string, string>, detail: WxPayErrorDetail);
4835
+ }
4836
+ /**
4837
+ * HTTP 请求异常
4838
+ *
4839
+ * 网络请求失败、超时等场景抛出。
4840
+ */
4841
+ declare class HttpException extends WxPayError {
4842
+ constructor(message: string, cause?: Error);
4843
+ }
4844
+ /**
4845
+ * 验签异常
4846
+ *
4847
+ * 应答或回调签名验证失败时抛出。
4848
+ */
4849
+ declare class ValidationException extends WxPayError {
4850
+ constructor(message: string);
4851
+ }
4852
+ /**
4853
+ * 解密异常
4854
+ *
4855
+ * AES-256-GCM 或 RSA-OAEP 解密失败时抛出。
4856
+ */
4857
+ declare class DecryptionException extends WxPayError {
4858
+ constructor(message: string);
4800
4859
  }
4860
+ /**
4861
+ * 报文格式异常
4862
+ *
4863
+ * 响应 JSON 解析失败、Content-Type 不正确等场景抛出。
4864
+ */
4865
+ declare class MalformedMessageException extends WxPayError {
4866
+ constructor(message: string);
4867
+ }
4868
+
4869
+ /**
4870
+ * 注册敏感字段
4871
+ *
4872
+ * 标记某个类型的哪些字段是敏感信息,需要自动加解密。
4873
+ *
4874
+ * @param typeName - 类型名称(通常是接口名)
4875
+ * @param fields - 敏感字段名列表
4876
+ *
4877
+ * @example
4878
+ * ```ts
4879
+ * interface AddReceiverRequest {
4880
+ * name?: string;
4881
+ * type: string;
4882
+ * }
4883
+ * registerSensitiveFields('AddReceiverRequest', ['name']);
4884
+ * ```
4885
+ */
4886
+ declare function registerSensitiveFields(typeName: string, fields: string[]): void;
4887
+ /**
4888
+ * 自动加密对象中的敏感字段
4889
+ *
4890
+ * 根据注册的敏感字段信息,使用微信支付公钥加密指定字段。
4891
+ * 加密后的字段值为 Base64 编码的密文。
4892
+ *
4893
+ * @param obj - 待加密的对象
4894
+ * @param typeName - 类型名称
4895
+ * @param publicKey - 微信支付公钥(PEM 格式)
4896
+ * @returns 加密后的对象副本
4897
+ *
4898
+ * @example
4899
+ * ```ts
4900
+ * const request = { name: '张三', type: 'PERSONAL_OPENID' };
4901
+ * const encrypted = encryptSensitiveFields(request, 'AddReceiverRequest', publicKey);
4902
+ * // encrypted.name 为加密后的 Base64 密文
4903
+ * ```
4904
+ */
4905
+ declare function encryptSensitiveFields<T extends Record<string, unknown>>(obj: T, typeName: string, publicKey: string | Buffer): T;
4906
+ /**
4907
+ * 自动解密对象中的敏感字段
4908
+ *
4909
+ * 根据注册的敏感字段信息,使用商户私钥解密指定字段。
4910
+ *
4911
+ * @param obj - 待解密的对象
4912
+ * @param typeName - 类型名称
4913
+ * @param privateKey - 商户私钥(PEM 格式)
4914
+ * @returns 解密后的对象副本
4915
+ *
4916
+ * @example
4917
+ * ```ts
4918
+ * const response = { name: 'Base64密文...', type: 'PERSONAL_OPENID' };
4919
+ * const decrypted = decryptSensitiveFields(response, 'ReceiverInfo', privateKey);
4920
+ * // decrypted.name 为解密后的明文
4921
+ * ```
4922
+ */
4923
+ declare function decryptSensitiveFields<T extends Record<string, unknown>>(obj: T, typeName: string, privateKey: string | Buffer): T;
4924
+ /**
4925
+ * 批量加密数组中每个对象的敏感字段
4926
+ *
4927
+ * @param arr - 待加密的对象数组
4928
+ * @param typeName - 类型名称
4929
+ * @param publicKey - 微信支付公钥(PEM 格式)
4930
+ * @returns 加密后的数组副本
4931
+ */
4932
+ declare function encryptSensitiveFieldsInArray<T extends Record<string, unknown>>(arr: T[], typeName: string, publicKey: string | Buffer): T[];
4933
+ /**
4934
+ * 批量解密数组中每个对象的敏感字段
4935
+ *
4936
+ * @param arr - 待解密的对象数组
4937
+ * @param typeName - 类型名称
4938
+ * @param privateKey - 商户私钥(PEM 格式)
4939
+ * @returns 解密后的数组副本
4940
+ */
4941
+ declare function decryptSensitiveFieldsInArray<T extends Record<string, unknown>>(arr: T[], typeName: string, privateKey: string | Buffer): T[];
4801
4942
 
4802
4943
  /**
4803
4944
  * 解密后的平台证书信息
@@ -6509,7 +6650,7 @@ declare class CallbackHandler {
6509
6650
  * @param headers - 回调请求头
6510
6651
  * @param body - 回调请求体(原始 JSON 字符串)
6511
6652
  * @returns 签名验证是否通过
6512
- * @throws 如果签名类型不支持或找不到对应的证书
6653
+ * @throws 如果必填参数缺失、签名类型不支持或找不到对应的证书
6513
6654
  */
6514
6655
  verifySignature(headers: CallbackHeaders, body: string): boolean;
6515
6656
  /**
@@ -6519,7 +6660,7 @@ declare class CallbackHandler {
6519
6660
  *
6520
6661
  * @param notification - 回调通知 JSON 对象
6521
6662
  * @returns 解密后的业务数据
6522
- * @throws 如果解密后的数据为空或格式无效
6663
+ * @throws 如果通知结构无效、算法不匹配或解密失败
6523
6664
  */
6524
6665
  decryptNotification<T = unknown>(notification: CallbackNotification): DecryptedCallback<T>;
6525
6666
  /**
@@ -6698,6 +6839,7 @@ declare class CallbackHandler {
6698
6839
  * @param associatedData - 附加数据(用于 AEAD 认证)
6699
6840
  * @param nonce - 随机串
6700
6841
  * @returns 解密后的明文字符串
6842
+ * @throws 如果密文格式无效或解密失败
6701
6843
  */
6702
6844
  private aesGcmDecrypt;
6703
6845
  }
@@ -8318,6 +8460,7 @@ declare function buildSignString(payload: SignPayload): string;
8318
8460
  * @param signString - 待签名字符串
8319
8461
  * @param privateKey - PEM 格式的商户 API 私钥
8320
8462
  * @returns Base64 编码的签名值
8463
+ * @throws 如果 signString 或 privateKey 为空
8321
8464
  */
8322
8465
  declare function sign(signString: string, privateKey: string | Buffer): string;
8323
8466
  /**
@@ -8353,6 +8496,8 @@ declare function isTimestampValid(timestamp: string): boolean;
8353
8496
  * @param timestamp - HTTP 头 Wechatpay-Timestamp
8354
8497
  * @param nonce - HTTP 头 Wechatpay-Nonce
8355
8498
  * @param publicKey - 微信支付公钥或平台证书公钥(PEM 格式)
8499
+ * @returns 验签是否通过
8500
+ * @throws 如果必填参数缺失
8356
8501
  */
8357
8502
  declare function verifySignature(body: string, signature: string, timestamp: string, nonce: string, publicKey: string | Buffer): boolean;
8358
8503
  /**
@@ -8363,7 +8508,8 @@ declare function verifySignature(body: string, signature: string, timestamp: str
8363
8508
  *
8364
8509
  * @param plaintext - 待加密的明文
8365
8510
  * @param publicKey - 微信支付公钥或平台证书公钥(PEM 格式)
8366
- * @returns Base64 编码的密文
8511
+ * @returns Base64 编码的密文,空字符串输入返回空字符串
8512
+ * @throws 如果 publicKey 为空
8367
8513
  */
8368
8514
  declare function oaepEncrypt(plaintext: string, publicKey: string | Buffer): string;
8369
8515
  /**
@@ -8374,8 +8520,9 @@ declare function oaepEncrypt(plaintext: string, publicKey: string | Buffer): str
8374
8520
  *
8375
8521
  * @param ciphertext - Base64 编码的密文
8376
8522
  * @param privateKey - 商户 API 私钥(PEM 格式)
8377
- * @returns 解密后的明文字符串
8523
+ * @returns 解密后的明文字符串,空字符串输入返回空字符串
8524
+ * @throws 如果 privateKey 为空或密文格式无效
8378
8525
  */
8379
8526
  declare function oaepDecrypt(ciphertext: string, privateKey: string | Buffer): string;
8380
8527
 
8381
- export { type ActivateCouponStockRequest, type ActivateCouponStockResponse, type AddProfitSharingReceiverRequest, type AddProfitSharingReceiverResponse, type AppBridgeConfig, AppService, type ApplyAbnormalRefundRequest, type ApplyAbnormalRefundResponse, type ApplyMerchantTransferElecSignByOutBillNoRequest, type ApplyMerchantTransferElecSignByTransferBillNoRequest, type ApplyMerchantTransferElecSignResponse, type ApplyParkingRefundRequest, type ApplyParkingRefundResponse, type AssignSmartGuideRequest, type AuthorizationCloseInfo, type AuthorizationCloseReason, BillService, type BuildPartnershipRequest, type BuildPartnershipResponse, type BusinessCircleAuthorizeCallbackData, type BusinessCircleRefundCallbackData, BusinessCircleService, type BusinessCircleTransactionCallbackData, CallbackHandler, type CallbackHeaders, type CallbackNotification, type CallbackResource, type CancelMerchantTransferResponse, type CancelPayScoreOrderRequest, type CancelPayScoreOrderResponse, CertificateManager, CertificateService, type CloseCombineOrderParams, type CloseCombineOrderRequest, type CloseCombineSubOrder, type CloseMerchantTransferAuthorizationResponse, type CloseOrderParams, type CloseOrderRequest, CombineAppService, CombineH5Service, CombineMiniProgramService, CombineNativeService, type CombinePayerInfo, type CombinePayerInfoResponse, type CombinePromotionDetail, type CombinePromotionGoodsDetail, type CombineSceneInfo, type CombineSceneInfoResponse, CombineService, type CombineSubOrder, type CombineSubOrderAmount, type CombineSubOrderAmountResponse, type CombineSubOrderResponse, type CombineSubOrderSettleInfo, type CombineTransactionCallbackData, type CombineTransactionSubOrder, type ComplaintCallbackData, type ComplaintCallbackUrlRequest, type ComplaintCallbackUrlResponse, type ComplaintNegotiationHistoryResponse, type ComplaintNegotiationRecord, type ComplaintNegotiationState, ComplaintService, type ComplaintState, type ComplaintSummary, type CompleteComplaintRequest, type CompletePayScoreOrderRequest, type CompletePayScoreOrderResponse, type CouponConsumeGoodsDetail, type CouponConsumeInformation, type CouponCutToMessage, type CouponFixedNormalCoupon, type CouponLimitCard, type CouponNormalCouponInformation, type CouponPatternInfo, CouponService, type CouponStatus, type CouponStockItem, type CouponStockStatus, type CouponStockType, type CouponStockUseRule, type CouponType, type CouponUseCallbackData, type CouponUseRule, type CreateAppCombineOrderRequest, type CreateAppCombineOrderResponse, type CreateAppOrderRequest, type CreateAppOrderResponse, type CreateCombineOrderRequest, type CreateCombineOrderResponse, type CreateCouponStockRequest, type CreateCouponStockResponse, type CreateH5CombineOrderRequest, type CreateH5CombineOrderResponse, type CreateH5OrderRequest, type CreateH5OrderResponse, type CreateJsapiOrderRequest, type CreateJsapiOrderResponse, type CreateMedInsOrderRequest, type CreateMerchantTransferAuthorizationRequest, type CreateMerchantTransferAuthorizationResponse, type CreateMerchantTransferRequest, type CreateMerchantTransferResponse, type CreateMiniProgramCombineOrderRequest, type CreateMiniProgramCombineOrderResponse, type CreateNativeCombineOrderRequest, type CreateNativeCombineOrderResponse, type CreateNativeOrderRequest, type CreateNativeOrderResponse, type CreateParkingRequest, type CreateParkingResponse, type CreateParkingTransactionRequest, type CreateParkingTransactionResponse, type CreatePayGiftActivityRequest, type CreatePayGiftActivityResponse, type CreatePayScoreOrderRequest, type CreatePayScoreOrderResponse, type CreateProfitSharingOrderRequest, type CreateProfitSharingOrderResponse, type CreateProfitSharingReturnOrderRequest, type CreateProfitSharingReturnOrderResponse, type CreateRefundRequest, type CreateRefundResponse, type CreateTransferAfterAuthorizationRequest, type CreateTransferAfterAuthorizationResponse, type CreateTransferWithAuthorizationRequest, type CreateTransferWithAuthorizationResponse, type DecryptedCallback, type DecryptedCertificate, type DeleteProfitSharingReceiverRequest, type DeleteProfitSharingReceiverResponse, type DownloadBillParams, type DownloadBillResponse, type DownloadCouponStockFlowResponse, type EchoTestRequest, type EchoTestResponse, type ElecSignHashType, type ElecSignState, type FundFlowBillParams, type FundFlowBillResponse, type GetPayGiftActivityGoodsResponse, type GetPayGiftActivityMerchantsResponse, GoldPlanService, type GoodsDetail, type H5CombineSceneInfo, type H5Info, type H5SceneInfo, H5Service, type JsapiBridgeConfig, JsapiService, LoveFeastService, type MedInsCashAddEntity, type MedInsCashReduceEntity, type MedInsJsapiBridgeConfig, type MedInsMedInsPayStatus, type MedInsMiniProgramBridgeConfig, type MedInsMixPayStatus, type MedInsMixPayType, type MedInsOrderResponse, type MedInsOrderType, type MedInsPersonIdentification, type MedInsRefundCallbackData, type MedInsSelfPayStatus, MedInsService, type MedInsSuccessCallbackData, MediaService, MerchantExclusiveCouponService, type MerchantTransferAuthorizationCallbackData, type MerchantTransferAuthorizationJsapiBridgeConfig, type MerchantTransferAuthorizationState, type MerchantTransferCallbackData, type MerchantTransferJsapiBridgeConfig, MerchantTransferService, type MerchantTransferState, type MiniProgramBridgeConfig, type ModifyPayScoreOrderRequest, type ModifyPayScoreOrderResponse, NativeService, type OrderAmount, type OrderAmountResponse, type OrderDetail, type OrderPayer, type ParkingAmount, type ParkingAppBridgeConfig, type ParkingBlockReason, type ParkingCallbackBlockReason, type ParkingEntryStatusCallbackData, type ParkingH5BridgeConfig, type ParkingMiniProgramBridgeConfig, type ParkingPayer, type ParkingPromotionDetail, type ParkingRefundAmount, type ParkingRefundFrom, type ParkingRefundGoodsDetail, type ParkingRefundPromotionDetail, type ParkingRepayBridgeConfig, type ParkingSceneInfo, ParkingService, type ParkingState, type ParkingTradeState, type ParkingTransactionCallbackData, type PartnershipAuthorizedData, type PartnershipBusinessType, type PartnershipPartner, type PartnershipPartnerType, type PartnershipRecord, PartnershipService, type PartnershipState, type PauseCouponStockRequest, type PauseCouponStockResponse, PayGiftActivityService, type PayGiftActivityState, type PayGiftActivitySummary, type PayScoreAppBridgeConfig, type PayScoreCollection, type PayScoreCollectionDetail, type PayScoreCollectionState, type PayScoreDetailAppBridgeConfig, type PayScoreDetailJsapiBridgeConfig, type PayScoreDetailMiniProgramBridgeConfig, type PayScoreDevice, type PayScoreDiscount, type PayScoreJsapiBridgeConfig, type PayScoreLocation, type PayScoreMiniProgramBridgeConfig, type PayScoreOrderState, type PayScoreOrderStateDescription, type PayScorePayment, type PayScorePromotionDetail, type PayScorePromotionGoodsDetail, type PayScoreRefundCallbackData, type PayScoreRiskFund, PayScoreService, type PayScoreTimeRange, type PayScoreUserConfirmCallbackData, type PayScoreUserPaidCallbackData, PayrollCardService, type PlateColor, type PlateServiceState, type PlatformCertificate, type ProfitSharingBillParams, type ProfitSharingBillResponse, type ProfitSharingCallbackData, type ProfitSharingFailReason, type ProfitSharingReceiver, type ProfitSharingReceiverResponse, type ProfitSharingReceiverResult, type ProfitSharingReceiverType, type ProfitSharingRelationType, type ProfitSharingReturnFailReason, type ProfitSharingReturnResult, ProfitSharingService, type ProfitSharingState, type PromotionDetail, type PromotionGoodsDetail, type QueryBusinessCircleAuthorizationResponse, type QueryBusinessCirclePendingPointsParams, type QueryBusinessCirclePendingPointsResponse, type QueryCombineOrderParams, type QueryCombineOrderResponse, type QueryComplaintResponse, type QueryComplaintsParams, type QueryComplaintsResponse, type QueryCouponDetailParams, type QueryCouponDetailResponse, type QueryCouponStockItemsParams, type QueryCouponStockItemsResponse, type QueryCouponStockMerchantsParams, type QueryCouponStockMerchantsResponse, type QueryCouponStocksParams, type QueryCouponStocksResponse, type QueryMerchantTransferAuthorizationResponse, type QueryMerchantTransferElecSignResponse, type QueryMerchantTransferResponse, type QueryOrderParams, type QueryOrderResponse, type QueryParkingOrderResponse, type QueryParkingRefundResponse, type QueryPartnershipsParams, type QueryPartnershipsResponse, type QueryPayGiftActivitiesParams, type QueryPayGiftActivitiesResponse, type QueryPayGiftActivityResponse, type QueryPayScoreOrderParams, type QueryPayScoreOrderResponse, type QueryPlateServiceParams, type QueryPlateServiceResponse, type QueryProfitSharingAmountResponse, type QueryProfitSharingOrderParams, type QueryProfitSharingOrderResponse, type QueryProfitSharingReturnOrderParams, type QueryProfitSharingReturnOrderResponse, type QueryRefundParams, type QueryRefundResponse, type QuerySmartGuidesParams, type QuerySmartGuidesResponse, type QueryUserCouponsParams, type QueryUserCouponsResponse, type RefundAmount, type RefundAmountResponse, type RefundCallbackData, type RefundFromAccount, type RefundGoodsDetail, type RefundPromotionDetail, type RegisterSmartGuideRequest, type RegisterSmartGuideResponse, type ReplyComplaintRequest, type ReplyImmediateServiceRequest, type RequestParams, type RestartCouponStockRequest, type RestartCouponStockResponse, RetailStoreService, ScanAndRideService, type SceneInfo, type SceneInfoResponse, SecurityService, type SendCouponRequest, type SendCouponResponse, type SetCouponCallbackRequest, type SetCouponCallbackResponse, type SettleInfo, type SignPayload, type SignType, type SignatureType, type SmartGuide, SmartGuideService, type StoreInfo, type SyncBusinessCircleParkingStatusRequest, type SyncBusinessCirclePointsRequest, type SyncPayScoreOrderRequest, type SyncPayScoreOrderResponse, type TradeBillParams, type TradeBillResponse, type TransactionCallbackData, type TransferSceneReportInfo, type UnfreezeProfitSharingRequest, type UnfreezeProfitSharingResponse, type UpdateComplaintRefundRequest, type UpdateSmartGuideRequest, type UploadComplaintImageResponse, type UploadMarketingImageRequest, type UploadMarketingImageResponse, type UserCouponItem, WxPayClient, WxPayError, type WxPayErrorDetail, type WxPayOptions, type WxPayResponse, buildAppBridgeConfig, buildAuthorization, buildH5CouponUrl, buildJsapiBridgeConfig, buildMedInsJsapiBridgeConfig, buildMedInsMiniProgramBridgeConfig, buildMerchantTransferAuthorizationJsapiBridgeConfig, buildMerchantTransferJsapiBridgeConfig, buildMerchantTransferMiniProgramBridgeConfig, buildMiniProgramBridgeConfig, buildParkingAppBridgePath, buildParkingH5BridgeUrl, buildParkingMiniProgramBridgeConfig, buildParkingRepayBridgeConfig, buildPayScoreAppBridgeConfig, buildPayScoreDetailAppBridgeConfig, buildPayScoreDetailJsapiBridgeConfig, buildPayScoreDetailMiniProgramBridgeConfig, buildPayScoreJsapiBridgeConfig, buildPayScoreMiniProgramBridgeConfig, buildSignString, generateAppPaySign, generateNonce, generateNonceStr, generatePayScorePaySign, generatePaySign, isTimestampValid, oaepDecrypt, oaepEncrypt, sign, verifySignature };
8528
+ export { type ActivateCouponStockRequest, type ActivateCouponStockResponse, type AddProfitSharingReceiverRequest, type AddProfitSharingReceiverResponse, type AppBridgeConfig, AppService, type ApplyAbnormalRefundRequest, type ApplyAbnormalRefundResponse, type ApplyMerchantTransferElecSignByOutBillNoRequest, type ApplyMerchantTransferElecSignByTransferBillNoRequest, type ApplyMerchantTransferElecSignResponse, type ApplyParkingRefundRequest, type ApplyParkingRefundResponse, type AssignSmartGuideRequest, type AuthorizationCloseInfo, type AuthorizationCloseReason, BillService, type BuildPartnershipRequest, type BuildPartnershipResponse, type BusinessCircleAuthorizeCallbackData, type BusinessCircleRefundCallbackData, BusinessCircleService, type BusinessCircleTransactionCallbackData, CallbackHandler, type CallbackHeaders, type CallbackNotification, type CallbackResource, type CancelMerchantTransferResponse, type CancelPayScoreOrderRequest, type CancelPayScoreOrderResponse, CertificateManager, CertificateService, type CloseCombineOrderParams, type CloseCombineOrderRequest, type CloseCombineSubOrder, type CloseMerchantTransferAuthorizationResponse, type CloseOrderParams, type CloseOrderRequest, CombineAppService, CombineH5Service, CombineMiniProgramService, CombineNativeService, type CombinePayerInfo, type CombinePayerInfoResponse, type CombinePromotionDetail, type CombinePromotionGoodsDetail, type CombineSceneInfo, type CombineSceneInfoResponse, CombineService, type CombineSubOrder, type CombineSubOrderAmount, type CombineSubOrderAmountResponse, type CombineSubOrderResponse, type CombineSubOrderSettleInfo, type CombineTransactionCallbackData, type CombineTransactionSubOrder, type ComplaintCallbackData, type ComplaintCallbackUrlRequest, type ComplaintCallbackUrlResponse, type ComplaintNegotiationHistoryResponse, type ComplaintNegotiationRecord, type ComplaintNegotiationState, ComplaintService, type ComplaintState, type ComplaintSummary, type CompleteComplaintRequest, type CompletePayScoreOrderRequest, type CompletePayScoreOrderResponse, type CouponConsumeGoodsDetail, type CouponConsumeInformation, type CouponCutToMessage, type CouponFixedNormalCoupon, type CouponLimitCard, type CouponNormalCouponInformation, type CouponPatternInfo, CouponService, type CouponStatus, type CouponStockItem, type CouponStockStatus, type CouponStockType, type CouponStockUseRule, type CouponType, type CouponUseCallbackData, type CouponUseRule, type CreateAppCombineOrderRequest, type CreateAppCombineOrderResponse, type CreateAppOrderRequest, type CreateAppOrderResponse, type CreateCombineOrderRequest, type CreateCombineOrderResponse, type CreateCouponStockRequest, type CreateCouponStockResponse, type CreateH5CombineOrderRequest, type CreateH5CombineOrderResponse, type CreateH5OrderRequest, type CreateH5OrderResponse, type CreateJsapiOrderRequest, type CreateJsapiOrderResponse, type CreateMedInsOrderRequest, type CreateMerchantTransferAuthorizationRequest, type CreateMerchantTransferAuthorizationResponse, type CreateMerchantTransferRequest, type CreateMerchantTransferResponse, type CreateMiniProgramCombineOrderRequest, type CreateMiniProgramCombineOrderResponse, type CreateNativeCombineOrderRequest, type CreateNativeCombineOrderResponse, type CreateNativeOrderRequest, type CreateNativeOrderResponse, type CreateParkingRequest, type CreateParkingResponse, type CreateParkingTransactionRequest, type CreateParkingTransactionResponse, type CreatePayGiftActivityRequest, type CreatePayGiftActivityResponse, type CreatePayScoreOrderRequest, type CreatePayScoreOrderResponse, type CreateProfitSharingOrderRequest, type CreateProfitSharingOrderResponse, type CreateProfitSharingReturnOrderRequest, type CreateProfitSharingReturnOrderResponse, type CreateRefundRequest, type CreateRefundResponse, type CreateTransferAfterAuthorizationRequest, type CreateTransferAfterAuthorizationResponse, type CreateTransferWithAuthorizationRequest, type CreateTransferWithAuthorizationResponse, type DecryptedCallback, type DecryptedCertificate, DecryptionException, type DeleteProfitSharingReceiverRequest, type DeleteProfitSharingReceiverResponse, type DownloadBillParams, type DownloadBillResponse, type DownloadCouponStockFlowResponse, type EchoTestRequest, type EchoTestResponse, type ElecSignHashType, type ElecSignState, type FundFlowBillParams, type FundFlowBillResponse, type GetPayGiftActivityGoodsResponse, type GetPayGiftActivityMerchantsResponse, GoldPlanService, type GoodsDetail, type H5CombineSceneInfo, type H5Info, type H5SceneInfo, H5Service, HttpException, type JsapiBridgeConfig, JsapiService, LoveFeastService, MalformedMessageException, type MedInsCashAddEntity, type MedInsCashReduceEntity, type MedInsJsapiBridgeConfig, type MedInsMedInsPayStatus, type MedInsMiniProgramBridgeConfig, type MedInsMixPayStatus, type MedInsMixPayType, type MedInsOrderResponse, type MedInsOrderType, type MedInsPersonIdentification, type MedInsRefundCallbackData, type MedInsSelfPayStatus, MedInsService, type MedInsSuccessCallbackData, MediaService, MerchantExclusiveCouponService, type MerchantTransferAuthorizationCallbackData, type MerchantTransferAuthorizationJsapiBridgeConfig, type MerchantTransferAuthorizationState, type MerchantTransferCallbackData, type MerchantTransferJsapiBridgeConfig, MerchantTransferService, type MerchantTransferState, type MiniProgramBridgeConfig, type ModifyPayScoreOrderRequest, type ModifyPayScoreOrderResponse, NativeService, type OrderAmount, type OrderAmountResponse, type OrderDetail, type OrderPayer, type ParkingAmount, type ParkingAppBridgeConfig, type ParkingBlockReason, type ParkingCallbackBlockReason, type ParkingEntryStatusCallbackData, type ParkingH5BridgeConfig, type ParkingMiniProgramBridgeConfig, type ParkingPayer, type ParkingPromotionDetail, type ParkingRefundAmount, type ParkingRefundFrom, type ParkingRefundGoodsDetail, type ParkingRefundPromotionDetail, type ParkingRepayBridgeConfig, type ParkingSceneInfo, ParkingService, type ParkingState, type ParkingTradeState, type ParkingTransactionCallbackData, type PartnershipAuthorizedData, type PartnershipBusinessType, type PartnershipPartner, type PartnershipPartnerType, type PartnershipRecord, PartnershipService, type PartnershipState, type PauseCouponStockRequest, type PauseCouponStockResponse, PayGiftActivityService, type PayGiftActivityState, type PayGiftActivitySummary, type PayScoreAppBridgeConfig, type PayScoreCollection, type PayScoreCollectionDetail, type PayScoreCollectionState, type PayScoreDetailAppBridgeConfig, type PayScoreDetailJsapiBridgeConfig, type PayScoreDetailMiniProgramBridgeConfig, type PayScoreDevice, type PayScoreDiscount, type PayScoreJsapiBridgeConfig, type PayScoreLocation, type PayScoreMiniProgramBridgeConfig, type PayScoreOrderState, type PayScoreOrderStateDescription, type PayScorePayment, type PayScorePromotionDetail, type PayScorePromotionGoodsDetail, type PayScoreRefundCallbackData, type PayScoreRiskFund, PayScoreService, type PayScoreTimeRange, type PayScoreUserConfirmCallbackData, type PayScoreUserPaidCallbackData, PayrollCardService, type PlateColor, type PlateServiceState, type PlatformCertificate, type ProfitSharingBillParams, type ProfitSharingBillResponse, type ProfitSharingCallbackData, type ProfitSharingFailReason, type ProfitSharingReceiver, type ProfitSharingReceiverResponse, type ProfitSharingReceiverResult, type ProfitSharingReceiverType, type ProfitSharingRelationType, type ProfitSharingReturnFailReason, type ProfitSharingReturnResult, ProfitSharingService, type ProfitSharingState, type PromotionDetail, type PromotionGoodsDetail, type QueryBusinessCircleAuthorizationResponse, type QueryBusinessCirclePendingPointsParams, type QueryBusinessCirclePendingPointsResponse, type QueryCombineOrderParams, type QueryCombineOrderResponse, type QueryComplaintResponse, type QueryComplaintsParams, type QueryComplaintsResponse, type QueryCouponDetailParams, type QueryCouponDetailResponse, type QueryCouponStockItemsParams, type QueryCouponStockItemsResponse, type QueryCouponStockMerchantsParams, type QueryCouponStockMerchantsResponse, type QueryCouponStocksParams, type QueryCouponStocksResponse, type QueryMerchantTransferAuthorizationResponse, type QueryMerchantTransferElecSignResponse, type QueryMerchantTransferResponse, type QueryOrderParams, type QueryOrderResponse, type QueryParkingOrderResponse, type QueryParkingRefundResponse, type QueryPartnershipsParams, type QueryPartnershipsResponse, type QueryPayGiftActivitiesParams, type QueryPayGiftActivitiesResponse, type QueryPayGiftActivityResponse, type QueryPayScoreOrderParams, type QueryPayScoreOrderResponse, type QueryPlateServiceParams, type QueryPlateServiceResponse, type QueryProfitSharingAmountResponse, type QueryProfitSharingOrderParams, type QueryProfitSharingOrderResponse, type QueryProfitSharingReturnOrderParams, type QueryProfitSharingReturnOrderResponse, type QueryRefundParams, type QueryRefundResponse, type QuerySmartGuidesParams, type QuerySmartGuidesResponse, type QueryUserCouponsParams, type QueryUserCouponsResponse, type RefundAmount, type RefundAmountResponse, type RefundCallbackData, type RefundFromAccount, type RefundGoodsDetail, type RefundPromotionDetail, type RegisterSmartGuideRequest, type RegisterSmartGuideResponse, type ReplyComplaintRequest, type ReplyImmediateServiceRequest, type RequestParams, type RestartCouponStockRequest, type RestartCouponStockResponse, RetailStoreService, ScanAndRideService, type SceneInfo, type SceneInfoResponse, SecurityService, type SendCouponRequest, type SendCouponResponse, ServiceException, type SetCouponCallbackRequest, type SetCouponCallbackResponse, type SettleInfo, type SignPayload, type SignType, type SignatureType, type SmartGuide, SmartGuideService, type StoreInfo, type SyncBusinessCircleParkingStatusRequest, type SyncBusinessCirclePointsRequest, type SyncPayScoreOrderRequest, type SyncPayScoreOrderResponse, type TradeBillParams, type TradeBillResponse, type TransactionCallbackData, type TransferSceneReportInfo, type UnfreezeProfitSharingRequest, type UnfreezeProfitSharingResponse, type UpdateComplaintRefundRequest, type UpdateSmartGuideRequest, type UploadComplaintImageResponse, type UploadMarketingImageRequest, type UploadMarketingImageResponse, type UserCouponItem, ValidationException, WxPayClient, WxPayError, type WxPayErrorDetail$1 as WxPayErrorDetail, type WxPayOptions, type WxPayResponse, buildAppBridgeConfig, buildAuthorization, buildH5CouponUrl, buildJsapiBridgeConfig, buildMedInsJsapiBridgeConfig, buildMedInsMiniProgramBridgeConfig, buildMerchantTransferAuthorizationJsapiBridgeConfig, buildMerchantTransferJsapiBridgeConfig, buildMerchantTransferMiniProgramBridgeConfig, buildMiniProgramBridgeConfig, buildParkingAppBridgePath, buildParkingH5BridgeUrl, buildParkingMiniProgramBridgeConfig, buildParkingRepayBridgeConfig, buildPayScoreAppBridgeConfig, buildPayScoreDetailAppBridgeConfig, buildPayScoreDetailJsapiBridgeConfig, buildPayScoreDetailMiniProgramBridgeConfig, buildPayScoreJsapiBridgeConfig, buildPayScoreMiniProgramBridgeConfig, buildSignString, decryptSensitiveFields, decryptSensitiveFieldsInArray, encryptSensitiveFields, encryptSensitiveFieldsInArray, generateAppPaySign, generateNonce, generateNonceStr, generatePayScorePaySign, generatePaySign, isTimestampValid, oaepDecrypt, oaepEncrypt, registerSensitiveFields, sign, verifySignature };
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ interface WxPayResponse<T = unknown> {
8
8
  data: T;
9
9
  }
10
10
  /** 微信支付 API 错误信息 */
11
- interface WxPayErrorDetail {
11
+ interface WxPayErrorDetail$1 {
12
12
  /** 错误码 */
13
13
  code: string;
14
14
  /** 错误描述 */
@@ -4782,6 +4782,22 @@ declare class WxPayClient {
4782
4782
  private createVerifier;
4783
4783
  }
4784
4784
 
4785
+ /**
4786
+ * 微信支付 API 错误信息
4787
+ */
4788
+ interface WxPayErrorDetail {
4789
+ /** 错误码 */
4790
+ code: string;
4791
+ /** 错误描述 */
4792
+ message: string;
4793
+ /** 详细错误信息 */
4794
+ detail?: {
4795
+ field: string;
4796
+ value: string;
4797
+ issue: string;
4798
+ location?: string;
4799
+ }[];
4800
+ }
4785
4801
  /**
4786
4802
  * 微信支付 API V3 自定义错误类
4787
4803
  */
@@ -4797,7 +4813,132 @@ declare class WxPayError extends Error {
4797
4813
  get isClientError(): boolean;
4798
4814
  /** 是否为服务端错误 (5xx) */
4799
4815
  get isServerError(): boolean;
4816
+ /**
4817
+ * 判断是否为特定错误码
4818
+ *
4819
+ * @param code - 错误码
4820
+ * @returns 是否匹配
4821
+ */
4822
+ isApiError(code: string): boolean;
4823
+ }
4824
+ /**
4825
+ * 服务异常
4826
+ *
4827
+ * HTTP 状态码非 2xx 时抛出,包含微信支付返回的业务错误码和错误信息。
4828
+ */
4829
+ declare class ServiceException extends WxPayError {
4830
+ /** 微信支付业务错误码 */
4831
+ readonly errorCode: string;
4832
+ /** 微信支付业务错误信息 */
4833
+ readonly errorMessage: string;
4834
+ constructor(status: number, headers: Record<string, string>, detail: WxPayErrorDetail);
4835
+ }
4836
+ /**
4837
+ * HTTP 请求异常
4838
+ *
4839
+ * 网络请求失败、超时等场景抛出。
4840
+ */
4841
+ declare class HttpException extends WxPayError {
4842
+ constructor(message: string, cause?: Error);
4843
+ }
4844
+ /**
4845
+ * 验签异常
4846
+ *
4847
+ * 应答或回调签名验证失败时抛出。
4848
+ */
4849
+ declare class ValidationException extends WxPayError {
4850
+ constructor(message: string);
4851
+ }
4852
+ /**
4853
+ * 解密异常
4854
+ *
4855
+ * AES-256-GCM 或 RSA-OAEP 解密失败时抛出。
4856
+ */
4857
+ declare class DecryptionException extends WxPayError {
4858
+ constructor(message: string);
4800
4859
  }
4860
+ /**
4861
+ * 报文格式异常
4862
+ *
4863
+ * 响应 JSON 解析失败、Content-Type 不正确等场景抛出。
4864
+ */
4865
+ declare class MalformedMessageException extends WxPayError {
4866
+ constructor(message: string);
4867
+ }
4868
+
4869
+ /**
4870
+ * 注册敏感字段
4871
+ *
4872
+ * 标记某个类型的哪些字段是敏感信息,需要自动加解密。
4873
+ *
4874
+ * @param typeName - 类型名称(通常是接口名)
4875
+ * @param fields - 敏感字段名列表
4876
+ *
4877
+ * @example
4878
+ * ```ts
4879
+ * interface AddReceiverRequest {
4880
+ * name?: string;
4881
+ * type: string;
4882
+ * }
4883
+ * registerSensitiveFields('AddReceiverRequest', ['name']);
4884
+ * ```
4885
+ */
4886
+ declare function registerSensitiveFields(typeName: string, fields: string[]): void;
4887
+ /**
4888
+ * 自动加密对象中的敏感字段
4889
+ *
4890
+ * 根据注册的敏感字段信息,使用微信支付公钥加密指定字段。
4891
+ * 加密后的字段值为 Base64 编码的密文。
4892
+ *
4893
+ * @param obj - 待加密的对象
4894
+ * @param typeName - 类型名称
4895
+ * @param publicKey - 微信支付公钥(PEM 格式)
4896
+ * @returns 加密后的对象副本
4897
+ *
4898
+ * @example
4899
+ * ```ts
4900
+ * const request = { name: '张三', type: 'PERSONAL_OPENID' };
4901
+ * const encrypted = encryptSensitiveFields(request, 'AddReceiverRequest', publicKey);
4902
+ * // encrypted.name 为加密后的 Base64 密文
4903
+ * ```
4904
+ */
4905
+ declare function encryptSensitiveFields<T extends Record<string, unknown>>(obj: T, typeName: string, publicKey: string | Buffer): T;
4906
+ /**
4907
+ * 自动解密对象中的敏感字段
4908
+ *
4909
+ * 根据注册的敏感字段信息,使用商户私钥解密指定字段。
4910
+ *
4911
+ * @param obj - 待解密的对象
4912
+ * @param typeName - 类型名称
4913
+ * @param privateKey - 商户私钥(PEM 格式)
4914
+ * @returns 解密后的对象副本
4915
+ *
4916
+ * @example
4917
+ * ```ts
4918
+ * const response = { name: 'Base64密文...', type: 'PERSONAL_OPENID' };
4919
+ * const decrypted = decryptSensitiveFields(response, 'ReceiverInfo', privateKey);
4920
+ * // decrypted.name 为解密后的明文
4921
+ * ```
4922
+ */
4923
+ declare function decryptSensitiveFields<T extends Record<string, unknown>>(obj: T, typeName: string, privateKey: string | Buffer): T;
4924
+ /**
4925
+ * 批量加密数组中每个对象的敏感字段
4926
+ *
4927
+ * @param arr - 待加密的对象数组
4928
+ * @param typeName - 类型名称
4929
+ * @param publicKey - 微信支付公钥(PEM 格式)
4930
+ * @returns 加密后的数组副本
4931
+ */
4932
+ declare function encryptSensitiveFieldsInArray<T extends Record<string, unknown>>(arr: T[], typeName: string, publicKey: string | Buffer): T[];
4933
+ /**
4934
+ * 批量解密数组中每个对象的敏感字段
4935
+ *
4936
+ * @param arr - 待解密的对象数组
4937
+ * @param typeName - 类型名称
4938
+ * @param privateKey - 商户私钥(PEM 格式)
4939
+ * @returns 解密后的数组副本
4940
+ */
4941
+ declare function decryptSensitiveFieldsInArray<T extends Record<string, unknown>>(arr: T[], typeName: string, privateKey: string | Buffer): T[];
4801
4942
 
4802
4943
  /**
4803
4944
  * 解密后的平台证书信息
@@ -6509,7 +6650,7 @@ declare class CallbackHandler {
6509
6650
  * @param headers - 回调请求头
6510
6651
  * @param body - 回调请求体(原始 JSON 字符串)
6511
6652
  * @returns 签名验证是否通过
6512
- * @throws 如果签名类型不支持或找不到对应的证书
6653
+ * @throws 如果必填参数缺失、签名类型不支持或找不到对应的证书
6513
6654
  */
6514
6655
  verifySignature(headers: CallbackHeaders, body: string): boolean;
6515
6656
  /**
@@ -6519,7 +6660,7 @@ declare class CallbackHandler {
6519
6660
  *
6520
6661
  * @param notification - 回调通知 JSON 对象
6521
6662
  * @returns 解密后的业务数据
6522
- * @throws 如果解密后的数据为空或格式无效
6663
+ * @throws 如果通知结构无效、算法不匹配或解密失败
6523
6664
  */
6524
6665
  decryptNotification<T = unknown>(notification: CallbackNotification): DecryptedCallback<T>;
6525
6666
  /**
@@ -6698,6 +6839,7 @@ declare class CallbackHandler {
6698
6839
  * @param associatedData - 附加数据(用于 AEAD 认证)
6699
6840
  * @param nonce - 随机串
6700
6841
  * @returns 解密后的明文字符串
6842
+ * @throws 如果密文格式无效或解密失败
6701
6843
  */
6702
6844
  private aesGcmDecrypt;
6703
6845
  }
@@ -8318,6 +8460,7 @@ declare function buildSignString(payload: SignPayload): string;
8318
8460
  * @param signString - 待签名字符串
8319
8461
  * @param privateKey - PEM 格式的商户 API 私钥
8320
8462
  * @returns Base64 编码的签名值
8463
+ * @throws 如果 signString 或 privateKey 为空
8321
8464
  */
8322
8465
  declare function sign(signString: string, privateKey: string | Buffer): string;
8323
8466
  /**
@@ -8353,6 +8496,8 @@ declare function isTimestampValid(timestamp: string): boolean;
8353
8496
  * @param timestamp - HTTP 头 Wechatpay-Timestamp
8354
8497
  * @param nonce - HTTP 头 Wechatpay-Nonce
8355
8498
  * @param publicKey - 微信支付公钥或平台证书公钥(PEM 格式)
8499
+ * @returns 验签是否通过
8500
+ * @throws 如果必填参数缺失
8356
8501
  */
8357
8502
  declare function verifySignature(body: string, signature: string, timestamp: string, nonce: string, publicKey: string | Buffer): boolean;
8358
8503
  /**
@@ -8363,7 +8508,8 @@ declare function verifySignature(body: string, signature: string, timestamp: str
8363
8508
  *
8364
8509
  * @param plaintext - 待加密的明文
8365
8510
  * @param publicKey - 微信支付公钥或平台证书公钥(PEM 格式)
8366
- * @returns Base64 编码的密文
8511
+ * @returns Base64 编码的密文,空字符串输入返回空字符串
8512
+ * @throws 如果 publicKey 为空
8367
8513
  */
8368
8514
  declare function oaepEncrypt(plaintext: string, publicKey: string | Buffer): string;
8369
8515
  /**
@@ -8374,8 +8520,9 @@ declare function oaepEncrypt(plaintext: string, publicKey: string | Buffer): str
8374
8520
  *
8375
8521
  * @param ciphertext - Base64 编码的密文
8376
8522
  * @param privateKey - 商户 API 私钥(PEM 格式)
8377
- * @returns 解密后的明文字符串
8523
+ * @returns 解密后的明文字符串,空字符串输入返回空字符串
8524
+ * @throws 如果 privateKey 为空或密文格式无效
8378
8525
  */
8379
8526
  declare function oaepDecrypt(ciphertext: string, privateKey: string | Buffer): string;
8380
8527
 
8381
- export { type ActivateCouponStockRequest, type ActivateCouponStockResponse, type AddProfitSharingReceiverRequest, type AddProfitSharingReceiverResponse, type AppBridgeConfig, AppService, type ApplyAbnormalRefundRequest, type ApplyAbnormalRefundResponse, type ApplyMerchantTransferElecSignByOutBillNoRequest, type ApplyMerchantTransferElecSignByTransferBillNoRequest, type ApplyMerchantTransferElecSignResponse, type ApplyParkingRefundRequest, type ApplyParkingRefundResponse, type AssignSmartGuideRequest, type AuthorizationCloseInfo, type AuthorizationCloseReason, BillService, type BuildPartnershipRequest, type BuildPartnershipResponse, type BusinessCircleAuthorizeCallbackData, type BusinessCircleRefundCallbackData, BusinessCircleService, type BusinessCircleTransactionCallbackData, CallbackHandler, type CallbackHeaders, type CallbackNotification, type CallbackResource, type CancelMerchantTransferResponse, type CancelPayScoreOrderRequest, type CancelPayScoreOrderResponse, CertificateManager, CertificateService, type CloseCombineOrderParams, type CloseCombineOrderRequest, type CloseCombineSubOrder, type CloseMerchantTransferAuthorizationResponse, type CloseOrderParams, type CloseOrderRequest, CombineAppService, CombineH5Service, CombineMiniProgramService, CombineNativeService, type CombinePayerInfo, type CombinePayerInfoResponse, type CombinePromotionDetail, type CombinePromotionGoodsDetail, type CombineSceneInfo, type CombineSceneInfoResponse, CombineService, type CombineSubOrder, type CombineSubOrderAmount, type CombineSubOrderAmountResponse, type CombineSubOrderResponse, type CombineSubOrderSettleInfo, type CombineTransactionCallbackData, type CombineTransactionSubOrder, type ComplaintCallbackData, type ComplaintCallbackUrlRequest, type ComplaintCallbackUrlResponse, type ComplaintNegotiationHistoryResponse, type ComplaintNegotiationRecord, type ComplaintNegotiationState, ComplaintService, type ComplaintState, type ComplaintSummary, type CompleteComplaintRequest, type CompletePayScoreOrderRequest, type CompletePayScoreOrderResponse, type CouponConsumeGoodsDetail, type CouponConsumeInformation, type CouponCutToMessage, type CouponFixedNormalCoupon, type CouponLimitCard, type CouponNormalCouponInformation, type CouponPatternInfo, CouponService, type CouponStatus, type CouponStockItem, type CouponStockStatus, type CouponStockType, type CouponStockUseRule, type CouponType, type CouponUseCallbackData, type CouponUseRule, type CreateAppCombineOrderRequest, type CreateAppCombineOrderResponse, type CreateAppOrderRequest, type CreateAppOrderResponse, type CreateCombineOrderRequest, type CreateCombineOrderResponse, type CreateCouponStockRequest, type CreateCouponStockResponse, type CreateH5CombineOrderRequest, type CreateH5CombineOrderResponse, type CreateH5OrderRequest, type CreateH5OrderResponse, type CreateJsapiOrderRequest, type CreateJsapiOrderResponse, type CreateMedInsOrderRequest, type CreateMerchantTransferAuthorizationRequest, type CreateMerchantTransferAuthorizationResponse, type CreateMerchantTransferRequest, type CreateMerchantTransferResponse, type CreateMiniProgramCombineOrderRequest, type CreateMiniProgramCombineOrderResponse, type CreateNativeCombineOrderRequest, type CreateNativeCombineOrderResponse, type CreateNativeOrderRequest, type CreateNativeOrderResponse, type CreateParkingRequest, type CreateParkingResponse, type CreateParkingTransactionRequest, type CreateParkingTransactionResponse, type CreatePayGiftActivityRequest, type CreatePayGiftActivityResponse, type CreatePayScoreOrderRequest, type CreatePayScoreOrderResponse, type CreateProfitSharingOrderRequest, type CreateProfitSharingOrderResponse, type CreateProfitSharingReturnOrderRequest, type CreateProfitSharingReturnOrderResponse, type CreateRefundRequest, type CreateRefundResponse, type CreateTransferAfterAuthorizationRequest, type CreateTransferAfterAuthorizationResponse, type CreateTransferWithAuthorizationRequest, type CreateTransferWithAuthorizationResponse, type DecryptedCallback, type DecryptedCertificate, type DeleteProfitSharingReceiverRequest, type DeleteProfitSharingReceiverResponse, type DownloadBillParams, type DownloadBillResponse, type DownloadCouponStockFlowResponse, type EchoTestRequest, type EchoTestResponse, type ElecSignHashType, type ElecSignState, type FundFlowBillParams, type FundFlowBillResponse, type GetPayGiftActivityGoodsResponse, type GetPayGiftActivityMerchantsResponse, GoldPlanService, type GoodsDetail, type H5CombineSceneInfo, type H5Info, type H5SceneInfo, H5Service, type JsapiBridgeConfig, JsapiService, LoveFeastService, type MedInsCashAddEntity, type MedInsCashReduceEntity, type MedInsJsapiBridgeConfig, type MedInsMedInsPayStatus, type MedInsMiniProgramBridgeConfig, type MedInsMixPayStatus, type MedInsMixPayType, type MedInsOrderResponse, type MedInsOrderType, type MedInsPersonIdentification, type MedInsRefundCallbackData, type MedInsSelfPayStatus, MedInsService, type MedInsSuccessCallbackData, MediaService, MerchantExclusiveCouponService, type MerchantTransferAuthorizationCallbackData, type MerchantTransferAuthorizationJsapiBridgeConfig, type MerchantTransferAuthorizationState, type MerchantTransferCallbackData, type MerchantTransferJsapiBridgeConfig, MerchantTransferService, type MerchantTransferState, type MiniProgramBridgeConfig, type ModifyPayScoreOrderRequest, type ModifyPayScoreOrderResponse, NativeService, type OrderAmount, type OrderAmountResponse, type OrderDetail, type OrderPayer, type ParkingAmount, type ParkingAppBridgeConfig, type ParkingBlockReason, type ParkingCallbackBlockReason, type ParkingEntryStatusCallbackData, type ParkingH5BridgeConfig, type ParkingMiniProgramBridgeConfig, type ParkingPayer, type ParkingPromotionDetail, type ParkingRefundAmount, type ParkingRefundFrom, type ParkingRefundGoodsDetail, type ParkingRefundPromotionDetail, type ParkingRepayBridgeConfig, type ParkingSceneInfo, ParkingService, type ParkingState, type ParkingTradeState, type ParkingTransactionCallbackData, type PartnershipAuthorizedData, type PartnershipBusinessType, type PartnershipPartner, type PartnershipPartnerType, type PartnershipRecord, PartnershipService, type PartnershipState, type PauseCouponStockRequest, type PauseCouponStockResponse, PayGiftActivityService, type PayGiftActivityState, type PayGiftActivitySummary, type PayScoreAppBridgeConfig, type PayScoreCollection, type PayScoreCollectionDetail, type PayScoreCollectionState, type PayScoreDetailAppBridgeConfig, type PayScoreDetailJsapiBridgeConfig, type PayScoreDetailMiniProgramBridgeConfig, type PayScoreDevice, type PayScoreDiscount, type PayScoreJsapiBridgeConfig, type PayScoreLocation, type PayScoreMiniProgramBridgeConfig, type PayScoreOrderState, type PayScoreOrderStateDescription, type PayScorePayment, type PayScorePromotionDetail, type PayScorePromotionGoodsDetail, type PayScoreRefundCallbackData, type PayScoreRiskFund, PayScoreService, type PayScoreTimeRange, type PayScoreUserConfirmCallbackData, type PayScoreUserPaidCallbackData, PayrollCardService, type PlateColor, type PlateServiceState, type PlatformCertificate, type ProfitSharingBillParams, type ProfitSharingBillResponse, type ProfitSharingCallbackData, type ProfitSharingFailReason, type ProfitSharingReceiver, type ProfitSharingReceiverResponse, type ProfitSharingReceiverResult, type ProfitSharingReceiverType, type ProfitSharingRelationType, type ProfitSharingReturnFailReason, type ProfitSharingReturnResult, ProfitSharingService, type ProfitSharingState, type PromotionDetail, type PromotionGoodsDetail, type QueryBusinessCircleAuthorizationResponse, type QueryBusinessCirclePendingPointsParams, type QueryBusinessCirclePendingPointsResponse, type QueryCombineOrderParams, type QueryCombineOrderResponse, type QueryComplaintResponse, type QueryComplaintsParams, type QueryComplaintsResponse, type QueryCouponDetailParams, type QueryCouponDetailResponse, type QueryCouponStockItemsParams, type QueryCouponStockItemsResponse, type QueryCouponStockMerchantsParams, type QueryCouponStockMerchantsResponse, type QueryCouponStocksParams, type QueryCouponStocksResponse, type QueryMerchantTransferAuthorizationResponse, type QueryMerchantTransferElecSignResponse, type QueryMerchantTransferResponse, type QueryOrderParams, type QueryOrderResponse, type QueryParkingOrderResponse, type QueryParkingRefundResponse, type QueryPartnershipsParams, type QueryPartnershipsResponse, type QueryPayGiftActivitiesParams, type QueryPayGiftActivitiesResponse, type QueryPayGiftActivityResponse, type QueryPayScoreOrderParams, type QueryPayScoreOrderResponse, type QueryPlateServiceParams, type QueryPlateServiceResponse, type QueryProfitSharingAmountResponse, type QueryProfitSharingOrderParams, type QueryProfitSharingOrderResponse, type QueryProfitSharingReturnOrderParams, type QueryProfitSharingReturnOrderResponse, type QueryRefundParams, type QueryRefundResponse, type QuerySmartGuidesParams, type QuerySmartGuidesResponse, type QueryUserCouponsParams, type QueryUserCouponsResponse, type RefundAmount, type RefundAmountResponse, type RefundCallbackData, type RefundFromAccount, type RefundGoodsDetail, type RefundPromotionDetail, type RegisterSmartGuideRequest, type RegisterSmartGuideResponse, type ReplyComplaintRequest, type ReplyImmediateServiceRequest, type RequestParams, type RestartCouponStockRequest, type RestartCouponStockResponse, RetailStoreService, ScanAndRideService, type SceneInfo, type SceneInfoResponse, SecurityService, type SendCouponRequest, type SendCouponResponse, type SetCouponCallbackRequest, type SetCouponCallbackResponse, type SettleInfo, type SignPayload, type SignType, type SignatureType, type SmartGuide, SmartGuideService, type StoreInfo, type SyncBusinessCircleParkingStatusRequest, type SyncBusinessCirclePointsRequest, type SyncPayScoreOrderRequest, type SyncPayScoreOrderResponse, type TradeBillParams, type TradeBillResponse, type TransactionCallbackData, type TransferSceneReportInfo, type UnfreezeProfitSharingRequest, type UnfreezeProfitSharingResponse, type UpdateComplaintRefundRequest, type UpdateSmartGuideRequest, type UploadComplaintImageResponse, type UploadMarketingImageRequest, type UploadMarketingImageResponse, type UserCouponItem, WxPayClient, WxPayError, type WxPayErrorDetail, type WxPayOptions, type WxPayResponse, buildAppBridgeConfig, buildAuthorization, buildH5CouponUrl, buildJsapiBridgeConfig, buildMedInsJsapiBridgeConfig, buildMedInsMiniProgramBridgeConfig, buildMerchantTransferAuthorizationJsapiBridgeConfig, buildMerchantTransferJsapiBridgeConfig, buildMerchantTransferMiniProgramBridgeConfig, buildMiniProgramBridgeConfig, buildParkingAppBridgePath, buildParkingH5BridgeUrl, buildParkingMiniProgramBridgeConfig, buildParkingRepayBridgeConfig, buildPayScoreAppBridgeConfig, buildPayScoreDetailAppBridgeConfig, buildPayScoreDetailJsapiBridgeConfig, buildPayScoreDetailMiniProgramBridgeConfig, buildPayScoreJsapiBridgeConfig, buildPayScoreMiniProgramBridgeConfig, buildSignString, generateAppPaySign, generateNonce, generateNonceStr, generatePayScorePaySign, generatePaySign, isTimestampValid, oaepDecrypt, oaepEncrypt, sign, verifySignature };
8528
+ export { type ActivateCouponStockRequest, type ActivateCouponStockResponse, type AddProfitSharingReceiverRequest, type AddProfitSharingReceiverResponse, type AppBridgeConfig, AppService, type ApplyAbnormalRefundRequest, type ApplyAbnormalRefundResponse, type ApplyMerchantTransferElecSignByOutBillNoRequest, type ApplyMerchantTransferElecSignByTransferBillNoRequest, type ApplyMerchantTransferElecSignResponse, type ApplyParkingRefundRequest, type ApplyParkingRefundResponse, type AssignSmartGuideRequest, type AuthorizationCloseInfo, type AuthorizationCloseReason, BillService, type BuildPartnershipRequest, type BuildPartnershipResponse, type BusinessCircleAuthorizeCallbackData, type BusinessCircleRefundCallbackData, BusinessCircleService, type BusinessCircleTransactionCallbackData, CallbackHandler, type CallbackHeaders, type CallbackNotification, type CallbackResource, type CancelMerchantTransferResponse, type CancelPayScoreOrderRequest, type CancelPayScoreOrderResponse, CertificateManager, CertificateService, type CloseCombineOrderParams, type CloseCombineOrderRequest, type CloseCombineSubOrder, type CloseMerchantTransferAuthorizationResponse, type CloseOrderParams, type CloseOrderRequest, CombineAppService, CombineH5Service, CombineMiniProgramService, CombineNativeService, type CombinePayerInfo, type CombinePayerInfoResponse, type CombinePromotionDetail, type CombinePromotionGoodsDetail, type CombineSceneInfo, type CombineSceneInfoResponse, CombineService, type CombineSubOrder, type CombineSubOrderAmount, type CombineSubOrderAmountResponse, type CombineSubOrderResponse, type CombineSubOrderSettleInfo, type CombineTransactionCallbackData, type CombineTransactionSubOrder, type ComplaintCallbackData, type ComplaintCallbackUrlRequest, type ComplaintCallbackUrlResponse, type ComplaintNegotiationHistoryResponse, type ComplaintNegotiationRecord, type ComplaintNegotiationState, ComplaintService, type ComplaintState, type ComplaintSummary, type CompleteComplaintRequest, type CompletePayScoreOrderRequest, type CompletePayScoreOrderResponse, type CouponConsumeGoodsDetail, type CouponConsumeInformation, type CouponCutToMessage, type CouponFixedNormalCoupon, type CouponLimitCard, type CouponNormalCouponInformation, type CouponPatternInfo, CouponService, type CouponStatus, type CouponStockItem, type CouponStockStatus, type CouponStockType, type CouponStockUseRule, type CouponType, type CouponUseCallbackData, type CouponUseRule, type CreateAppCombineOrderRequest, type CreateAppCombineOrderResponse, type CreateAppOrderRequest, type CreateAppOrderResponse, type CreateCombineOrderRequest, type CreateCombineOrderResponse, type CreateCouponStockRequest, type CreateCouponStockResponse, type CreateH5CombineOrderRequest, type CreateH5CombineOrderResponse, type CreateH5OrderRequest, type CreateH5OrderResponse, type CreateJsapiOrderRequest, type CreateJsapiOrderResponse, type CreateMedInsOrderRequest, type CreateMerchantTransferAuthorizationRequest, type CreateMerchantTransferAuthorizationResponse, type CreateMerchantTransferRequest, type CreateMerchantTransferResponse, type CreateMiniProgramCombineOrderRequest, type CreateMiniProgramCombineOrderResponse, type CreateNativeCombineOrderRequest, type CreateNativeCombineOrderResponse, type CreateNativeOrderRequest, type CreateNativeOrderResponse, type CreateParkingRequest, type CreateParkingResponse, type CreateParkingTransactionRequest, type CreateParkingTransactionResponse, type CreatePayGiftActivityRequest, type CreatePayGiftActivityResponse, type CreatePayScoreOrderRequest, type CreatePayScoreOrderResponse, type CreateProfitSharingOrderRequest, type CreateProfitSharingOrderResponse, type CreateProfitSharingReturnOrderRequest, type CreateProfitSharingReturnOrderResponse, type CreateRefundRequest, type CreateRefundResponse, type CreateTransferAfterAuthorizationRequest, type CreateTransferAfterAuthorizationResponse, type CreateTransferWithAuthorizationRequest, type CreateTransferWithAuthorizationResponse, type DecryptedCallback, type DecryptedCertificate, DecryptionException, type DeleteProfitSharingReceiverRequest, type DeleteProfitSharingReceiverResponse, type DownloadBillParams, type DownloadBillResponse, type DownloadCouponStockFlowResponse, type EchoTestRequest, type EchoTestResponse, type ElecSignHashType, type ElecSignState, type FundFlowBillParams, type FundFlowBillResponse, type GetPayGiftActivityGoodsResponse, type GetPayGiftActivityMerchantsResponse, GoldPlanService, type GoodsDetail, type H5CombineSceneInfo, type H5Info, type H5SceneInfo, H5Service, HttpException, type JsapiBridgeConfig, JsapiService, LoveFeastService, MalformedMessageException, type MedInsCashAddEntity, type MedInsCashReduceEntity, type MedInsJsapiBridgeConfig, type MedInsMedInsPayStatus, type MedInsMiniProgramBridgeConfig, type MedInsMixPayStatus, type MedInsMixPayType, type MedInsOrderResponse, type MedInsOrderType, type MedInsPersonIdentification, type MedInsRefundCallbackData, type MedInsSelfPayStatus, MedInsService, type MedInsSuccessCallbackData, MediaService, MerchantExclusiveCouponService, type MerchantTransferAuthorizationCallbackData, type MerchantTransferAuthorizationJsapiBridgeConfig, type MerchantTransferAuthorizationState, type MerchantTransferCallbackData, type MerchantTransferJsapiBridgeConfig, MerchantTransferService, type MerchantTransferState, type MiniProgramBridgeConfig, type ModifyPayScoreOrderRequest, type ModifyPayScoreOrderResponse, NativeService, type OrderAmount, type OrderAmountResponse, type OrderDetail, type OrderPayer, type ParkingAmount, type ParkingAppBridgeConfig, type ParkingBlockReason, type ParkingCallbackBlockReason, type ParkingEntryStatusCallbackData, type ParkingH5BridgeConfig, type ParkingMiniProgramBridgeConfig, type ParkingPayer, type ParkingPromotionDetail, type ParkingRefundAmount, type ParkingRefundFrom, type ParkingRefundGoodsDetail, type ParkingRefundPromotionDetail, type ParkingRepayBridgeConfig, type ParkingSceneInfo, ParkingService, type ParkingState, type ParkingTradeState, type ParkingTransactionCallbackData, type PartnershipAuthorizedData, type PartnershipBusinessType, type PartnershipPartner, type PartnershipPartnerType, type PartnershipRecord, PartnershipService, type PartnershipState, type PauseCouponStockRequest, type PauseCouponStockResponse, PayGiftActivityService, type PayGiftActivityState, type PayGiftActivitySummary, type PayScoreAppBridgeConfig, type PayScoreCollection, type PayScoreCollectionDetail, type PayScoreCollectionState, type PayScoreDetailAppBridgeConfig, type PayScoreDetailJsapiBridgeConfig, type PayScoreDetailMiniProgramBridgeConfig, type PayScoreDevice, type PayScoreDiscount, type PayScoreJsapiBridgeConfig, type PayScoreLocation, type PayScoreMiniProgramBridgeConfig, type PayScoreOrderState, type PayScoreOrderStateDescription, type PayScorePayment, type PayScorePromotionDetail, type PayScorePromotionGoodsDetail, type PayScoreRefundCallbackData, type PayScoreRiskFund, PayScoreService, type PayScoreTimeRange, type PayScoreUserConfirmCallbackData, type PayScoreUserPaidCallbackData, PayrollCardService, type PlateColor, type PlateServiceState, type PlatformCertificate, type ProfitSharingBillParams, type ProfitSharingBillResponse, type ProfitSharingCallbackData, type ProfitSharingFailReason, type ProfitSharingReceiver, type ProfitSharingReceiverResponse, type ProfitSharingReceiverResult, type ProfitSharingReceiverType, type ProfitSharingRelationType, type ProfitSharingReturnFailReason, type ProfitSharingReturnResult, ProfitSharingService, type ProfitSharingState, type PromotionDetail, type PromotionGoodsDetail, type QueryBusinessCircleAuthorizationResponse, type QueryBusinessCirclePendingPointsParams, type QueryBusinessCirclePendingPointsResponse, type QueryCombineOrderParams, type QueryCombineOrderResponse, type QueryComplaintResponse, type QueryComplaintsParams, type QueryComplaintsResponse, type QueryCouponDetailParams, type QueryCouponDetailResponse, type QueryCouponStockItemsParams, type QueryCouponStockItemsResponse, type QueryCouponStockMerchantsParams, type QueryCouponStockMerchantsResponse, type QueryCouponStocksParams, type QueryCouponStocksResponse, type QueryMerchantTransferAuthorizationResponse, type QueryMerchantTransferElecSignResponse, type QueryMerchantTransferResponse, type QueryOrderParams, type QueryOrderResponse, type QueryParkingOrderResponse, type QueryParkingRefundResponse, type QueryPartnershipsParams, type QueryPartnershipsResponse, type QueryPayGiftActivitiesParams, type QueryPayGiftActivitiesResponse, type QueryPayGiftActivityResponse, type QueryPayScoreOrderParams, type QueryPayScoreOrderResponse, type QueryPlateServiceParams, type QueryPlateServiceResponse, type QueryProfitSharingAmountResponse, type QueryProfitSharingOrderParams, type QueryProfitSharingOrderResponse, type QueryProfitSharingReturnOrderParams, type QueryProfitSharingReturnOrderResponse, type QueryRefundParams, type QueryRefundResponse, type QuerySmartGuidesParams, type QuerySmartGuidesResponse, type QueryUserCouponsParams, type QueryUserCouponsResponse, type RefundAmount, type RefundAmountResponse, type RefundCallbackData, type RefundFromAccount, type RefundGoodsDetail, type RefundPromotionDetail, type RegisterSmartGuideRequest, type RegisterSmartGuideResponse, type ReplyComplaintRequest, type ReplyImmediateServiceRequest, type RequestParams, type RestartCouponStockRequest, type RestartCouponStockResponse, RetailStoreService, ScanAndRideService, type SceneInfo, type SceneInfoResponse, SecurityService, type SendCouponRequest, type SendCouponResponse, ServiceException, type SetCouponCallbackRequest, type SetCouponCallbackResponse, type SettleInfo, type SignPayload, type SignType, type SignatureType, type SmartGuide, SmartGuideService, type StoreInfo, type SyncBusinessCircleParkingStatusRequest, type SyncBusinessCirclePointsRequest, type SyncPayScoreOrderRequest, type SyncPayScoreOrderResponse, type TradeBillParams, type TradeBillResponse, type TransactionCallbackData, type TransferSceneReportInfo, type UnfreezeProfitSharingRequest, type UnfreezeProfitSharingResponse, type UpdateComplaintRefundRequest, type UpdateSmartGuideRequest, type UploadComplaintImageResponse, type UploadMarketingImageRequest, type UploadMarketingImageResponse, type UserCouponItem, ValidationException, WxPayClient, WxPayError, type WxPayErrorDetail$1 as WxPayErrorDetail, type WxPayOptions, type WxPayResponse, buildAppBridgeConfig, buildAuthorization, buildH5CouponUrl, buildJsapiBridgeConfig, buildMedInsJsapiBridgeConfig, buildMedInsMiniProgramBridgeConfig, buildMerchantTransferAuthorizationJsapiBridgeConfig, buildMerchantTransferJsapiBridgeConfig, buildMerchantTransferMiniProgramBridgeConfig, buildMiniProgramBridgeConfig, buildParkingAppBridgePath, buildParkingH5BridgeUrl, buildParkingMiniProgramBridgeConfig, buildParkingRepayBridgeConfig, buildPayScoreAppBridgeConfig, buildPayScoreDetailAppBridgeConfig, buildPayScoreDetailJsapiBridgeConfig, buildPayScoreDetailMiniProgramBridgeConfig, buildPayScoreJsapiBridgeConfig, buildPayScoreMiniProgramBridgeConfig, buildSignString, decryptSensitiveFields, decryptSensitiveFieldsInArray, encryptSensitiveFields, encryptSensitiveFieldsInArray, generateAppPaySign, generateNonce, generateNonceStr, generatePayScorePaySign, generatePaySign, isTimestampValid, oaepDecrypt, oaepEncrypt, registerSensitiveFields, sign, verifySignature };