tonder-web-sdk 1.16.1 → 1.16.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.
Files changed (46) hide show
  1. package/.husky/pre-commit +4 -0
  2. package/.prettierignore +8 -0
  3. package/.prettierrc +10 -0
  4. package/README.md +113 -16
  5. package/eslint.config.mjs +15 -0
  6. package/package.json +20 -4
  7. package/src/classes/3dsHandler.js +58 -62
  8. package/src/classes/BaseInlineCheckout.js +12 -33
  9. package/src/classes/LiteInlineCheckout.js +5 -8
  10. package/src/classes/checkout.js +75 -71
  11. package/src/classes/globalLoader.js +9 -7
  12. package/src/classes/inlineCheckout.js +519 -321
  13. package/src/data/apmApi.js +8 -14
  14. package/src/data/businessApi.js +5 -8
  15. package/src/data/cardApi.js +5 -14
  16. package/src/data/checkoutApi.js +54 -54
  17. package/src/data/customerApi.js +1 -6
  18. package/src/data/index.js +15 -15
  19. package/src/data/openPayApi.js +7 -7
  20. package/src/data/skyflowApi.js +14 -16
  21. package/src/helpers/skyflow.js +132 -123
  22. package/src/helpers/styles.js +56 -27
  23. package/src/helpers/template-skeleton.js +1 -1
  24. package/src/helpers/template.js +971 -610
  25. package/src/helpers/utils.js +152 -58
  26. package/src/helpers/validations.js +34 -35
  27. package/src/index-dev.js +33 -11
  28. package/src/index.html +20 -12
  29. package/src/index.js +19 -13
  30. package/src/shared/catalog/commonLogosCatalog.js +7 -0
  31. package/src/shared/catalog/paymentMethodsCatalog.js +242 -243
  32. package/src/shared/constants/colors.js +15 -0
  33. package/src/shared/constants/displayMode.js +4 -0
  34. package/src/shared/constants/fieldPathNames.js +4 -0
  35. package/src/shared/constants/htmlTonderIds.js +18 -0
  36. package/src/shared/constants/messages.js +10 -9
  37. package/types/card.d.ts +17 -17
  38. package/types/checkout.d.ts +85 -87
  39. package/types/common.d.ts +4 -2
  40. package/types/customer.d.ts +10 -10
  41. package/types/index.d.ts +9 -11
  42. package/types/inlineCheckout.d.ts +81 -61
  43. package/types/liteInlineCheckout.d.ts +78 -83
  44. package/types/paymentMethod.d.ts +17 -17
  45. package/types/transaction.d.ts +94 -94
  46. package/v1/bundle.min.js +3 -3
@@ -1,118 +1,116 @@
1
- import {ICustomer} from "./customer";
1
+ import { ICustomer } from "./customer";
2
2
 
3
3
  export interface IStartCheckoutRequestBase {
4
- name: any;
5
- last_name: string;
6
- email_client: any;
7
- phone_number: any;
8
- return_url?: string;
9
- id_product: string;
10
- quantity_product: number;
11
- id_ship: string;
12
- instance_id_ship: string;
13
- amount: any;
14
- title_ship: string;
15
- description: string;
16
- device_session_id: any;
17
- token_id: string;
18
- order_id: any;
19
- business_id: any;
20
- payment_id: any;
21
- source: string;
22
- browser_info?: any;
23
- metadata: any;
24
- currency: string;
4
+ name: any;
5
+ last_name: string;
6
+ email_client: any;
7
+ phone_number: any;
8
+ return_url?: string;
9
+ id_product: string;
10
+ quantity_product: number;
11
+ id_ship: string;
12
+ instance_id_ship: string;
13
+ amount: any;
14
+ title_ship: string;
15
+ description: string;
16
+ device_session_id: any;
17
+ token_id: string;
18
+ order_id: any;
19
+ business_id: any;
20
+ payment_id: any;
21
+ source: string;
22
+ browser_info?: any;
23
+ metadata: any;
24
+ currency: string;
25
25
  }
26
26
 
27
27
  export type IStartCheckoutRequestWithCard = IStartCheckoutRequestBase & {
28
- card: any;
29
- payment_method?: never;
28
+ card: any;
29
+ payment_method?: never;
30
30
  };
31
31
 
32
- export type IStartCheckoutRequestWithPaymentMethod =
33
- IStartCheckoutRequestBase & {
34
- card?: never;
35
- payment_method: string;
32
+ export type IStartCheckoutRequestWithPaymentMethod = IStartCheckoutRequestBase & {
33
+ card?: never;
34
+ payment_method: string;
36
35
  };
37
36
 
38
37
  export type IStartCheckoutRequest =
39
- | IStartCheckoutRequestWithCard
40
- | IStartCheckoutRequestWithPaymentMethod;
38
+ | IStartCheckoutRequestWithCard
39
+ | IStartCheckoutRequestWithPaymentMethod;
41
40
 
42
41
  export interface IStartCheckoutIdRequest {
43
- checkout_id: string;
42
+ checkout_id: string;
44
43
  }
45
44
 
46
45
  export interface IStartCheckoutErrorResponse {
47
- status: string;
48
- message: string;
49
- psp_response: [
50
- {
51
- status: number;
52
- response: Object;
53
- },
54
- ];
55
- checkout_id: string;
56
- is_route_finished: boolean;
46
+ status: string;
47
+ message: string;
48
+ psp_response: [
49
+ {
50
+ status: number;
51
+ response: Object;
52
+ },
53
+ ];
54
+ checkout_id: string;
55
+ is_route_finished: boolean;
57
56
  }
58
57
 
59
58
  export interface IStartCheckoutResponse {
60
- status: string;
61
- message: string;
62
- psp_response: Record<string, any>;
63
- checkout_id: string;
64
- is_route_finished: Boolean;
65
- transaction_status: string;
66
- transaction_id: number;
67
- payment_id: number;
68
- provider: string;
69
- next_action: {
70
- redirect_to_url: {
71
- url: string;
72
- return_url: string;
73
- verify_transaction_status_url: string;
74
- };
75
- iframe_resources?: {
76
- iframe: string;
77
- };
59
+ status: string;
60
+ message: string;
61
+ psp_response: Record<string, any>;
62
+ checkout_id: string;
63
+ is_route_finished: Boolean;
64
+ transaction_status: string;
65
+ transaction_id: number;
66
+ payment_id: number;
67
+ provider: string;
68
+ next_action: {
69
+ redirect_to_url: {
70
+ url: string;
71
+ return_url: string;
72
+ verify_transaction_status_url: string;
78
73
  };
79
- actions: IStartCheckoutActionResponse[];
74
+ iframe_resources?: {
75
+ iframe: string;
76
+ };
77
+ };
78
+ actions: IStartCheckoutActionResponse[];
80
79
  }
81
80
 
82
81
  export interface IStartCheckoutActionResponse {
83
- name: string;
84
- url: string;
85
- method: string;
82
+ name: string;
83
+ url: string;
84
+ method: string;
86
85
  }
87
86
 
88
-
89
87
  export interface IItem {
90
- description: string;
91
- quantity: number;
92
- price_unit: number;
93
- discount: number;
94
- taxes: number;
95
- product_reference: string | number;
96
- name: string;
97
- amount_total: number;
88
+ description: string;
89
+ quantity: number;
90
+ price_unit: number;
91
+ discount: number;
92
+ taxes: number;
93
+ product_reference: string | number;
94
+ name: string;
95
+ amount_total: number;
98
96
  }
99
97
 
100
98
  export interface IProcessPaymentRequest {
101
- customer: ICustomer;
102
- cart: {
103
- total: string | number;
104
- items: IItem[];
105
- };
106
- metadata?: Record<string, any>;
107
- currency?: string;
108
- payment_method?: string;
109
- card?: ICardFields | string;
99
+ customer: ICustomer;
100
+ cart: {
101
+ total: string | number;
102
+ items: IItem[];
103
+ };
104
+ metadata?: Record<string, any>;
105
+ currency?: string;
106
+ payment_method?: string;
107
+ card?: ICardFields | string;
110
108
  }
111
109
 
112
110
  export interface ICardFields {
113
- card_number: string;
114
- cvv: string;
115
- expiration_month: string;
116
- expiration_year: string;
117
- cardholder_name: string;
118
- }
111
+ card_number: string;
112
+ cvv: string;
113
+ expiration_month: string;
114
+ expiration_year: string;
115
+ cardholder_name: string;
116
+ }
package/types/common.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ICustomer } from "./customer";
2
- import {IProcessPaymentRequest} from "./checkout";
2
+ import { IProcessPaymentRequest } from "./checkout";
3
3
 
4
4
  export interface IInlineCheckoutBaseOptions {
5
5
  mode?: "production" | "sandbox" | "stage" | "development";
@@ -8,7 +8,7 @@ export interface IInlineCheckoutBaseOptions {
8
8
  callBack?: (response: any) => void;
9
9
  }
10
10
 
11
- export interface IConfigureCheckout extends IProcessPaymentRequest{
11
+ export interface IConfigureCheckout extends Partial<IProcessPaymentRequest> {
12
12
  customer: ICustomer;
13
13
  secureToken: string;
14
14
  }
@@ -26,3 +26,5 @@ export interface IPublicError {
26
26
  message: string;
27
27
  detail: Record<string, any> | string;
28
28
  }
29
+
30
+ export interface IBaseCallback {}
@@ -1,12 +1,12 @@
1
1
  export type ICustomer = {
2
- firstName: string;
3
- lastName: string;
4
- country?: string;
5
- street?: string;
6
- city?: string;
7
- state?: string;
8
- postCode?: string;
9
- email: string;
10
- phone?: string;
11
- address?: string;
2
+ firstName: string;
3
+ lastName: string;
4
+ country?: string;
5
+ street?: string;
6
+ city?: string;
7
+ state?: string;
8
+ postCode?: string;
9
+ email: string;
10
+ phone?: string;
11
+ address?: string;
12
12
  };
package/types/index.d.ts CHANGED
@@ -1,11 +1,9 @@
1
- export * from './card';
2
- export * from './checkout';
3
- export * from './common';
4
- export * from './customer';
5
- export * from './transaction';
6
- export * from './paymentMethod';
7
- export * from './inlineCheckout';
8
- export * from './liteInlineCheckout';
9
- export * from './validations';
10
-
11
-
1
+ export * from "./card";
2
+ export * from "./checkout";
3
+ export * from "./common";
4
+ export * from "./customer";
5
+ export * from "./transaction";
6
+ export * from "./paymentMethod";
7
+ export * from "./inlineCheckout";
8
+ export * from "./liteInlineCheckout";
9
+ export * from "./validations";
@@ -1,74 +1,94 @@
1
- import {IConfigureCheckout, IInlineCheckoutBaseOptions} from "./common";
2
- import {IProcessPaymentRequest, IStartCheckoutResponse} from "./checkout";
3
- import {ITransaction} from "./transaction";
1
+ import { IBaseCallback, IConfigureCheckout, IInlineCheckoutBaseOptions } from "./common";
2
+ import { IProcessPaymentRequest, IStartCheckoutResponse } from "./checkout";
3
+ import { ITransaction } from "./transaction";
4
4
 
5
5
  export class InlineCheckout {
6
- constructor(options: IInlineCheckoutOptions);
6
+ constructor(options: IInlineCheckoutOptions);
7
7
 
8
- /**
9
- * The configureCheckout function allows you to set initial information, such as the customer's email, which is used to retrieve a list of saved cards.
10
- * @param {import("../types").IConfigureCheckout} data - Configuration data including customer information and potentially other settings.
11
- * @returns {void}.
12
- * @public
13
- */
14
- configureCheckout(data: IConfigureCheckout): void;
8
+ /**
9
+ * The configureCheckout function allows you to set initial information, such as the customer's email, which is used to retrieve a list of saved cards.
10
+ * @param {import("../types").IConfigureCheckout} data - Configuration data including customer information and potentially other settings.
11
+ * @returns {void}.
12
+ * @public
13
+ */
14
+ configureCheckout(data: IConfigureCheckout): void;
15
15
 
16
- /**
17
- * Injects the checkout into the DOM and initializes it.
18
- * Checks for an existing container and sets up an observer if needed.
19
- * @returns {void}
20
- * @public
21
- */
22
- injectCheckout(): Promise<void>;
16
+ /**
17
+ * Injects the checkout into the DOM and initializes it.
18
+ * Checks for an existing container and sets up an observer if needed.
19
+ * @returns {void}
20
+ * @public
21
+ */
22
+ injectCheckout(): Promise<void>;
23
23
 
24
- /**
25
- * Processes a payment.
26
- * @param {import("../types").IProcessPaymentRequest} data - Payment data including customer, cart, and other relevant information.
27
- * @returns {Promise<import("../types").IStartCheckoutResponse>} A promise that resolves with the payment response or 3DS redirect or is rejected with an error.
28
- *
29
- * @throws {Error} Throws an error if the checkout process fails. The error object contains
30
- * additional `details` property with the response from the server if available.
31
- * @property {import("../types").IStartCheckoutErrorResponse} error.details - The response body from the server when an error occurs.
32
- *
33
- * @public
34
- */
35
- payment(data: IProcessPaymentRequest): Promise<IStartCheckoutResponse>;
24
+ /**
25
+ * Processes a payment.
26
+ * @param {import("../types").IProcessPaymentRequest} data - Payment data including customer, cart, and other relevant information.
27
+ * @returns {Promise<import("../types").IStartCheckoutResponse>} A promise that resolves with the payment response or 3DS redirect or is rejected with an error.
28
+ *
29
+ * @throws {Error} Throws an error if the checkout process fails. The error object contains
30
+ * additional `details` property with the response from the server if available.
31
+ * @property {import("../types").IStartCheckoutErrorResponse} error.details - The response body from the server when an error occurs.
32
+ *
33
+ * @public
34
+ */
35
+ payment(data: IProcessPaymentRequest): Promise<IStartCheckoutResponse>;
36
36
 
37
- /**
38
- * Verifies the 3DS transaction status.
39
- * @returns {Promise<import("../types").ITransaction | void>} The result of the 3DS verification and checkout resumption.
40
- * @public
41
- */
42
- verify3dsTransaction(): Promise<ITransaction | void>;
37
+ /**
38
+ * Verifies the 3DS transaction status.
39
+ * @returns {Promise<import("../types").ITransaction | void>} The result of the 3DS verification and checkout resumption.
40
+ * @public
41
+ */
42
+ verify3dsTransaction(): Promise<ITransaction | void>;
43
43
 
44
- /**
45
- * Removes the checkout from the DOM and cleans up associated resources.
46
- *
47
- * This method performs the following actions:
48
- * 1. Resets the injection status flags for the checkout, cards, and APMs.
49
- * 2. Aborts any ongoing requests using the AbortController.
50
- * 3. Creates a new AbortController for future use.
51
- * 4. Clears any existing injection intervals.
52
- *
53
- * Note: This method should be called when you want to completely remove
54
- * the checkout from the page and reset its state.
55
- *
56
- * @returns {void}
57
- * @public
58
- */
59
- removeCheckout(): void;
44
+ /**
45
+ * Removes the checkout from the DOM and cleans up associated resources.
46
+ *
47
+ * This method performs the following actions:
48
+ * 1. Resets the injection status flags for the checkout, cards, and APMs.
49
+ * 2. Aborts any ongoing requests using the AbortController.
50
+ * 3. Creates a new AbortController for future use.
51
+ * 4. Clears any existing injection intervals.
52
+ *
53
+ * Note: This method should be called when you want to completely remove
54
+ * the checkout from the page and reset its state.
55
+ *
56
+ * @returns {void}
57
+ * @public
58
+ */
59
+ removeCheckout(): void;
60
60
  }
61
61
 
62
62
  export type CustomizationOptions = {
63
- saveCards?: {
64
- showSaveCardOption?: boolean;
65
- showSaved?: boolean;
66
- autoSave?: boolean;
67
- }
63
+ displayMode?: "light" | "dark";
64
+ saveCards?: {
65
+ showSaveCardOption?: boolean;
66
+ showSaved?: boolean;
67
+ autoSave?: boolean;
68
+ };
69
+ paymentButton?: {
70
+ show?: boolean;
71
+ text?: string;
72
+ showAmount?: boolean;
73
+ };
74
+ cancelButton?: {
75
+ show?: boolean;
76
+ text?: string;
77
+ };
78
+ paymentMethods?: {
79
+ show?: boolean;
80
+ };
81
+ cardForm?: {
82
+ show?: boolean;
83
+ };
84
+ showMessages?: boolean;
85
+ };
86
+ export interface IInlineCallbacks extends IBaseCallback {
87
+ onCancel?: () => Promise<void>;
68
88
  }
69
89
 
70
- export interface IInlineCheckoutOptions extends IInlineCheckoutBaseOptions{
71
- styles?: Record<string, string>;
72
- renderPaymentButton?: boolean;
73
- customization?: CustomizationOptions;
90
+ export interface IInlineCheckoutOptions extends IInlineCheckoutBaseOptions {
91
+ styles?: Record<string, string>;
92
+ customization?: CustomizationOptions;
93
+ callbacks?: IInlineCallbacks;
74
94
  }
@@ -1,96 +1,91 @@
1
- import {IConfigureCheckout, IInlineCheckoutBaseOptions} from "./common";
2
- import {ICustomerCardsResponse, ISaveCardRequest, ISaveCardResponse} from "./card";
3
- import {IPaymentMethod} from "./paymentMethod";
4
- import {IProcessPaymentRequest, IStartCheckoutResponse} from "./checkout";
5
- import {ITransaction} from "./transaction";
1
+ import { IConfigureCheckout, IInlineCheckoutBaseOptions } from "./common";
2
+ import { ICustomerCardsResponse, ISaveCardRequest, ISaveCardResponse } from "./card";
3
+ import { IPaymentMethod } from "./paymentMethod";
4
+ import { IProcessPaymentRequest, IStartCheckoutResponse } from "./checkout";
5
+ import { ITransaction } from "./transaction";
6
6
 
7
7
  export class LiteInlineCheckout {
8
- constructor(options: IInlineLiteCheckoutOptions);
8
+ constructor(options: IInlineLiteCheckoutOptions);
9
9
 
10
- /**
11
- * The configureCheckout function allows you to set initial information, such as the customer's email, which is used to retrieve a list of saved cards.
12
- * @param {import("../types").IConfigureCheckout} data - Configuration data including customer information and potentially other settings.
13
- * @returns {Promise<void>}.
14
- * @public
15
- */
16
- configureCheckout(data: IConfigureCheckout): void;
10
+ /**
11
+ * The configureCheckout function allows you to set initial information, such as the customer's email, which is used to retrieve a list of saved cards.
12
+ * @param {import("../types").IConfigureCheckout} data - Configuration data including customer information and potentially other settings.
13
+ * @returns {Promise<void>}.
14
+ * @public
15
+ */
16
+ configureCheckout(data: IConfigureCheckout): void;
17
17
 
18
- /**
19
- * Initializes and prepares the checkout for use.
20
- * This method set up the initial environment.
21
- * @returns {Promise<void>} A promise that resolves when the checkout has been initialized.
22
- * @throws {Error} If there's any problem during the checkout initialization.
23
- * @public
24
- */
25
- injectCheckout(): Promise<void>;
18
+ /**
19
+ * Initializes and prepares the checkout for use.
20
+ * This method set up the initial environment.
21
+ * @returns {Promise<void>} A promise that resolves when the checkout has been initialized.
22
+ * @throws {Error} If there's any problem during the checkout initialization.
23
+ * @public
24
+ */
25
+ injectCheckout(): Promise<void>;
26
26
 
27
- /**
28
- * Processes a payment.
29
- * @param {import("../types").IProcessPaymentRequest} data - Payment data including customer, cart, and other relevant information.
30
- * @returns {Promise<import("../types").IStartCheckoutResponse>} A promise that resolves with the payment response or 3DS redirect or is rejected with an error.
31
- *
32
- * @throws {Error} Throws an error if the checkout process fails. The error object contains
33
- * additional `details` property with the response from the server if available.
34
- * @property {import("../types").IStartCheckoutErrorResponse} error.details - The response body from the server when an error occurs.
35
- *
36
- * @public
37
- */
38
- payment(data: IProcessPaymentRequest): Promise<IStartCheckoutResponse>;
27
+ /**
28
+ * Processes a payment.
29
+ * @param {import("../types").IProcessPaymentRequest} data - Payment data including customer, cart, and other relevant information.
30
+ * @returns {Promise<import("../types").IStartCheckoutResponse>} A promise that resolves with the payment response or 3DS redirect or is rejected with an error.
31
+ *
32
+ * @throws {Error} Throws an error if the checkout process fails. The error object contains
33
+ * additional `details` property with the response from the server if available.
34
+ * @property {import("../types").IStartCheckoutErrorResponse} error.details - The response body from the server when an error occurs.
35
+ *
36
+ * @public
37
+ */
38
+ payment(data: IProcessPaymentRequest): Promise<IStartCheckoutResponse>;
39
39
 
40
- /**
41
- * Verifies the 3DS transaction status.
42
- * @returns {Promise<import("../types").ITransaction | void>} The result of the 3DS verification and checkout resumption.
43
- * @public
44
- */
45
- verify3dsTransaction(): Promise<ITransaction | void>;
40
+ /**
41
+ * Verifies the 3DS transaction status.
42
+ * @returns {Promise<import("../types").ITransaction | void>} The result of the 3DS verification and checkout resumption.
43
+ * @public
44
+ */
45
+ verify3dsTransaction(): Promise<ITransaction | void>;
46
46
 
47
- /**
48
- * Retrieves the list of cards associated with a customer.
49
- * @returns {Promise<import("../types").ICustomerCardsResponse>} A promise that resolves with the customer's card data.
50
- *
51
- * @throws {import("../types").IPublicError} Throws an error object if the operation fails.
52
- *
53
- * @public
54
- */
55
- getCustomerCards(): Promise<ICustomerCardsResponse>;
47
+ /**
48
+ * Retrieves the list of cards associated with a customer.
49
+ * @returns {Promise<import("../types").ICustomerCardsResponse>} A promise that resolves with the customer's card data.
50
+ *
51
+ * @throws {import("../types").IPublicError} Throws an error object if the operation fails.
52
+ *
53
+ * @public
54
+ */
55
+ getCustomerCards(): Promise<ICustomerCardsResponse>;
56
56
 
57
- /**
58
- * Saves a card to a customer's account. This method can be used to add a new card
59
- * or update an existing one.
60
- * @param {import("../types").ISaveCardRequest} card - The card information to be saved.
61
- * @returns {Promise<import("../types").ISaveCardResponse>} A promise that resolves with the saved card data.
62
- *
63
- * @throws {import("../types").IPublicError} Throws an error object if the operation fails.
64
- *
65
- * @public
66
- */
67
- saveCustomerCard(
68
- card: ISaveCardRequest,
69
- ): Promise<ISaveCardResponse>;
57
+ /**
58
+ * Saves a card to a customer's account. This method can be used to add a new card
59
+ * or update an existing one.
60
+ * @param {import("../types").ISaveCardRequest} card - The card information to be saved.
61
+ * @returns {Promise<import("../types").ISaveCardResponse>} A promise that resolves with the saved card data.
62
+ *
63
+ * @throws {import("../types").IPublicError} Throws an error object if the operation fails.
64
+ *
65
+ * @public
66
+ */
67
+ saveCustomerCard(card: ISaveCardRequest): Promise<ISaveCardResponse>;
70
68
 
71
- /**
72
- * Removes a card from a customer's account.
73
- * @param {string} skyflowId - The unique identifier of the card to be deleted.
74
- * @returns {Promise<string>} A promise that resolves when the card is successfully deleted.
75
- *
76
- * @throws {import("../types").IPublicError} Throws an error object if the operation fails.
77
- *
78
- * @public
79
- */
80
- removeCustomerCard(
81
- skyflowId: string,
82
- ): Promise<void>;
69
+ /**
70
+ * Removes a card from a customer's account.
71
+ * @param {string} skyflowId - The unique identifier of the card to be deleted.
72
+ * @returns {Promise<string>} A promise that resolves when the card is successfully deleted.
73
+ *
74
+ * @throws {import("../types").IPublicError} Throws an error object if the operation fails.
75
+ *
76
+ * @public
77
+ */
78
+ removeCustomerCard(skyflowId: string): Promise<void>;
83
79
 
84
- /**
85
- * Retrieves the list of available Alternative Payment Methods (APMs).
86
- * @returns {Promise<import("../types").IPaymentMethod[]>} A promise that resolves with the list of APMs.
87
- *
88
- * @throws {import("../types").IPublicError} Throws an error object if the operation fails.
89
- *
90
- * @public
91
- */
92
- getCustomerPaymentMethods(): Promise<IPaymentMethod[]>;
80
+ /**
81
+ * Retrieves the list of available Alternative Payment Methods (APMs).
82
+ * @returns {Promise<import("../types").IPaymentMethod[]>} A promise that resolves with the list of APMs.
83
+ *
84
+ * @throws {import("../types").IPublicError} Throws an error object if the operation fails.
85
+ *
86
+ * @public
87
+ */
88
+ getCustomerPaymentMethods(): Promise<IPaymentMethod[]>;
93
89
  }
94
90
 
95
-
96
91
  export interface IInlineLiteCheckoutOptions extends IInlineCheckoutBaseOptions {}
@@ -1,24 +1,24 @@
1
1
  export interface IPaymentMethodResponse {
2
- count: number;
3
- next: string | null;
4
- previous: string | null;
5
- results: ITonderPaymentMethod[];
2
+ count: number;
3
+ next: string | null;
4
+ previous: string | null;
5
+ results: ITonderPaymentMethod[];
6
6
  }
7
7
 
8
8
  export interface ITonderPaymentMethod {
9
- pk: string;
10
- payment_method: string;
11
- priority: number;
12
- category: string;
13
- unavailable_countries: string[];
14
- status: string;
9
+ pk: string;
10
+ payment_method: string;
11
+ priority: number;
12
+ category: string;
13
+ unavailable_countries: string[];
14
+ status: string;
15
15
  }
16
16
 
17
17
  export interface IPaymentMethod {
18
- id: string;
19
- payment_method: string;
20
- priority: number;
21
- category: string;
22
- icon: string;
23
- label: string;
24
- }
18
+ id: string;
19
+ payment_method: string;
20
+ priority: number;
21
+ category: string;
22
+ icon: string;
23
+ label: string;
24
+ }