@tonder.io/ionic-lite-sdk 0.0.63-beta.develop.1711069 → 0.0.64

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 (2) hide show
  1. package/README.md +35 -8
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -8,14 +8,15 @@ 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. [Mobile Settings](#mobile-settings)
12
- 5. [Payment Data Structure](#payment-data-structure)
13
- 6. [Field Validation Functions](#field-validation-functions)
14
- 7. [API Reference](#api-reference)
15
- 8. [Examples](#examples)
16
- 9. [Deprecated Fields](#deprecated-fields)
17
- 10. [Deprecated Functions](#deprecated-functions)
18
- 11. [License](#license)
11
+ 4. [Card On File](#card-on-file)
12
+ 5. [Mobile Settings](#mobile-settings)
13
+ 6. [Payment Data Structure](#payment-data-structure)
14
+ 7. [Field Validation Functions](#field-validation-functions)
15
+ 8. [API Reference](#api-reference)
16
+ 9. [Examples](#examples)
17
+ 10. [Deprecated Fields](#deprecated-fields)
18
+ 11. [Deprecated Functions](#deprecated-functions)
19
+ 12. [License](#license)
19
20
 
20
21
 
21
22
  ## Installation
@@ -97,6 +98,32 @@ const paymentResponse = await liteCheckout.payment(paymentData);
97
98
  | returnrl | string | URL where the checkout form is mounted (used for 3DS) |
98
99
  | callBack | function | Callback function to be invoked after the payment process ends successfully. |
99
100
 
101
+ ## Card On File
102
+
103
+ Card On File is applied automatically when enabled for your merchant account. No extra SDK configuration is required. For saved-card UIs, you must handle CVV collection based on the card data returned by `getCustomerCards()`:
104
+
105
+ - If a saved card has `subscription_id`, CVV is not required.
106
+ - If a saved card does not have `subscription_id`, you must collect CVV and pass the card id to `payment()`, or the SDK will error.
107
+ - Only call `mountCardFields()` when the selected card does not have `subscription_id`.
108
+
109
+ Example (conditional CVV mount):
110
+ ```ts
111
+ const selectedCard = cardsResponse.cards.find(
112
+ (card) => card.fields.skyflow_id === selectedCardId
113
+ );
114
+ const needsCvv = !selectedCard?.fields?.subscription_id;
115
+
116
+ if (needsCvv) {
117
+ liteCheckout.mountCardFields({ fields: ['cvv'], card_id: selectedCardId });
118
+ }
119
+ ```
120
+
121
+ ### Existing saved cards without subscription_id
122
+ Cards saved before Card On File was enabled may not have `subscription_id`. You have three options:
123
+ 1) Remove the card using `removeCustomerCard()` and let the user add it again.
124
+ 2) Run a payment flow that shows the full card form; the SDK will create a subscription and update the card. Note: this can generate a new `skyflow_id`, so update any references in your app.
125
+ 3) Ask Tonder support to remove a specific card or all saved cards for a user.
126
+
100
127
  ## Mobile settings
101
128
 
102
129
  <font size="3">If you are deploying to Android, edit your AndroidManifest.xml file to add the Internet permission.</font>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tonder.io/ionic-lite-sdk",
3
- "version": "0.0.63-beta.develop.1711069",
3
+ "version": "0.0.64",
4
4
  "description": "Tonder ionic lite SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",