@paykka/card-checkout-ui 0.15.2 → 0.16.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.
Files changed (133) hide show
  1. package/dist/card-checkout-ui.js +15 -15
  2. package/dist/card-checkout-ui.umd.cjs +15 -15
  3. package/dist/es/api/http.js +12 -1
  4. package/dist/es/api/modules/apple-pay/index.js +0 -12
  5. package/dist/es/api/modules/common/index.js +29 -0
  6. package/dist/es/api/modules/get-browser-params.js +1 -1
  7. package/dist/es/api/modules/index.js +1 -1
  8. package/dist/es/api/modules/threeDS/index.js +1 -1
  9. package/dist/es/api/utils/index.js +3 -0
  10. package/dist/es/components/AccountNameField/index.js +2 -2
  11. package/dist/es/components/AddressField/index.js +2 -2
  12. package/dist/es/components/ApplePay/index.js +26 -10
  13. package/dist/es/components/CPFField/index.js +2 -2
  14. package/dist/es/components/Card/index.js +20 -6
  15. package/dist/es/components/CardHolderNameField/index.js +2 -2
  16. package/dist/es/components/CardSecurityCodeField/index.js +2 -2
  17. package/dist/es/components/CombinedCardInfo/index.js +3 -3
  18. package/dist/es/components/EmailField/EmailField.js +2 -2
  19. package/dist/es/components/EncryptedCard/index.js +1 -1
  20. package/dist/es/components/GooglePay/index.js +35 -21
  21. package/dist/es/components/SecuredFieldsProvider/index.js +2 -0
  22. package/dist/es/components/SecuredIframe/index.js +19 -10
  23. package/dist/es/components/Sepa/index.js +21 -6
  24. package/dist/es/components/business/BlikConfirmModal/BlikConfirmModal.js +1 -1
  25. package/dist/es/components/business/NameField/NameField.js +2 -2
  26. package/dist/es/components/business/QRCodeModal/QRCodeModal.js +1 -1
  27. package/dist/es/components/business/SegmentedDigitInput/format.js +3 -0
  28. package/dist/es/components/business/SegmentedDigitInput/index.js +2 -0
  29. package/dist/es/components/internal/Accordion/accordionTransition.js +3 -0
  30. package/dist/es/components/internal/Form/Form.js +2 -0
  31. package/dist/es/components/internal/Form/FormItem.js +2 -0
  32. package/dist/es/components/internal/Input/Input.js +2 -0
  33. package/dist/es/components/internal/icons/Icon3DSFail.js +2 -0
  34. package/dist/es/components/internal/icons/Icon3DSInfo.js +2 -0
  35. package/dist/es/components/internal/icons/Icon3DSSuccess.js +2 -0
  36. package/dist/es/components/internal/icons/IconAdd.js +2 -0
  37. package/dist/es/components/internal/icons/IconAlipayPlus.js +2 -0
  38. package/dist/es/components/internal/icons/IconAmex.js +2 -0
  39. package/dist/es/components/internal/icons/IconArrowDown.js +2 -0
  40. package/dist/es/components/internal/icons/IconBancontact.js +2 -0
  41. package/dist/es/components/internal/icons/IconBlik.js +2 -0
  42. package/dist/es/components/internal/icons/IconBoost.js +2 -0
  43. package/dist/es/components/internal/icons/IconCard.js +2 -0
  44. package/dist/es/components/internal/icons/IconCard2.js +2 -0
  45. package/dist/es/components/internal/icons/IconCardNo.js +2 -0
  46. package/dist/es/components/internal/icons/IconDinnersClub.js +2 -0
  47. package/dist/es/components/internal/icons/IconDiscover.js +2 -0
  48. package/dist/es/components/internal/icons/IconError.js +2 -0
  49. package/dist/es/components/internal/icons/IconGCash.js +2 -0
  50. package/dist/es/components/internal/icons/IconGcashComplete.js +2 -0
  51. package/dist/es/components/internal/icons/IconGrabPay.js +2 -0
  52. package/dist/es/components/internal/icons/IconIdeal.js +2 -0
  53. package/dist/es/components/internal/icons/IconInfo.js +2 -0
  54. package/dist/es/components/internal/icons/IconJcb.js +2 -0
  55. package/dist/es/components/internal/icons/IconLinePay.js +2 -0
  56. package/dist/es/components/internal/icons/IconMasterCard.js +2 -0
  57. package/dist/es/components/internal/icons/IconMayBankQRPay.js +2 -0
  58. package/dist/es/components/internal/icons/IconNinePay.js +2 -0
  59. package/dist/es/components/internal/icons/IconOpayWallet.js +2 -0
  60. package/dist/es/components/internal/icons/IconOvo.js +2 -0
  61. package/dist/es/components/internal/icons/IconP24.js +2 -0
  62. package/dist/es/components/internal/icons/IconPagaWallet.js +2 -0
  63. package/dist/es/components/internal/icons/IconPaymaya.js +2 -0
  64. package/dist/es/components/internal/icons/IconPhone.js +2 -0
  65. package/dist/es/components/internal/icons/IconPicPay.js +2 -0
  66. package/dist/es/components/internal/icons/IconPix.js +2 -0
  67. package/dist/es/components/internal/icons/IconRedirect.js +2 -0
  68. package/dist/es/components/internal/icons/IconSafe.js +2 -0
  69. package/dist/es/components/internal/icons/IconScan.js +2 -0
  70. package/dist/es/components/internal/icons/IconShopeePay.js +2 -0
  71. package/dist/es/components/internal/icons/IconSkrill.js +2 -0
  72. package/dist/es/components/internal/icons/IconSuccess.js +2 -0
  73. package/dist/es/components/internal/icons/IconSwitch.js +2 -0
  74. package/dist/es/components/internal/icons/IconTNGWallet.js +2 -0
  75. package/dist/es/components/internal/icons/IconTick.js +2 -0
  76. package/dist/es/components/internal/icons/IconTrustly.js +2 -0
  77. package/dist/es/components/internal/icons/IconUnionPay.js +2 -0
  78. package/dist/es/components/internal/icons/IconVietqr.js +2 -0
  79. package/dist/es/components/internal/icons/IconVietqrComplete.js +2 -0
  80. package/dist/es/components/internal/icons/IconVisa.js +2 -0
  81. package/dist/es/components/internal/icons/IconWechatPayGlobal.js +2 -0
  82. package/dist/es/components/internal/icons/IconWechatPayGlobalComplete.js +2 -0
  83. package/dist/es/components/internal/icons/IconZalopay.js +2 -0
  84. package/dist/es/components/internal/icons/IconZalopayComplete.js +2 -0
  85. package/dist/es/components/internal/icons/iconChecked.js +2 -0
  86. package/dist/es/components/internal/icons/index.js +2 -0
  87. package/dist/es/components/wallets/WechatPay/WechatPay.js +5 -10
  88. package/dist/es/config.js +2 -0
  89. package/dist/es/core/address.js +3 -0
  90. package/dist/es/core/checkout.js +3 -2
  91. package/dist/es/core/create.js +2 -0
  92. package/dist/es/core/logger.js +4 -1
  93. package/dist/es/core/payment.js +2 -0
  94. package/dist/es/core/query.js +1 -1
  95. package/dist/es/core.js +36 -36
  96. package/dist/es/hooks/useBEM.js +3 -0
  97. package/dist/es/hooks/useBaseWallet.js +45 -9
  98. package/dist/es/hooks/usePayState.js +1 -0
  99. package/dist/es/i18n/I18n.js +2 -0
  100. package/dist/es/i18n/index.js +2 -0
  101. package/dist/es/i18n/locales/de-DE.js +1 -1
  102. package/dist/es/i18n/locales/en-GB.js +1 -1
  103. package/dist/es/i18n/locales/es-ES.js +1 -1
  104. package/dist/es/i18n/locales/fr-FR.js +1 -1
  105. package/dist/es/i18n/locales/ja-JP.js +1 -1
  106. package/dist/es/i18n/locales/ko-KR.js +1 -1
  107. package/dist/es/i18n/locales/nl-NL.js +1 -1
  108. package/dist/es/i18n/locales/pt-PT.js +1 -1
  109. package/dist/es/i18n/locales/ru-RU.js +1 -1
  110. package/dist/es/i18n/locales/zh-CN.js +1 -1
  111. package/dist/es/i18n/locales/zh-HK.js +1 -1
  112. package/dist/es/i18n/locales/zh-TW.js +1 -1
  113. package/dist/es/i18n/util.js +3 -0
  114. package/dist/es/index.js +1 -1
  115. package/dist/es/utils/bem.js +3 -0
  116. package/dist/es/utils/card-brand/brands.js +2 -0
  117. package/dist/es/utils/index.js +3 -0
  118. package/dist/es/utils/payment.js +76 -1
  119. package/dist/types/api/http.d.ts +6 -1
  120. package/dist/types/api/modules/apple-pay/index.d.ts +0 -3
  121. package/dist/types/api/modules/common/index.d.ts +39 -0
  122. package/dist/types/api/modules/index.d.ts +1 -4
  123. package/dist/types/hooks/useBaseWallet.d.ts +16 -4
  124. package/dist/types/utils/payment.d.ts +13 -2
  125. package/package.json +1 -1
  126. package/dist/es/api/modules/card/index.js +0 -16
  127. package/dist/es/api/modules/google-pay/index.js +0 -16
  128. package/dist/es/api/modules/sepa/index.js +0 -16
  129. package/dist/es/api/modules/wallet/index.js +0 -16
  130. package/dist/types/api/modules/card/index.d.ts +0 -4
  131. package/dist/types/api/modules/google-pay/index.d.ts +0 -4
  132. package/dist/types/api/modules/sepa/index.d.ts +0 -4
  133. package/dist/types/api/modules/wallet/index.d.ts +0 -18
@@ -58,7 +58,7 @@ const zhTW = {
58
58
  "common.pay": "支付",
59
59
  "common.payProcessing": "處理中...",
60
60
  "common.paySuccess": "支付成功",
61
- "common.payTimeout": "支付超時",
61
+ "common.payTimeout": "您的網路連線不穩定,付款可能已經成功。",
62
62
  "common.pay3DSIncomplete": "未完成3DS認證",
63
63
  "common.queryTimeout": "查詢超時,請刷新頁面或者重新支付查詢結果",
64
64
  "common.generateQrCode": "生成二維碼",
@@ -3,6 +3,9 @@ import "../utils/card-brand/brands.js";
3
3
  import { getBrowserInfo } from "../utils/system-info/get-browser-info.js";
4
4
  import { LocaleKey, language2LocaleKeyMap, getLocales } from "./locales/index.js";
5
5
  import enGB from "./locales/en-GB.js";
6
+ import "../core.js";
7
+ import "../core/context.js";
8
+ import "../out/fraud-detection.js";
6
9
  const normalizedLocale = (locale) => {
7
10
  return locale.trim().replaceAll("_", "-").toLowerCase();
8
11
  };
package/dist/es/index.js CHANGED
@@ -52,11 +52,11 @@ import { getFingerprint } from "./utils/system-info/finger-print.js";
52
52
  import "./utils/system-info/get-browser-info.js";
53
53
  import { CardBrandCode, EPayKKaEnv, PaymentAction, PaymentStatus, defaultInputStyleConfig, inputStyleAttrs } from "./types/index.js";
54
54
  import { redirectToPayment } from "./utils/redirect.js";
55
+ import { setApiUrl, setCDNUrl, setCustomLocale, setCustomReqHeaders, setFraudDetectionEnv } from "./config.js";
55
56
  import "./core.js";
56
57
  import { I18n } from "./i18n/I18n.js";
57
58
  import { LocaleKey } from "./i18n/locales/index.js";
58
59
  import "./out/fraud-detection.js";
59
- import { setApiUrl, setCDNUrl, setCustomLocale, setCustomReqHeaders, setFraudDetectionEnv } from "./config.js";
60
60
  import { ECollMode } from "./types/fraud-detection.js";
61
61
  import { MessageAction } from "./types/message.js";
62
62
  import { ApplePayEventType, FraudDetectionEventType, GooglePayEventType, LoggerEventType, PaymentEventType, SecurityIframeEventType, ThreeDSEventType, WechatPayEventType } from "./types/event.js";
@@ -1,6 +1,9 @@
1
1
  import { isString, isNil, isNumber, isArray } from "./is.js";
2
2
  import "./card-brand/brands.js";
3
3
  import "./system-info/get-browser-info.js";
4
+ import "../core.js";
5
+ import "../core/context.js";
6
+ import "../out/fraud-detection.js";
4
7
  function generateBEM(name, mods = []) {
5
8
  if (isNil(mods)) {
6
9
  return "";
@@ -2,6 +2,8 @@ import { IconAmex } from "../../components/internal/icons/IconAmex.js";
2
2
  import "../../core.js";
3
3
  import "../system-info/get-browser-info.js";
4
4
  import { CardBrandCode } from "../../types/index.js";
5
+ import "../../core/context.js";
6
+ import "../../out/fraud-detection.js";
5
7
  import { IconDinnersClub } from "../../components/internal/icons/IconDinnersClub.js";
6
8
  import { IconDiscover } from "../../components/internal/icons/IconDiscover.js";
7
9
  import { IconJcb } from "../../components/internal/icons/IconJcb.js";
@@ -1,6 +1,9 @@
1
1
  import { isUndefined } from "./is.js";
2
2
  import "./card-brand/brands.js";
3
3
  import "./system-info/get-browser-info.js";
4
+ import "../core.js";
5
+ import "../core/context.js";
6
+ import "../out/fraud-detection.js";
4
7
  const getIf = (value, condition) => {
5
8
  return condition ? value : void 0;
6
9
  };
@@ -1,3 +1,7 @@
1
+ import { isTimeoutError } from "../api/http.js";
2
+ import "./card-brand/brands.js";
3
+ import "./system-info/get-browser-info.js";
4
+ import "../core.js";
1
5
  const processPaymentStatus = async (res, config) => {
2
6
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
3
7
  const { status, orderStatus } = res;
@@ -33,7 +37,7 @@ const processPaymentStatus = async (res, config) => {
33
37
  break;
34
38
  }
35
39
  default: {
36
- await ((_h = config.onDefault) == null ? void 0 : _h.call(config));
40
+ await ((_h = config.onProcessing) == null ? void 0 : _h.call(config));
37
41
  break;
38
42
  }
39
43
  }
@@ -76,7 +80,78 @@ const formatPaymentResult = (res) => {
76
80
  rawResponse: res == null ? void 0 : res.rawResponse
77
81
  };
78
82
  };
83
+ const CheckpointSchedule = [
84
+ [10 * 1e3, 5 * 1e3],
85
+ [15 * 1e3, 5 * 1e3],
86
+ [20 * 1e3, 5 * 1e3]
87
+ ];
88
+ const payWithCheckpoints = async (pay, query) => {
89
+ const abortController = new AbortController();
90
+ let pendingCount = 1 + CheckpointSchedule.length;
91
+ let mainTimedOut = false;
92
+ let lastTimeoutError = null;
93
+ let settled = false;
94
+ const timers = [];
95
+ return new Promise((resolve, reject) => {
96
+ const done = (data) => {
97
+ if (settled)
98
+ return;
99
+ settled = true;
100
+ timers.forEach(clearTimeout);
101
+ abortController.abort();
102
+ resolve(data);
103
+ };
104
+ const fail = (err) => {
105
+ if (settled)
106
+ return;
107
+ settled = true;
108
+ timers.forEach(clearTimeout);
109
+ abortController.abort();
110
+ reject(err);
111
+ };
112
+ const tryFailFromTimeout = () => {
113
+ if (pendingCount === 0 && !settled && mainTimedOut) {
114
+ fail(lastTimeoutError);
115
+ }
116
+ };
117
+ pay(abortController.signal).then((res) => {
118
+ done(res);
119
+ }).catch((err) => {
120
+ if (isTimeoutError(err)) {
121
+ mainTimedOut = true;
122
+ lastTimeoutError = err;
123
+ pendingCount--;
124
+ tryFailFromTimeout();
125
+ } else {
126
+ fail(err);
127
+ }
128
+ });
129
+ for (let i = 0; i < CheckpointSchedule.length; i++) {
130
+ const [delay, timeout] = CheckpointSchedule[i];
131
+ const timer = setTimeout(() => {
132
+ if (settled) {
133
+ return;
134
+ }
135
+ query(timeout, abortController.signal).then((res) => {
136
+ done(res);
137
+ }).catch((err) => {
138
+ if ((err == null ? void 0 : err.name) === "AbortError") {
139
+ pendingCount--;
140
+ tryFailFromTimeout();
141
+ } else if (isTimeoutError(err)) {
142
+ pendingCount--;
143
+ tryFailFromTimeout();
144
+ } else {
145
+ fail(err);
146
+ }
147
+ });
148
+ }, delay);
149
+ timers.push(timer);
150
+ }
151
+ });
152
+ };
79
153
  export {
80
154
  formatPaymentResult,
155
+ payWithCheckpoints,
81
156
  processPaymentStatus
82
157
  };
@@ -1,12 +1,17 @@
1
1
  export interface RequestOptions {
2
+ /** 请求超时时间 */
2
3
  timeout?: number;
4
+ /** 请求语言 */
3
5
  locale?: string;
6
+ /** 请求头 */
4
7
  headers?: Recordable;
8
+ /** 请求信号 */
9
+ signal?: AbortSignal;
5
10
  }
6
11
  export declare enum EHttpCode {
7
12
  INTERNAL_SERVER_ERROR = "500"
8
13
  }
9
- export declare const request: <T = any, P = any>(method: 'get' | 'post', url: string, params?: P, { timeout, headers, locale }?: RequestOptions) => Promise<T>;
14
+ export declare const request: <T = any, P = any>(method: 'get' | 'post', url: string, params?: P, { timeout, headers, locale, signal }?: RequestOptions) => Promise<T>;
10
15
  export declare const http: {
11
16
  get: <T = any, P = any>(url: string, params?: P, options?: RequestOptions) => Promise<T>;
12
17
  post: <T_1 = any, P_1 = any>(url: string, params?: P_1 | undefined, options?: RequestOptions) => Promise<T_1>;
@@ -1,5 +1,2 @@
1
1
  import { type RequestOptions } from '../../http';
2
- import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
3
2
  export declare const getMerchantSession: (options?: RequestOptions) => Promise<any>;
4
- export declare const applePay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
5
- export declare const getApplePayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
@@ -0,0 +1,39 @@
1
+ import { type RequestOptions } from '../../http';
2
+ import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
3
+ /** 支付配置 */
4
+ interface PaymentConfig {
5
+ /** 支付参数 */
6
+ params: CheckoutPaymentParams;
7
+ /** 额外参数 */
8
+ extraParams?: Recordable;
9
+ options?: {
10
+ /** 请求配置 */
11
+ request?: RequestOptions;
12
+ /** 查询配置,默认开启查询轮询 */
13
+ query?: {
14
+ /** 是否开启检查点查询轮询 */
15
+ enable?: boolean;
16
+ /** 查询参数 */
17
+ params: CheckoutQueryParams;
18
+ /** 额外参数 */
19
+ extraParams?: Recordable;
20
+ };
21
+ };
22
+ }
23
+ /**
24
+ * 通用支付请求
25
+ * @param params 支付参数
26
+ * @param extraParams 额外参数
27
+ * @param options 请求配置
28
+ * @returns 支付结果
29
+ */
30
+ export declare const commonPayment: (config: PaymentConfig) => Promise<import("../../..").BasePaymentInfo>;
31
+ /**
32
+ * 通用支付查询
33
+ * @param params 查询参数`
34
+ * @param extraParams 额外参数
35
+ * @param options 请求配置
36
+ * @returns 支付结果
37
+ */
38
+ export declare const commonPaymentQuery: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
39
+ export {};
@@ -1,9 +1,6 @@
1
- export * from './card';
2
1
  export * from './checkout';
3
2
  export * from './apple-pay';
4
- export * from './google-pay';
5
- export * from './sepa';
6
- export * from './wallet';
3
+ export * from './common';
7
4
  export * from './map';
8
5
  export * from './type';
9
6
  export * from './get-browser-params';
@@ -6,7 +6,19 @@ import { type FieldStatusConfig } from '../api';
6
6
  import type { PaymentButtonStatus } from '../components/PaymentButton';
7
7
  import type { PaymentCommonProps, PaymentMethodContext } from '../types/payment';
8
8
  export type BaseWalletProps = WalletCustomProps & WalletRedirectProps & WalletQRCodeModalProps & CoreProps & PaymentCommonProps;
9
- export type BaseWalletOptions = {
9
+ export interface BaseWalletOnProcessingResult {
10
+ /**
11
+ * 是否需要继续轮询查询
12
+ * @defaultValue true
13
+ */
14
+ continueSearch?: boolean;
15
+ /**
16
+ * 是否已经处理过支付动作
17
+ * @defaultValue false
18
+ */
19
+ actionHandled?: boolean;
20
+ }
21
+ export interface BaseWalletOptions {
10
22
  /**
11
23
  * 轮询超时时间
12
24
  * @defaultValue 20 * 1000
@@ -21,9 +33,9 @@ export type BaseWalletOptions = {
21
33
  getFormData: () => Recordable;
22
34
  /**
23
35
  * 处理支付中状态
24
- * 返回 false 时,结束轮询
36
+ * 可通过返回值控制是否继续轮询,以及是否已处理当前支付动作
25
37
  */
26
- onProcessing?: (paymentInfo: BasePaymentInfo) => MaybePromise<void | boolean>;
38
+ onProcessing?: (paymentInfo: BasePaymentInfo) => MaybePromise<void | BaseWalletOnProcessingResult>;
27
39
  /** 获取支付请求额外的参数,通常为某种支付方式所特有 */
28
40
  getExtraPaymentParams?: () => MaybePromise<DeepPartial<CheckoutPaymentParams>>;
29
41
  /**
@@ -31,7 +43,7 @@ export type BaseWalletOptions = {
31
43
  * 支付完成后,需要 processAfterPayment 方法处理后续逻辑
32
44
  **/
33
45
  executePayment?: (params: CheckoutPaymentParams, extraParams?: Recordable) => void;
34
- };
46
+ }
35
47
  /**
36
48
  * 基础钱包通用逻辑
37
49
  * @param paymentMethod - 支付方式
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * 支付流程处理
3
3
  */
4
- import type { CheckoutRes, PayRes } from '../api';
5
- import type { PaymentInfo } from '../types';
4
+ import { type CheckoutRes, type OrderStatus, type PayRes, type SessionStatus } from '../api';
5
+ import type { BasePaymentInfo, PaymentInfo } from '../types';
6
6
  export interface PaymentCallbackConfig {
7
7
  /** 订单处理中,定时查询订单 */
8
8
  onProcessing?: () => void | Promise<void>;
@@ -35,3 +35,14 @@ export declare const processPaymentStatus: (res: PayRes, config: PaymentCallback
35
35
  * @param res
36
36
  */
37
37
  export declare const formatPaymentResult: (res?: PayRes | CheckoutRes) => PaymentInfo;
38
+ /**
39
+ * 判断支付结果是否为终态,如果为终态则无需继续查询(注意:这里说的终态并不代表支付已经结束,而是指不需要继续查询)
40
+ * @param status 收银台状态
41
+ * @param orderStatus 订单状态
42
+ * @returns 是否支付完成
43
+ * @returns
44
+ */
45
+ export declare const isPaymentDone: (status: SessionStatus | undefined, orderStatus: OrderStatus | undefined) => boolean;
46
+ /** 查询轮询时间间隔配置,对应[支付开始后的触发时间, 超时时间],单位: 毫秒 */
47
+ export declare const CheckpointSchedule: number[][];
48
+ export declare const payWithCheckpoints: (pay: (signal: AbortSignal) => Promise<BasePaymentInfo>, query: (timeout: number, signal: AbortSignal) => Promise<BasePaymentInfo>) => Promise<BasePaymentInfo>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paykka/card-checkout-ui",
3
- "version": "0.15.2",
3
+ "version": "0.16.0",
4
4
  "type": "module",
5
5
  "main": "dist/paykka-card-checkout-ui.umd.js",
6
6
  "module": "dist/es/index.js",
@@ -1,16 +0,0 @@
1
- import { apiPrefix } from "../../../config.js";
2
- import { http } from "../../http.js";
3
- import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
4
- import { payResMap } from "../map.js";
5
- const cardPay = async (params, extraParams, options) => {
6
- const paymentParams = buildPaymentParams(params, extraParams);
7
- return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
8
- };
9
- const getCardPayInfo = async (params, extraParams, options) => {
10
- const queryParams = buildQueryParams(params, extraParams);
11
- return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
12
- };
13
- export {
14
- cardPay,
15
- getCardPayInfo
16
- };
@@ -1,16 +0,0 @@
1
- import { apiPrefix } from "../../../config.js";
2
- import { http } from "../../http.js";
3
- import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
4
- import { payResMap } from "../map.js";
5
- const googlePay = async (params, extraParams, options) => {
6
- const paymentParams = buildPaymentParams(params, extraParams);
7
- return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
8
- };
9
- const getGooglePayInfo = async (params, extraParams, options) => {
10
- const queryParams = buildQueryParams(params, extraParams);
11
- return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
12
- };
13
- export {
14
- getGooglePayInfo,
15
- googlePay
16
- };
@@ -1,16 +0,0 @@
1
- import { apiPrefix } from "../../../config.js";
2
- import { http } from "../../http.js";
3
- import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
4
- import { payResMap } from "../map.js";
5
- const sepaPay = async (params, extraParams, options) => {
6
- const paymentParams = buildPaymentParams(params, extraParams);
7
- return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
8
- };
9
- const getSepaPayInfo = async (params, extraParams, options) => {
10
- const queryParams = buildQueryParams(params, extraParams);
11
- return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
12
- };
13
- export {
14
- getSepaPayInfo,
15
- sepaPay
16
- };
@@ -1,16 +0,0 @@
1
- import { apiPrefix } from "../../../config.js";
2
- import { http } from "../../http.js";
3
- import { buildPaymentParams, buildQueryParams } from "../../utils/index.js";
4
- import { payResMap } from "../map.js";
5
- const walletPay = async (params, extraParams, options) => {
6
- const paymentParams = buildPaymentParams(params, extraParams);
7
- return http.post(`${apiPrefix}/payments`, paymentParams, options).then(payResMap);
8
- };
9
- const getWalletPayInfo = async (params, extraParams, options) => {
10
- const queryParams = buildQueryParams(params, extraParams);
11
- return http.post(`${apiPrefix}/payments/query`, queryParams, options).then(payResMap);
12
- };
13
- export {
14
- getWalletPayInfo,
15
- walletPay
16
- };
@@ -1,4 +0,0 @@
1
- import { type RequestOptions } from '../../http';
2
- import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
3
- export declare const cardPay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
4
- export declare const getCardPayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
@@ -1,4 +0,0 @@
1
- import { type RequestOptions } from '../../http';
2
- import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
3
- export declare const googlePay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
4
- export declare const getGooglePayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
@@ -1,4 +0,0 @@
1
- import { type RequestOptions } from '../../http';
2
- import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
3
- export declare const sepaPay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
4
- export declare const getSepaPayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
@@ -1,18 +0,0 @@
1
- import { type RequestOptions } from '../../http';
2
- import type { CheckoutPaymentParams, CheckoutQueryParams } from '../type';
3
- /**
4
- * 钱包通用支付请求
5
- * @param params 支付参数
6
- * @param extraParams 额外参数
7
- * @param options 请求配置
8
- * @returns 支付结果
9
- */
10
- export declare const walletPay: (params: CheckoutPaymentParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;
11
- /**
12
- * 钱包通用支付查询
13
- * @param params 查询参数
14
- * @param extraParams 额外参数
15
- * @param options 请求配置
16
- * @returns 支付结果
17
- */
18
- export declare const getWalletPayInfo: (params: CheckoutQueryParams, extraParams?: Recordable, options?: RequestOptions) => Promise<import("../../..").BasePaymentInfo>;