@tonder.io/ionic-lite-sdk 0.0.35-beta.8 → 0.0.36-beta.1

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 (87) hide show
  1. package/.gitlab-ci.yml +28 -28
  2. package/README.md +221 -202
  3. package/dist/classes/errorResponse.d.ts +1 -1
  4. package/dist/classes/liteCheckout.d.ts +32 -56
  5. package/dist/data/api.d.ts +1 -1
  6. package/dist/helpers/utils.d.ts +4 -8
  7. package/dist/index.d.ts +1 -2
  8. package/dist/index.js +1 -1
  9. package/dist/types/commons.d.ts +0 -37
  10. package/dist/types/requests.d.ts +3 -12
  11. package/dist/types/responses.d.ts +3 -0
  12. package/jest.config.ts +14 -14
  13. package/package.json +38 -38
  14. package/rollup.config.js +16 -16
  15. package/src/classes/3dsHandler.ts +237 -237
  16. package/src/classes/errorResponse.ts +16 -16
  17. package/src/classes/liteCheckout.ts +575 -598
  18. package/src/data/api.ts +20 -20
  19. package/src/helpers/constants.ts +63 -63
  20. package/src/helpers/mercadopago.ts +15 -15
  21. package/src/helpers/utils.ts +320 -120
  22. package/src/index.ts +4 -10
  23. package/src/types/commons.ts +83 -125
  24. package/src/types/requests.ts +105 -114
  25. package/src/types/responses.ts +193 -189
  26. package/src/types/skyflow.ts +17 -17
  27. package/tests/classes/liteCheckout.test.ts +57 -57
  28. package/tests/methods/createOrder.test.ts +142 -142
  29. package/tests/methods/createPayment.test.ts +122 -122
  30. package/tests/methods/customerRegister.test.ts +119 -119
  31. package/tests/methods/getBusiness.test.ts +115 -115
  32. package/tests/methods/getCustomerCards.test.ts +119 -113
  33. package/tests/methods/getOpenpayDeviceSessionID.test.ts +95 -0
  34. package/tests/methods/getSkyflowToken.test.ts +155 -0
  35. package/tests/methods/getVaultToken.test.ts +107 -0
  36. package/tests/methods/registerCustomerCard.test.ts +117 -117
  37. package/tests/methods/startCheckoutRouter.test.ts +119 -119
  38. package/tests/methods/startCheckoutRouterFull.test.ts +138 -138
  39. package/tests/utils/defaultMock.ts +20 -21
  40. package/tests/utils/mockClasses.ts +656 -659
  41. package/tsconfig.json +18 -18
  42. package/.idea/aws.xml +0 -17
  43. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  44. package/.idea/prettier.xml +0 -6
  45. package/.idea/vcs.xml +0 -6
  46. package/.idea/workspace.xml +0 -133
  47. package/dist/classes/BaseInlineCheckout.d.ts +0 -45
  48. package/dist/data/businessApi.d.ts +0 -2
  49. package/dist/data/cardApi.d.ts +0 -4
  50. package/dist/data/checkoutApi.d.ts +0 -4
  51. package/dist/data/customerApi.d.ts +0 -2
  52. package/dist/data/openPayApi.d.ts +0 -1
  53. package/dist/data/paymentMethodApi.d.ts +0 -5
  54. package/dist/data/skyflowApi.d.ts +0 -1
  55. package/dist/helpers/skyflow.d.ts +0 -3
  56. package/dist/helpers/validations.d.ts +0 -6
  57. package/dist/shared/catalog/paymentMethodsCatalog.d.ts +0 -1
  58. package/dist/shared/constants/messages.d.ts +0 -11
  59. package/dist/shared/constants/paymentMethodAPM.d.ts +0 -62
  60. package/dist/shared/constants/tonderUrl.d.ts +0 -7
  61. package/dist/types/card.d.ts +0 -29
  62. package/dist/types/checkout.d.ts +0 -103
  63. package/dist/types/customer.d.ts +0 -12
  64. package/dist/types/paymentMethod.d.ts +0 -22
  65. package/dist/types/transaction.d.ts +0 -101
  66. package/src/classes/BaseInlineCheckout.ts +0 -356
  67. package/src/data/businessApi.ts +0 -18
  68. package/src/data/cardApi.ts +0 -89
  69. package/src/data/checkoutApi.ts +0 -87
  70. package/src/data/customerApi.ts +0 -31
  71. package/src/data/openPayApi.ts +0 -12
  72. package/src/data/paymentMethodApi.ts +0 -37
  73. package/src/data/skyflowApi.ts +0 -20
  74. package/src/helpers/skyflow.ts +0 -91
  75. package/src/helpers/validations.ts +0 -55
  76. package/src/shared/catalog/paymentMethodsCatalog.ts +0 -248
  77. package/src/shared/constants/messages.ts +0 -11
  78. package/src/shared/constants/paymentMethodAPM.ts +0 -63
  79. package/src/shared/constants/tonderUrl.ts +0 -8
  80. package/src/types/card.ts +0 -34
  81. package/src/types/checkout.ts +0 -118
  82. package/src/types/customer.ts +0 -12
  83. package/src/types/index.d.ts +0 -10
  84. package/src/types/liteInlineCheckout.d.ts +0 -191
  85. package/src/types/paymentMethod.ts +0 -24
  86. package/src/types/transaction.ts +0 -101
  87. package/src/types/validations.d.ts +0 -11
package/tsconfig.json CHANGED
@@ -1,19 +1,19 @@
1
- {
2
- "compilerOptions": {
3
-
4
- /* Language and Environment */
5
- "target": "es2015", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
6
-
7
- /* Modules */
8
- "module": "esnext", /* Specify what module code is generated. */
9
- "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
10
- /* Emit */
11
- "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
12
- "outDir": "./dist", /* Specify an output folder for all emitted files. */
13
- "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
14
- "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
15
- /* Type Checking */
16
- "strict": true,
17
- "skipLibCheck": true /* Skip type checking all .d.ts files. */
18
- }
1
+ {
2
+ "compilerOptions": {
3
+
4
+ /* Language and Environment */
5
+ "target": "es2015", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
6
+
7
+ /* Modules */
8
+ "module": "esnext", /* Specify what module code is generated. */
9
+ "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
10
+ /* Emit */
11
+ "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
12
+ "outDir": "./dist", /* Specify an output folder for all emitted files. */
13
+ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
14
+ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
15
+ /* Type Checking */
16
+ "strict": true,
17
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
18
+ }
19
19
  }
package/.idea/aws.xml DELETED
@@ -1,17 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="accountSettings">
4
- <option name="activeProfile" value="profile:default" />
5
- <option name="activeRegion" value="us-east-1" />
6
- <option name="recentlyUsedProfiles">
7
- <list>
8
- <option value="profile:default" />
9
- </list>
10
- </option>
11
- <option name="recentlyUsedRegions">
12
- <list>
13
- <option value="us-east-1" />
14
- </list>
15
- </option>
16
- </component>
17
- </project>
@@ -1,6 +0,0 @@
1
- <component name="InspectionProjectProfileManager">
2
- <profile version="1.0">
3
- <option name="myName" value="Project Default" />
4
- <inspection_tool class="TsLint" enabled="true" level="WARNING" enabled_by_default="true" />
5
- </profile>
6
- </component>
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="PrettierConfiguration">
4
- <option name="myConfigurationMode" value="AUTOMATIC" />
5
- </component>
6
- </project>
package/.idea/vcs.xml DELETED
@@ -1,6 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="VcsDirectoryMappings">
4
- <mapping directory="" vcs="Git" />
5
- </component>
6
- </project>
@@ -1,133 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project version="4">
3
- <component name="AutoImportSettings">
4
- <option name="autoReloadType" value="SELECTIVE" />
5
- </component>
6
- <component name="ChangeListManager">
7
- <list default="true" id="49ce0c58-6ae2-4b0a-9ac0-48692c69c15e" name="Changes" comment="">
8
- <change afterPath="$PROJECT_DIR$/.idea/aws.xml" afterDir="false" />
9
- <change afterPath="$PROJECT_DIR$/.idea/inspectionProfiles/Project_Default.xml" afterDir="false" />
10
- <change afterPath="$PROJECT_DIR$/.idea/prettier.xml" afterDir="false" />
11
- <change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
12
- <change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
13
- <change afterPath="$PROJECT_DIR$/src/classes/BaseInlineCheckout.ts" afterDir="false" />
14
- <change afterPath="$PROJECT_DIR$/src/data/businessApi.ts" afterDir="false" />
15
- <change afterPath="$PROJECT_DIR$/src/data/cardApi.ts" afterDir="false" />
16
- <change afterPath="$PROJECT_DIR$/src/data/checkoutApi.ts" afterDir="false" />
17
- <change afterPath="$PROJECT_DIR$/src/data/customerApi.ts" afterDir="false" />
18
- <change afterPath="$PROJECT_DIR$/src/data/openPayApi.ts" afterDir="false" />
19
- <change afterPath="$PROJECT_DIR$/src/data/paymentMethodApi.ts" afterDir="false" />
20
- <change afterPath="$PROJECT_DIR$/src/data/skyflowApi.ts" afterDir="false" />
21
- <change afterPath="$PROJECT_DIR$/src/helpers/skyflow.ts" afterDir="false" />
22
- <change afterPath="$PROJECT_DIR$/src/helpers/validations.ts" afterDir="false" />
23
- <change afterPath="$PROJECT_DIR$/src/shared/catalog/paymentMethodsCatalog.ts" afterDir="false" />
24
- <change afterPath="$PROJECT_DIR$/src/shared/constants/messages.ts" afterDir="false" />
25
- <change afterPath="$PROJECT_DIR$/src/shared/constants/paymentMethodAPM.ts" afterDir="false" />
26
- <change afterPath="$PROJECT_DIR$/src/shared/constants/tonderUrl.ts" afterDir="false" />
27
- <change afterPath="$PROJECT_DIR$/src/types/transaction.ts" afterDir="false" />
28
- <change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" />
29
- <change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
30
- <change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
31
- <change beforePath="$PROJECT_DIR$/src/classes/errorResponse.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/classes/errorResponse.ts" afterDir="false" />
32
- <change beforePath="$PROJECT_DIR$/src/classes/liteCheckout.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/classes/liteCheckout.ts" afterDir="false" />
33
- <change beforePath="$PROJECT_DIR$/src/helpers/mercadopago.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/helpers/mercadopago.ts" afterDir="false" />
34
- <change beforePath="$PROJECT_DIR$/src/helpers/utils.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/helpers/utils.ts" afterDir="false" />
35
- <change beforePath="$PROJECT_DIR$/src/index.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/index.ts" afterDir="false" />
36
- <change beforePath="$PROJECT_DIR$/src/types/commons.ts" beforeDir="false" />
37
- <change beforePath="$PROJECT_DIR$/src/types/requests.ts" beforeDir="false" />
38
- <change beforePath="$PROJECT_DIR$/src/types/responses.ts" beforeDir="false" />
39
- <change beforePath="$PROJECT_DIR$/src/types/skyflow.ts" beforeDir="false" />
40
- <change beforePath="$PROJECT_DIR$/tests/classes/liteCheckout.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/tests/classes/liteCheckout.test.ts" afterDir="false" />
41
- <change beforePath="$PROJECT_DIR$/tests/methods/getBusiness.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/tests/methods/getBusiness.test.ts" afterDir="false" />
42
- <change beforePath="$PROJECT_DIR$/tests/methods/getCustomerCards.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/tests/methods/getCustomerCards.test.ts" afterDir="false" />
43
- <change beforePath="$PROJECT_DIR$/tests/methods/getOpenpayDeviceSessionID.test.ts" beforeDir="false" />
44
- <change beforePath="$PROJECT_DIR$/tests/methods/getSkyflowToken.test.ts" beforeDir="false" />
45
- <change beforePath="$PROJECT_DIR$/tests/methods/getVaultToken.test.ts" beforeDir="false" />
46
- <change beforePath="$PROJECT_DIR$/tests/utils/defaultMock.ts" beforeDir="false" afterPath="$PROJECT_DIR$/tests/utils/defaultMock.ts" afterDir="false" />
47
- <change beforePath="$PROJECT_DIR$/tests/utils/mockClasses.ts" beforeDir="false" afterPath="$PROJECT_DIR$/tests/utils/mockClasses.ts" afterDir="false" />
48
- </list>
49
- <option name="SHOW_DIALOG" value="false" />
50
- <option name="HIGHLIGHT_CONFLICTS" value="true" />
51
- <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
52
- <option name="LAST_RESOLUTION" value="IGNORE" />
53
- </component>
54
- <component name="Git.Settings">
55
- <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
56
- </component>
57
- <component name="MarkdownSettingsMigration">
58
- <option name="stateVersion" value="1" />
59
- </component>
60
- <component name="ProjectColorInfo">{
61
- &quot;customColor&quot;: &quot;&quot;,
62
- &quot;associatedIndex&quot;: 1
63
- }</component>
64
- <component name="ProjectId" id="2lFWiEUFmmZczyeFIMfy8VbaFup" />
65
- <component name="ProjectViewState">
66
- <option name="autoscrollFromSource" value="true" />
67
- <option name="autoscrollToSource" value="true" />
68
- <option name="hideEmptyMiddlePackages" value="true" />
69
- <option name="showLibraryContents" value="true" />
70
- </component>
71
- <component name="PropertiesComponent"><![CDATA[{
72
- "keyToString": {
73
- "RunOnceActivity.OpenProjectViewOnStart": "true",
74
- "RunOnceActivity.ShowReadmeOnStart": "true",
75
- "git-widget-placeholder": "main",
76
- "node.js.detected.package.eslint": "true",
77
- "node.js.detected.package.tslint": "true",
78
- "node.js.selected.package.eslint": "(autodetect)",
79
- "node.js.selected.package.tslint": "(autodetect)",
80
- "nodejs_package_manager_path": "npm",
81
- "prettierjs.PrettierConfiguration.Package": "/Users/davidhernandezalmagro/.nvm/versions/node/v21.2.0/lib/node_modules/prettier",
82
- "settings.editor.selected.configurable": "settings.javascript.prettier",
83
- "ts.external.directory.path": "/Users/davidhernandezalmagro/Desktop/Tonder/ionic-lite/node_modules/typescript/lib",
84
- "vue.rearranger.settings.migration": "true"
85
- }
86
- }]]></component>
87
- <component name="RecentsManager">
88
- <key name="MoveFile.RECENT_KEYS">
89
- <recent name="$PROJECT_DIR$/src" />
90
- <recent name="$PROJECT_DIR$" />
91
- </key>
92
- </component>
93
- <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
94
- <component name="TaskManager">
95
- <task active="true" id="Default" summary="Default task">
96
- <changelist id="49ce0c58-6ae2-4b0a-9ac0-48692c69c15e" name="Changes" comment="" />
97
- <created>1724776429568</created>
98
- <option name="number" value="Default" />
99
- <option name="presentableId" value="Default" />
100
- <updated>1724776429568</updated>
101
- <workItem from="1724776430626" duration="1847000" />
102
- <workItem from="1724790840744" duration="239000" />
103
- <workItem from="1725305433705" duration="19644000" />
104
- </task>
105
- <servers />
106
- </component>
107
- <component name="TypeScriptGeneratedFilesManager">
108
- <option name="version" value="3" />
109
- </component>
110
- <component name="Vcs.Log.Tabs.Properties">
111
- <option name="TAB_STATES">
112
- <map>
113
- <entry key="MAIN">
114
- <value>
115
- <State />
116
- </value>
117
- </entry>
118
- </map>
119
- </option>
120
- </component>
121
- <component name="XDebuggerManager">
122
- <breakpoint-manager>
123
- <breakpoints>
124
- <line-breakpoint enabled="true" type="javascript">
125
- <url>file://$PROJECT_DIR$/src/classes/liteCheckout.ts</url>
126
- <line>216</line>
127
- <properties lambdaOrdinal="-1" />
128
- <option name="timeStamp" value="16" />
129
- </line-breakpoint>
130
- </breakpoints>
131
- </breakpoint-manager>
132
- </component>
133
- </project>
@@ -1,45 +0,0 @@
1
- import { ThreeDSHandler } from "./3dsHandler";
2
- import { ErrorResponse } from "./errorResponse";
3
- import { Business, ICustomer, IItem, IInlineCheckoutBaseOptions, IConfigureCheckout, IProcessPaymentRequest, IStartCheckoutResponse, StartCheckoutResponse } from "../types";
4
- export declare class BaseInlineCheckout {
5
- #private;
6
- baseUrl: string;
7
- cartTotal: string;
8
- process3ds: ThreeDSHandler;
9
- mode?: "production" | "sandbox" | "stage" | "development" | undefined;
10
- apiKeyTonder: string;
11
- returnUrl: string;
12
- callBack?: ((response: any) => void) | undefined;
13
- merchantData?: Business;
14
- abortController: AbortController;
15
- firstName?: string;
16
- lastName?: string;
17
- country?: string;
18
- address?: string;
19
- city?: string;
20
- state?: string;
21
- postCode?: string;
22
- email?: string;
23
- phone?: string;
24
- customer?: ICustomer;
25
- cartItems?: IItem[];
26
- metadata: {};
27
- card?: {} | undefined;
28
- currency?: string;
29
- constructor({ mode, apiKey, apiKeyTonder, returnUrl, callBack, }: IInlineCheckoutBaseOptions);
30
- configureCheckout(data: IConfigureCheckout): void;
31
- verify3dsTransaction(): Promise<false | ErrorResponse | StartCheckoutResponse | undefined>;
32
- payment(data: IProcessPaymentRequest): Promise<IStartCheckoutResponse>;
33
- _initializeCheckout(): Promise<void>;
34
- _checkout(data: any): Promise<any>;
35
- _setCartTotal(total: string | number): void;
36
- _getCustomer(signal?: AbortSignal | null): Promise<Record<string, any>>;
37
- _handleCheckout({ card, payment_method, customer, isSandbox, }: {
38
- card?: string;
39
- payment_method?: string;
40
- customer: Record<string, any>;
41
- isSandbox?: boolean;
42
- }): Promise<any>;
43
- _fetchMerchantData(): Promise<Business | undefined>;
44
- _handle3dsRedirect(response: ErrorResponse | StartCheckoutResponse | false | undefined): Promise<false | ErrorResponse | StartCheckoutResponse | undefined>;
45
- }
@@ -1,2 +0,0 @@
1
- import { GetBusinessResponse } from "../types";
2
- export declare function fetchBusiness(baseUrl: string, apiKey: string, signal: AbortSignal): Promise<GetBusinessResponse>;
@@ -1,4 +0,0 @@
1
- import { ICustomerCardsResponse, ISaveCardResponse, ISaveCardSkyflowRequest } from "../types";
2
- export declare function fetchCustomerCards(baseUrl: string, customerToken: string, businessId: string | number, signal?: null): Promise<ICustomerCardsResponse>;
3
- export declare function saveCustomerCard(baseUrl: string, customerToken: string, businessId: string | number, data: ISaveCardSkyflowRequest): Promise<ISaveCardResponse>;
4
- export declare function removeCustomerCard(baseUrl: string, customerToken: string, skyflowId: string | undefined, businessId: string | number): Promise<string>;
@@ -1,4 +0,0 @@
1
- import { CreateOrderRequest, CreatePaymentRequest, IStartCheckoutIdRequest, IStartCheckoutRequest } from "../types";
2
- export declare function createOrder(baseUrl: string, apiKey: string, orderItems: CreateOrderRequest): Promise<any>;
3
- export declare function createPayment(baseUrl: string, apiKey: string, paymentItems: CreatePaymentRequest): Promise<any>;
4
- export declare function startCheckoutRouter(baseUrl: string, apiKey: string, routerItems: IStartCheckoutRequest | IStartCheckoutIdRequest): Promise<any>;
@@ -1,2 +0,0 @@
1
- import { CustomerRegisterResponse } from "../types";
2
- export declare function registerOrFetchCustomer(baseUrl: string, apiKey: string, customer: Record<string, any>, signal?: AbortSignal | null): Promise<CustomerRegisterResponse>;
@@ -1 +0,0 @@
1
- export declare function getOpenpayDeviceSessionID(merchant_id: string, public_key: string, isSandbox?: boolean, signal?: AbortSignal | null): Promise<string>;
@@ -1,5 +0,0 @@
1
- import { IPaymentMethodResponse } from "../types";
2
- export declare function fetchCustomerAPMs(baseUrl: string, apiKey: string, params?: {
3
- status: string;
4
- pagesize: string;
5
- }, signal?: null): Promise<IPaymentMethodResponse>;
@@ -1 +0,0 @@
1
- export declare function getVaultToken(baseUrl: string, apiKey: string, signal?: null): Promise<any>;
@@ -1,3 +0,0 @@
1
- import { ErrorResponse } from "../classes/errorResponse";
2
- import { TokensSkyflowRequest } from "../types";
3
- export declare function getSkyflowTokens({ baseUrl, apiKey, vault_id, vault_url, data, }: TokensSkyflowRequest): Promise<any | ErrorResponse>;
@@ -1,6 +0,0 @@
1
- export declare function validateCardNumber(cardNumber: string): boolean;
2
- export declare function validateCardholderName(name: string): boolean;
3
- export declare function validateCVV(cvv: string): boolean;
4
- export declare function validateExpirationDate(expirationDate: string): boolean;
5
- export declare function validateExpirationMonth(month: string): boolean;
6
- export declare function validateExpirationYear(year: string): boolean;
@@ -1 +0,0 @@
1
- export declare const getPaymentMethodDetails: (scheme_data: string) => any;
@@ -1,11 +0,0 @@
1
- export declare const MESSAGES: Readonly<{
2
- saveCardError: "Ha ocurrido un error guardando la tarjeta. Inténtalo nuevamente.";
3
- removeCardError: "Ha ocurrido un error eliminado la tarjeta. Inténtalo nuevamente.";
4
- getCardsError: "Ha ocurrido un error obteniendo las tarjetas del customer. Inténtalo nuevamente.";
5
- cardExist: "La tarjeta fue registrada previamente.";
6
- removedCard: "Card deleted successfully";
7
- errorCheckout: "No se ha podido procesar el pago";
8
- cardSaved: "Tarjeta registrada con éxito.";
9
- getPaymentMethodsError: "Ha ocurrido un error obteniendo las métodos de pago del customer. Inténtalo nuevamente.";
10
- getBusinessError: "Ha ocurrido un error obteniendo los datos del comercio. Inténtalo nuevamente.";
11
- }>;
@@ -1,62 +0,0 @@
1
- declare const PAYMENT_METHOD_APM: Readonly<{
2
- SORIANA: "SORIANA";
3
- OXXO: "OXXO";
4
- SPEI: "SPEI";
5
- CODI: "CODI";
6
- MERCADOPAGO: "MERCADOPAGO";
7
- PAYPAL: "PAYPAL";
8
- COMERCIALMEXICANA: "COMERCIALMEXICANA";
9
- BANCOMER: "BANCOMER";
10
- WALMART: "WALMART";
11
- BODEGA: "BODEGA";
12
- SAMSCLUB: "SAMSCLUB";
13
- SUPERAMA: "SUPERAMA";
14
- CALIMAX: "CALIMAX";
15
- EXTRA: "EXTRA";
16
- CIRCULOK: "CIRCULOK";
17
- SEVEN11: "7ELEVEN";
18
- TELECOMM: "TELECOMM";
19
- BANORTE: "BANORTE";
20
- BENAVIDES: "BENAVIDES";
21
- DELAHORRO: "DELAHORRO";
22
- ELASTURIANO: "ELASTURIANO";
23
- WALDOS: "WALDOS";
24
- ALSUPER: "ALSUPER";
25
- KIOSKO: "KIOSKO";
26
- STAMARIA: "STAMARIA";
27
- LAMASBARATA: "LAMASBARATA";
28
- FARMROMA: "FARMROMA";
29
- FARMUNION: "FARMUNION";
30
- FARMATODO: "FARMATODO";
31
- SFDEASIS: "SFDEASIS";
32
- FARM911: "FARM911";
33
- FARMECONOMICAS: "FARMECONOMICAS";
34
- FARMMEDICITY: "FARMMEDICITY";
35
- RIANXEIRA: "RIANXEIRA";
36
- WESTERNUNION: "WESTERNUNION";
37
- ZONAPAGO: "ZONAPAGO";
38
- CAJALOSANDES: "CAJALOSANDES";
39
- CAJAPAITA: "CAJAPAITA";
40
- CAJASANTA: "CAJASANTA";
41
- CAJASULLANA: "CAJASULLANA";
42
- CAJATRUJILLO: "CAJATRUJILLO";
43
- EDPYME: "EDPYME";
44
- KASNET: "KASNET";
45
- NORANDINO: "NORANDINO";
46
- QAPAQ: "QAPAQ";
47
- RAIZ: "RAIZ";
48
- PAYSER: "PAYSER";
49
- WUNION: "WUNION";
50
- BANCOCONTINENTAL: "BANCOCONTINENTAL";
51
- GMONEY: "GMONEY";
52
- GOPAY: "GOPAY";
53
- WU: "WU";
54
- PUNTOSHEY: "PUNTOSHEY";
55
- AMPM: "AMPM";
56
- JUMBOMARKET: "JUMBOMARKET";
57
- SMELPUEBLO: "SMELPUEBLO";
58
- BAM: "BAM";
59
- REFACIL: "REFACIL";
60
- ACYVALORES: "ACYVALORES";
61
- }>;
62
- export { PAYMENT_METHOD_APM };
@@ -1,7 +0,0 @@
1
- declare const TONDER_URL_BY_MODE: Readonly<{
2
- production: "https://app.tonder.io";
3
- sandbox: "https://sandbox.tonder.io";
4
- stage: "https://stage.tonder.io";
5
- development: "http://localhost:8000";
6
- }>;
7
- export { TONDER_URL_BY_MODE };
@@ -1,29 +0,0 @@
1
- export interface ICard {
2
- fields: ICardSkyflowFields;
3
- icon?: string;
4
- }
5
- export interface ICardSkyflowFields {
6
- card_number: string;
7
- expiration_month: string;
8
- expiration_year: string;
9
- skyflow_id: string;
10
- card_scheme: string;
11
- }
12
- export interface ICustomerCardsResponse {
13
- user_id: number;
14
- cards: ICard[];
15
- }
16
- export interface ISaveCardResponse {
17
- skyflow_id: string;
18
- user_id: number;
19
- }
20
- export interface ISaveCardSkyflowRequest {
21
- skyflow_id: string;
22
- }
23
- export interface ISaveCardRequest {
24
- card_number: string;
25
- cvv: string;
26
- expiration_month: string;
27
- expiration_year: string;
28
- cardholder_name: string;
29
- }
@@ -1,103 +0,0 @@
1
- import { ICustomer } from "./customer";
2
- export interface IStartCheckoutRequestBase {
3
- name: any;
4
- last_name: string;
5
- email_client: any;
6
- phone_number: any;
7
- return_url?: string;
8
- id_product: string;
9
- quantity_product: number;
10
- id_ship: string;
11
- instance_id_ship: string;
12
- amount: any;
13
- title_ship: string;
14
- description: string;
15
- device_session_id: any;
16
- token_id: string;
17
- order_id: any;
18
- business_id: any;
19
- payment_id: any;
20
- source: string;
21
- browser_info?: any;
22
- metadata: any;
23
- currency: string;
24
- }
25
- export type IStartCheckoutRequestWithCard = IStartCheckoutRequestBase & {
26
- card: any;
27
- payment_method?: never;
28
- };
29
- export type IStartCheckoutRequestWithPaymentMethod = IStartCheckoutRequestBase & {
30
- card?: never;
31
- payment_method: string;
32
- };
33
- export type IStartCheckoutRequest = IStartCheckoutRequestWithCard | IStartCheckoutRequestWithPaymentMethod;
34
- export interface IStartCheckoutIdRequest {
35
- checkout_id: string;
36
- }
37
- export interface IStartCheckoutErrorResponse {
38
- status: string;
39
- message: string;
40
- psp_response: [
41
- {
42
- status: number;
43
- response: Object;
44
- }
45
- ];
46
- checkout_id: string;
47
- is_route_finished: boolean;
48
- }
49
- export interface IStartCheckoutResponse {
50
- status: string;
51
- message: string;
52
- psp_response: Record<string, any>;
53
- checkout_id: string;
54
- is_route_finished: Boolean;
55
- transaction_status: string;
56
- transaction_id: number;
57
- payment_id: number;
58
- provider: string;
59
- next_action: {
60
- redirect_to_url: {
61
- url: string;
62
- return_url: string;
63
- verify_transaction_status_url: string;
64
- };
65
- iframe_resources?: {
66
- iframe: string;
67
- };
68
- };
69
- actions: IStartCheckoutActionResponse[];
70
- }
71
- export interface IStartCheckoutActionResponse {
72
- name: string;
73
- url: string;
74
- method: string;
75
- }
76
- export interface IItem {
77
- description: string;
78
- quantity: number;
79
- price_unit: number;
80
- discount: number;
81
- taxes: number;
82
- product_reference: string | number;
83
- name: string;
84
- amount_total: number;
85
- }
86
- export interface IProcessPaymentRequest {
87
- customer: ICustomer;
88
- cart: {
89
- total: string | number;
90
- items: IItem[];
91
- };
92
- metadata?: Record<string, any>;
93
- currency?: string;
94
- payment_method?: string;
95
- card?: ICardFields | string;
96
- }
97
- export interface ICardFields {
98
- card_number: string;
99
- cvv: string;
100
- expiration_month: string;
101
- expiration_year: string;
102
- cardholder_name: string;
103
- }
@@ -1,12 +0,0 @@
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;
12
- };
@@ -1,22 +0,0 @@
1
- export interface IPaymentMethodResponse {
2
- count: number;
3
- next: string | null;
4
- previous: string | null;
5
- results: ITonderPaymentMethod[];
6
- }
7
- export interface ITonderPaymentMethod {
8
- pk: string;
9
- payment_method: string;
10
- priority: number;
11
- category: string;
12
- unavailable_countries: string[];
13
- status: string;
14
- }
15
- export interface IPaymentMethod {
16
- id: string;
17
- payment_method: string;
18
- priority: number;
19
- category: string;
20
- icon: string;
21
- label: string;
22
- }