@odus/checkout 1.11.3 → 1.13.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.
- package/README.md +16 -16
- package/dist/api/createApplePaySession.mutation.d.ts.map +1 -1
- package/dist/api/getCheckoutDetails.query.d.ts.map +1 -1
- package/dist/checkout.es.js +160 -141
- package/dist/components/checkout/form/Form.d.ts +7 -0
- package/dist/components/checkout/form/Form.d.ts.map +1 -1
- package/dist/components/checkout/form/FormComponentManager.d.ts +2 -1
- package/dist/components/checkout/form/FormComponentManager.d.ts.map +1 -1
- package/dist/components/payment-methods/applePay/ApplePayButton.d.ts +1 -0
- package/dist/components/payment-methods/applePay/ApplePayButton.d.ts.map +1 -1
- package/dist/core/api/CheckoutAPI.service.d.ts.map +1 -1
- package/dist/core/constants/apiRoutes.constants.d.ts +14 -0
- package/dist/core/constants/apiRoutes.constants.d.ts.map +1 -0
- package/dist/elements/BaseElement.d.ts +8 -0
- package/dist/elements/BaseElement.d.ts.map +1 -1
- package/dist/elements/CardElement.d.ts +10 -3
- package/dist/elements/CardElement.d.ts.map +1 -1
- package/dist/elements/OdusElements.d.ts +8 -0
- package/dist/elements/OdusElements.d.ts.map +1 -1
- package/dist/elements/card/VgsCardAdapter.d.ts +2 -0
- package/dist/elements/card/VgsCardAdapter.d.ts.map +1 -1
- package/dist/elements.es.js +247 -215
- package/dist/phone.js +8 -14
- package/dist/services/checkout/Checkout.service.d.ts +2 -0
- package/dist/services/checkout/Checkout.service.d.ts.map +1 -1
- package/dist/services/checkout/CheckoutForm.service.d.ts +2 -0
- package/dist/services/checkout/CheckoutForm.service.d.ts.map +1 -1
- package/dist/services/telemetry/LoadTimer.service.d.ts +28 -0
- package/dist/services/telemetry/LoadTimer.service.d.ts.map +1 -0
- package/dist/services/telemetry/Telemetry.service.d.ts.map +1 -1
- package/dist/shared.js +633 -583
- package/dist/types/telemetry/TelemetryEvents.type.d.ts +35 -0
- package/dist/types/telemetry/TelemetryEvents.type.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/api/getSupportedPaymentMethods.query.d.ts +0 -7
- package/dist/api/getSupportedPaymentMethods.query.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Checkout SDK
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
The ODUS Checkout is a flexible, easy-to-implement JavaScript SDK that allows merchants to accept payments on their websites with minimal integration effort. This documentation provides all the necessary information to successfully implement the ODUS Checkout on your website.
|
|
4
4
|
|
|
5
5
|
## Table of Contents
|
|
6
6
|
|
|
@@ -92,7 +92,7 @@ import { OdusCheckout, CheckoutConfig, CheckoutInstance, Locale } from '@odus/ch
|
|
|
92
92
|
|
|
93
93
|
// Now you can use these types in your code
|
|
94
94
|
const config: CheckoutConfig = {
|
|
95
|
-
apiKey: '
|
|
95
|
+
apiKey: 'pk_retired',
|
|
96
96
|
paymentId: 'your_payment_id',
|
|
97
97
|
checkoutKey: 'your_unique_checkout_key',
|
|
98
98
|
returnUrl: 'https://your-website.com/payment-complete',
|
|
@@ -108,7 +108,7 @@ const checkout: CheckoutInstance = new OdusCheckout(config);
|
|
|
108
108
|
|
|
109
109
|
### Basic Implementation
|
|
110
110
|
|
|
111
|
-
Here's a simple example of how to implement the
|
|
111
|
+
Here's a simple example of how to implement the ODUS Checkout in your application:
|
|
112
112
|
|
|
113
113
|
```javascript
|
|
114
114
|
import { OdusCheckout } from '@odus/checkout';
|
|
@@ -117,7 +117,7 @@ import '@odus/checkout/styles';
|
|
|
117
117
|
|
|
118
118
|
// Initialize the checkout
|
|
119
119
|
const checkout = new OdusCheckout({
|
|
120
|
-
apiKey: '
|
|
120
|
+
apiKey: 'pk_retired',
|
|
121
121
|
paymentId: 'your_payment_id',
|
|
122
122
|
checkoutKey: 'your_unique_checkout_key',
|
|
123
123
|
returnUrl: 'https://your-website.com/payment-complete',
|
|
@@ -157,11 +157,11 @@ Make sure you have a container element in your HTML:
|
|
|
157
157
|
|
|
158
158
|
## Configuration Options
|
|
159
159
|
|
|
160
|
-
When initializing the
|
|
160
|
+
When initializing the ODUS Checkout, you can configure various options:
|
|
161
161
|
|
|
162
162
|
| Option | Type | Required | Description |
|
|
163
163
|
| ---------------------- | ------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
164
|
-
| `apiKey` | string | ✅ |
|
|
164
|
+
| `apiKey` | string | ✅ | Required, but not used since version 0.14.0. Pass `'pk_retired'`. |
|
|
165
165
|
| `checkoutKey` | string | ✅ | Unique checkout key for this payment session |
|
|
166
166
|
| `paymentId` | string | ✅ | The ID of the payment being processed |
|
|
167
167
|
| `environment` | string | ✅ | API environment to use - either 'test' or 'live' |
|
|
@@ -173,7 +173,7 @@ When initializing the Odus Checkout, you can configure various options:
|
|
|
173
173
|
|
|
174
174
|
## Payment Methods
|
|
175
175
|
|
|
176
|
-
The
|
|
176
|
+
The ODUS Checkout automatically displays payment methods based on your account configuration and the checkout profile. The following payment methods are supported:
|
|
177
177
|
|
|
178
178
|
- Credit/Debit Cards (Visa, Mastercard, American Express, Discover, JCB, Diners)
|
|
179
179
|
- PayPal
|
|
@@ -181,7 +181,7 @@ The Odus Checkout automatically displays payment methods based on your account c
|
|
|
181
181
|
|
|
182
182
|
## Callbacks and Event Handling
|
|
183
183
|
|
|
184
|
-
The
|
|
184
|
+
The ODUS Checkout SDK provides callback functions to handle different payment scenarios:
|
|
185
185
|
|
|
186
186
|
### onPaymentSucceeded
|
|
187
187
|
|
|
@@ -224,7 +224,7 @@ onActionRequired: (redirectUrl) => {
|
|
|
224
224
|
|
|
225
225
|
Called when the loading state of the checkout form changes. This is useful for showing or hiding custom loading indicators in your UI.
|
|
226
226
|
|
|
227
|
-
This callback is optional. If not provided,
|
|
227
|
+
This callback is optional. If not provided, ODUS will automatically render its default spinner during loading states.
|
|
228
228
|
|
|
229
229
|
```javascript
|
|
230
230
|
onLoadingStateChange: (isLoading) => {
|
|
@@ -241,20 +241,20 @@ onLoadingStateChange: (isLoading) => {
|
|
|
241
241
|
};
|
|
242
242
|
```
|
|
243
243
|
|
|
244
|
-
**Note:** Implementing this callback will override the default
|
|
244
|
+
**Note:** Implementing this callback will override the default ODUS loading indicator, giving you complete control over the loading experience.
|
|
245
245
|
|
|
246
246
|
## Localization Support
|
|
247
247
|
|
|
248
|
-
|
|
248
|
+
ODUS provides localized payment experiences in 33 languages, helping you better serve your global customer base.
|
|
249
249
|
|
|
250
250
|
### How it works
|
|
251
251
|
|
|
252
|
-
- **Automatic Detection**: By default,
|
|
252
|
+
- **Automatic Detection**: By default, ODUS detects your customer's browser locale and displays the payment page in that language if supported.
|
|
253
253
|
- **Manual Override**: You can specify a particular language by passing the locale parameter when creating a Checkout Session.
|
|
254
254
|
|
|
255
255
|
### Supported Languages
|
|
256
256
|
|
|
257
|
-
|
|
257
|
+
ODUS currently supports localization for 33 languages, ensuring broad international coverage for your payment processing needs.
|
|
258
258
|
|
|
259
259
|
## Advanced Usage
|
|
260
260
|
|
|
@@ -272,7 +272,7 @@ checkout.unmount();
|
|
|
272
272
|
|
|
273
273
|
### Custom 3DS Redirect Handling
|
|
274
274
|
|
|
275
|
-
By default,
|
|
275
|
+
By default, ODUS Checkout automatically redirects customers to the 3DS authentication page when required. However, you can take control of this process for a more customized experience:
|
|
276
276
|
|
|
277
277
|
```javascript
|
|
278
278
|
const checkout = new OdusCheckout({
|
|
@@ -391,13 +391,13 @@ interface CheckoutInstance {
|
|
|
391
391
|
- Ensure the container element exists before calling `mount()`
|
|
392
392
|
- Check that styles are imported with `import '@odus/checkout/styles'` when using npm/module approach
|
|
393
393
|
- Check browser console for errors
|
|
394
|
-
- Verify your
|
|
394
|
+
- Verify your checkout key and payment ID are correct
|
|
395
395
|
- Confirm that you're using the correct environment ('test' or 'live')
|
|
396
396
|
|
|
397
397
|
#### 3DS Authentication Issues
|
|
398
398
|
|
|
399
399
|
- Ensure your `returnUrl` is properly configured
|
|
400
|
-
- Verify your domain is whitelisted in your
|
|
400
|
+
- Verify your domain is whitelisted in your ODUS account settings
|
|
401
401
|
- If using `manualActionHandling: true`, make sure the `onActionRequired` callback is properly implemented
|
|
402
402
|
|
|
403
403
|
#### Manual 3DS Handling Not Working
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createApplePaySession.mutation.d.ts","sourceRoot":"","sources":["../../src/api/createApplePaySession.mutation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createApplePaySession.mutation.d.ts","sourceRoot":"","sources":["../../src/api/createApplePaySession.mutation.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAGzE,eAAO,MAAM,qBAAqB,GAAU,4DAMzC;IACD,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;CAC1B,iBAoBA,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCheckoutDetails.query.d.ts","sourceRoot":"","sources":["../../src/api/getCheckoutDetails.query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getCheckoutDetails.query.d.ts","sourceRoot":"","sources":["../../src/api/getCheckoutDetails.query.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AAGzE,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB,EAAE,MAAM,EAAE,CAAC;IAClC,QAAQ,EAAE;QACR,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,kBAAkB,GAAU,mCAItC;IACD,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,WAAW,CAAC;CAC1B,KAAG,OAAO,CAAC,eAAe,CAgB1B,CAAC"}
|