@tonder.io/ionic-lite-sdk 0.0.35-beta.24 → 0.0.35-beta.26
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/README.md +35 -15
- package/package.json +1 -1
- package/.idea/aws.xml +0 -17
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/prettier.xml +0 -6
- package/.idea/vcs.xml +0 -6
- package/.idea/workspace.xml +0 -144
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Tonder SDK helps to integrate the services Tonder offers in your own mobile app
|
|
|
8
8
|
1. [Installation](#installation)
|
|
9
9
|
2. [Usage](#usage)
|
|
10
10
|
3. [Configuration Options](#configuration-options)
|
|
11
|
-
4. [
|
|
11
|
+
4. [Mobile Settings](#mobile-settings)
|
|
12
12
|
5. [Payment Data Structure](#payment-data-structure)
|
|
13
13
|
6. [Field Validation Functions](#field-validation-functions)
|
|
14
14
|
7. [API Reference](#api-reference)
|
|
@@ -33,11 +33,11 @@ Add dependencies to the root of the app (index.html)
|
|
|
33
33
|
|
|
34
34
|
## Usage
|
|
35
35
|
LiteCheckout allows you to build a custom checkout interface using Tonder's core functionality
|
|
36
|
-
|
|
36
|
+
### Import LiteCheckout class
|
|
37
37
|
```javascript
|
|
38
38
|
import { LiteCheckout } from "@tonder.io/ionic-lite-sdk"
|
|
39
39
|
```
|
|
40
|
-
|
|
40
|
+
### Create instance
|
|
41
41
|
|
|
42
42
|
```javascript
|
|
43
43
|
const liteCheckout = new LiteCheckout({
|
|
@@ -97,6 +97,23 @@ const paymentResponse = await liteCheckout.payment(paymentData);
|
|
|
97
97
|
| returnUrl | string | URL where the checkout form is mounted (used for 3DS) |
|
|
98
98
|
| callBack | function | Callback function to be invoked after the payment process ends successfully. |
|
|
99
99
|
|
|
100
|
+
## Mobile settings
|
|
101
|
+
|
|
102
|
+
<font size="3">If you are deploying to Android, edit your AndroidManifest.xml file to add the Internet permission.</font>
|
|
103
|
+
|
|
104
|
+
```xml
|
|
105
|
+
<!-- Required to fetch data from the internet. -->
|
|
106
|
+
<uses-permission android:name="android.permission.INTERNET" />
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
<font size="3">Likewise, if you are deploying to macOS, edit your macos/Runner/DebugProfile.entitlements and macos/Runner/Release.entitlements files to include the network client entitlement.</font>
|
|
110
|
+
|
|
111
|
+
```xml
|
|
112
|
+
<!-- Required to fetch data from the internet. -->
|
|
113
|
+
<key>com.apple.security.network.client</key>
|
|
114
|
+
<true>
|
|
115
|
+
```
|
|
116
|
+
|
|
100
117
|
## Payment Data Structure
|
|
101
118
|
|
|
102
119
|
When calling the `payment` method, use the following data structure:
|
|
@@ -235,12 +252,13 @@ For Angular, we recommend using a service to manage the Tonder instance:
|
|
|
235
252
|
// tonder.service.ts
|
|
236
253
|
import { Injectable } from "@angular/core";
|
|
237
254
|
import { LiteCheckout } from "@tonder.io/ionic-lite-sdk";
|
|
255
|
+
import {ILiteCheckout} from "@tonder.io/ionic-lite-sdk/dist/types/liteInlineCheckout";
|
|
238
256
|
|
|
239
257
|
@Injectable({
|
|
240
258
|
providedIn: "root",
|
|
241
259
|
})
|
|
242
260
|
export class TonderService {
|
|
243
|
-
private liteCheckout!:
|
|
261
|
+
private liteCheckout!: ILiteCheckout;
|
|
244
262
|
|
|
245
263
|
constructor(@Inject(Object) private sdkParameters: IInlineLiteCheckoutOptions) {
|
|
246
264
|
this.initializeInlineCheckout();
|
|
@@ -258,7 +276,7 @@ export class TonderService {
|
|
|
258
276
|
await this.liteCheckout.injectCheckout();
|
|
259
277
|
}
|
|
260
278
|
|
|
261
|
-
verify3dsTransaction(): Promise<ITransaction | void> {
|
|
279
|
+
verify3dsTransaction(): Promise<ITransaction | IStartCheckoutResponse | void> {
|
|
262
280
|
return this.liteCheckout.verify3dsTransaction();
|
|
263
281
|
}
|
|
264
282
|
|
|
@@ -334,13 +352,14 @@ import { TonderService } from "./tonder.service";
|
|
|
334
352
|
export class TonderCheckoutComponent implements OnInit, OnDestroy {
|
|
335
353
|
loading = false;
|
|
336
354
|
checkoutData: IProcessPaymentRequest;
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
355
|
+
paymentForm = new FormGroup({
|
|
356
|
+
name: new FormControl('Pedro Paramo'),
|
|
357
|
+
cardNumber: new FormControl('4242424242424242'),
|
|
358
|
+
month: new FormControl('12'),
|
|
359
|
+
expirationYear: new FormControl('28'),
|
|
360
|
+
cvv: new FormControl('123')
|
|
361
|
+
});
|
|
362
|
+
|
|
344
363
|
constructor(private tonderService: TonderService) {
|
|
345
364
|
this.checkoutData = {
|
|
346
365
|
customer: {
|
|
@@ -414,7 +433,7 @@ export class TonderCheckoutComponent implements OnInit, OnDestroy {
|
|
|
414
433
|
|
|
415
434
|
## Deprecated Fields
|
|
416
435
|
|
|
417
|
-
The following
|
|
436
|
+
The following fields have been deprecated and should no longer be used. Consider using the recommended alternatives:
|
|
418
437
|
|
|
419
438
|
### `apiKeyTonder` Property
|
|
420
439
|
|
|
@@ -433,6 +452,8 @@ The following functions and fields have been deprecated and should no longer be
|
|
|
433
452
|
|
|
434
453
|
## Deprecated Functions
|
|
435
454
|
|
|
455
|
+
The following functions have been deprecated and should no longer be used. Consider using the recommended alternatives:
|
|
456
|
+
|
|
436
457
|
### `customerRegister`
|
|
437
458
|
|
|
438
459
|
- **Deprecated Reason:** This function is no longer necessary as registration is now automatically handled during payment processing or when using card management methods.
|
|
@@ -475,8 +496,7 @@ The following functions and fields have been deprecated and should no longer be
|
|
|
475
496
|
|
|
476
497
|
### General
|
|
477
498
|
|
|
478
|
-
- Replace `
|
|
479
|
-
- The `paymentData` should be defined according to your specific requirements.
|
|
499
|
+
- Replace `apiKey`, `mode`, `returnUrl` with your actual values.
|
|
480
500
|
- Remember to use the `configureCheckout` function after creating an instance of `LiteCheckout`. This ensures that functions such as payment processing, saving cards, deleting cards, and others work correctly.
|
|
481
501
|
|
|
482
502
|
### Script Dependencies
|
package/package.json
CHANGED
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>
|
package/.idea/prettier.xml
DELETED
package/.idea/vcs.xml
DELETED
package/.idea/workspace.xml
DELETED
|
@@ -1,144 +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 beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
|
9
|
-
<change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
|
|
10
|
-
<change beforePath="$PROJECT_DIR$/package-lock.json" beforeDir="false" afterPath="$PROJECT_DIR$/package-lock.json" afterDir="false" />
|
|
11
|
-
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
|
12
|
-
<change beforePath="$PROJECT_DIR$/src/classes/BaseInlineCheckout.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/classes/BaseInlineCheckout.ts" afterDir="false" />
|
|
13
|
-
<change beforePath="$PROJECT_DIR$/src/classes/errorResponse.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/classes/errorResponse.ts" afterDir="false" />
|
|
14
|
-
<change beforePath="$PROJECT_DIR$/src/classes/liteCheckout.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/classes/liteCheckout.ts" afterDir="false" />
|
|
15
|
-
<change beforePath="$PROJECT_DIR$/src/data/businessApi.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/data/businessApi.ts" afterDir="false" />
|
|
16
|
-
<change beforePath="$PROJECT_DIR$/src/data/cardApi.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/data/cardApi.ts" afterDir="false" />
|
|
17
|
-
<change beforePath="$PROJECT_DIR$/src/data/checkoutApi.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/data/checkoutApi.ts" afterDir="false" />
|
|
18
|
-
<change beforePath="$PROJECT_DIR$/src/data/customerApi.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/data/customerApi.ts" afterDir="false" />
|
|
19
|
-
<change beforePath="$PROJECT_DIR$/src/data/paymentMethodApi.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/data/paymentMethodApi.ts" afterDir="false" />
|
|
20
|
-
<change beforePath="$PROJECT_DIR$/src/helpers/skyflow.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/helpers/skyflow.ts" afterDir="false" />
|
|
21
|
-
<change beforePath="$PROJECT_DIR$/src/helpers/utils.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/helpers/utils.ts" afterDir="false" />
|
|
22
|
-
<change beforePath="$PROJECT_DIR$/src/index.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/index.ts" afterDir="false" />
|
|
23
|
-
<change beforePath="$PROJECT_DIR$/src/types/card.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/types/card.ts" afterDir="false" />
|
|
24
|
-
<change beforePath="$PROJECT_DIR$/src/types/checkout.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/types/checkout.ts" afterDir="false" />
|
|
25
|
-
<change beforePath="$PROJECT_DIR$/src/types/commons.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/types/commons.ts" afterDir="false" />
|
|
26
|
-
<change beforePath="$PROJECT_DIR$/src/types/index.d.ts" beforeDir="false" />
|
|
27
|
-
<change beforePath="$PROJECT_DIR$/src/types/liteInlineCheckout.d.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/types/liteInlineCheckout.ts" afterDir="false" />
|
|
28
|
-
<change beforePath="$PROJECT_DIR$/tests/classes/liteCheckout.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/tests/classes/liteCheckout.test.ts" afterDir="false" />
|
|
29
|
-
<change beforePath="$PROJECT_DIR$/tests/methods/createOrder.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/tests/methods/createOrder.test.ts" afterDir="false" />
|
|
30
|
-
<change beforePath="$PROJECT_DIR$/tests/methods/createPayment.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/tests/methods/createPayment.test.ts" afterDir="false" />
|
|
31
|
-
<change beforePath="$PROJECT_DIR$/tests/methods/customerRegister.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/tests/methods/customerRegister.test.ts" afterDir="false" />
|
|
32
|
-
<change beforePath="$PROJECT_DIR$/tests/methods/getBusiness.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/tests/methods/getBusiness.test.ts" afterDir="false" />
|
|
33
|
-
<change beforePath="$PROJECT_DIR$/tests/methods/getCustomerCards.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/tests/methods/getCustomerCards.test.ts" afterDir="false" />
|
|
34
|
-
<change beforePath="$PROJECT_DIR$/tests/methods/registerCustomerCard.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/tests/methods/registerCustomerCard.test.ts" afterDir="false" />
|
|
35
|
-
<change beforePath="$PROJECT_DIR$/tests/methods/startCheckoutRouter.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/tests/methods/startCheckoutRouter.test.ts" afterDir="false" />
|
|
36
|
-
<change beforePath="$PROJECT_DIR$/tests/methods/startCheckoutRouterFull.test.ts" beforeDir="false" afterPath="$PROJECT_DIR$/tests/methods/startCheckoutRouterFull.test.ts" afterDir="false" />
|
|
37
|
-
</list>
|
|
38
|
-
<option name="SHOW_DIALOG" value="false" />
|
|
39
|
-
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
40
|
-
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
41
|
-
<option name="LAST_RESOLUTION" value="IGNORE" />
|
|
42
|
-
</component>
|
|
43
|
-
<component name="Git.Settings">
|
|
44
|
-
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
|
45
|
-
</component>
|
|
46
|
-
<component name="MarkdownSettingsMigration">
|
|
47
|
-
<option name="stateVersion" value="1" />
|
|
48
|
-
</component>
|
|
49
|
-
<component name="ProjectColorInfo">{
|
|
50
|
-
"customColor": "",
|
|
51
|
-
"associatedIndex": 1
|
|
52
|
-
}</component>
|
|
53
|
-
<component name="ProjectId" id="2lFWiEUFmmZczyeFIMfy8VbaFup" />
|
|
54
|
-
<component name="ProjectViewState">
|
|
55
|
-
<option name="autoscrollFromSource" value="true" />
|
|
56
|
-
<option name="autoscrollToSource" value="true" />
|
|
57
|
-
<option name="hideEmptyMiddlePackages" value="true" />
|
|
58
|
-
<option name="showLibraryContents" value="true" />
|
|
59
|
-
</component>
|
|
60
|
-
<component name="PropertiesComponent"><![CDATA[{
|
|
61
|
-
"keyToString": {
|
|
62
|
-
"RunOnceActivity.OpenProjectViewOnStart": "true",
|
|
63
|
-
"RunOnceActivity.ShowReadmeOnStart": "true",
|
|
64
|
-
"git-widget-placeholder": "main",
|
|
65
|
-
"last_opened_file_path": "/Users/davidhernandezalmagro/Desktop/Tonder/ionic-lite/src/types",
|
|
66
|
-
"node.js.detected.package.eslint": "true",
|
|
67
|
-
"node.js.detected.package.tslint": "true",
|
|
68
|
-
"node.js.selected.package.eslint": "(autodetect)",
|
|
69
|
-
"node.js.selected.package.tslint": "(autodetect)",
|
|
70
|
-
"nodejs_package_manager_path": "npm",
|
|
71
|
-
"prettierjs.PrettierConfiguration.Package": "/Users/davidhernandezalmagro/.nvm/versions/node/v21.2.0/lib/node_modules/prettier",
|
|
72
|
-
"settings.editor.selected.configurable": "settings.javascript.prettier",
|
|
73
|
-
"ts.external.directory.path": "/Users/davidhernandezalmagro/Desktop/Tonder/ionic-lite/node_modules/typescript/lib",
|
|
74
|
-
"vue.rearranger.settings.migration": "true"
|
|
75
|
-
}
|
|
76
|
-
}]]></component>
|
|
77
|
-
<component name="RecentsManager">
|
|
78
|
-
<key name="CopyFile.RECENT_KEYS">
|
|
79
|
-
<recent name="$PROJECT_DIR$/src/types" />
|
|
80
|
-
</key>
|
|
81
|
-
<key name="MoveFile.RECENT_KEYS">
|
|
82
|
-
<recent name="$PROJECT_DIR$/src" />
|
|
83
|
-
<recent name="$PROJECT_DIR$" />
|
|
84
|
-
</key>
|
|
85
|
-
</component>
|
|
86
|
-
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
|
|
87
|
-
<component name="TaskManager">
|
|
88
|
-
<task active="true" id="Default" summary="Default task">
|
|
89
|
-
<changelist id="49ce0c58-6ae2-4b0a-9ac0-48692c69c15e" name="Changes" comment="" />
|
|
90
|
-
<created>1724776429568</created>
|
|
91
|
-
<option name="number" value="Default" />
|
|
92
|
-
<option name="presentableId" value="Default" />
|
|
93
|
-
<updated>1724776429568</updated>
|
|
94
|
-
<workItem from="1724776430626" duration="1847000" />
|
|
95
|
-
<workItem from="1724790840744" duration="239000" />
|
|
96
|
-
<workItem from="1725305433705" duration="21026000" />
|
|
97
|
-
<workItem from="1725333899382" duration="2939000" />
|
|
98
|
-
<workItem from="1725337022494" duration="3671000" />
|
|
99
|
-
<workItem from="1725378545854" duration="22151000" />
|
|
100
|
-
</task>
|
|
101
|
-
<servers />
|
|
102
|
-
</component>
|
|
103
|
-
<component name="TypeScriptGeneratedFilesManager">
|
|
104
|
-
<option name="version" value="3" />
|
|
105
|
-
</component>
|
|
106
|
-
<component name="Vcs.Log.Tabs.Properties">
|
|
107
|
-
<option name="TAB_STATES">
|
|
108
|
-
<map>
|
|
109
|
-
<entry key="MAIN">
|
|
110
|
-
<value>
|
|
111
|
-
<State />
|
|
112
|
-
</value>
|
|
113
|
-
</entry>
|
|
114
|
-
</map>
|
|
115
|
-
</option>
|
|
116
|
-
</component>
|
|
117
|
-
<component name="XDebuggerManager">
|
|
118
|
-
<breakpoint-manager>
|
|
119
|
-
<breakpoints>
|
|
120
|
-
<line-breakpoint enabled="true" type="javascript">
|
|
121
|
-
<url>file://$PROJECT_DIR$/src/classes/liteCheckout.ts</url>
|
|
122
|
-
<line>218</line>
|
|
123
|
-
<option name="timeStamp" value="16" />
|
|
124
|
-
</line-breakpoint>
|
|
125
|
-
<line-breakpoint enabled="true" type="javascript">
|
|
126
|
-
<url>file://$PROJECT_DIR$/src/types/commons.ts</url>
|
|
127
|
-
<line>107</line>
|
|
128
|
-
<option name="timeStamp" value="17" />
|
|
129
|
-
</line-breakpoint>
|
|
130
|
-
<line-breakpoint enabled="true" type="javascript">
|
|
131
|
-
<url>file://$PROJECT_DIR$/src/classes/liteCheckout.ts</url>
|
|
132
|
-
<line>222</line>
|
|
133
|
-
<option name="timeStamp" value="18" />
|
|
134
|
-
</line-breakpoint>
|
|
135
|
-
<line-breakpoint enabled="true" type="javascript">
|
|
136
|
-
<url>file://$PROJECT_DIR$/src/classes/liteCheckout.ts</url>
|
|
137
|
-
<line>304</line>
|
|
138
|
-
<properties lambdaOrdinal="-1" />
|
|
139
|
-
<option name="timeStamp" value="21" />
|
|
140
|
-
</line-breakpoint>
|
|
141
|
-
</breakpoints>
|
|
142
|
-
</breakpoint-manager>
|
|
143
|
-
</component>
|
|
144
|
-
</project>
|