@glomopay/react-native-sdk 3.1.0 → 4.0.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +23 -2
  2. package/MIGRATION.md +79 -0
  3. package/README.md +62 -93
  4. package/lib/glomo-checkout.d.ts +2 -1
  5. package/lib/glomo-checkout.d.ts.map +1 -1
  6. package/lib/glomo-checkout.js +9 -24
  7. package/lib/glomo-lrs-checkout.d.ts +1 -1
  8. package/lib/glomo-lrs-checkout.d.ts.map +1 -1
  9. package/lib/glomo-standard-checkout.d.ts.map +1 -1
  10. package/lib/glomo-standard-checkout.js +2 -4
  11. package/lib/index.d.ts +2 -2
  12. package/lib/index.d.ts.map +1 -1
  13. package/lib/index.js +5 -3
  14. package/lib/types/checkout.d.ts +18 -19
  15. package/lib/types/checkout.d.ts.map +1 -1
  16. package/lib/types/checkout.js +12 -1
  17. package/lib/types/standard-checkout.d.ts +3 -7
  18. package/lib/types/standard-checkout.d.ts.map +1 -1
  19. package/lib/types/subscriptions-checkout.d.ts +3 -3
  20. package/lib/types/subscriptions-checkout.d.ts.map +1 -1
  21. package/lib/use-lrs-checkout.d.ts +1 -1
  22. package/lib/use-lrs-checkout.d.ts.map +1 -1
  23. package/lib/use-standard-checkout.d.ts +4 -8
  24. package/lib/use-standard-checkout.d.ts.map +1 -1
  25. package/lib/use-standard-checkout.js +27 -55
  26. package/lib/utils/analytics.d.ts +0 -2
  27. package/lib/utils/analytics.d.ts.map +1 -1
  28. package/lib/utils/analytics.js +0 -19
  29. package/package.json +1 -1
  30. package/src/glomo-checkout.tsx +9 -27
  31. package/src/glomo-lrs-checkout.tsx +1 -1
  32. package/src/glomo-standard-checkout.tsx +2 -6
  33. package/src/index.ts +4 -4
  34. package/src/types/checkout.ts +18 -17
  35. package/src/types/standard-checkout.ts +3 -5
  36. package/src/types/subscriptions-checkout.ts +3 -3
  37. package/src/use-lrs-checkout.tsx +1 -1
  38. package/src/use-standard-checkout.tsx +25 -102
  39. package/src/utils/analytics.ts +0 -27
package/CHANGELOG.md CHANGED
@@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [4.0.0] - 2026-06-11
9
+
10
+ ### Breaking Changes
11
+
12
+ - **Consolidated async payment callbacks**: `onBankTransferSubmitted` and `onPayViaBankCompleted` have been replaced by a single `onUserJourneyCompleted` callback. The new callback receives a `GlomoUserJourneyCompletedPayload` with a `journeyType` field from the `ASYNC_PAYMENT_EVENTS` enum.
13
+ - **Removed `onPayViaBankBankConnectionSuccessful`**: This informational callback has been removed. It may be reintroduced in a future version if merchant demand warrants it.
14
+ - **Removed types**: `GlomoBankTransferPayload` and `GlomoPayViaBankConnectionPayload` are no longer exported.
15
+ - **`onSdkError` is now required**: Previously optional, `onSdkError` must now be provided. This ensures validation errors, device compliance failures, and configuration issues are handled properly.
16
+
17
+ ### Added
18
+
19
+ - **`ASYNC_PAYMENT_EVENTS` enum**: Enumeration of asynchronous payment event types (`BANK_TRANSFER_SUBMITTED`, `PAY_VIA_BANK_COMPLETED`).
20
+ - **`GlomoUserJourneyCompletedPayload` type**: Flat payload interface with `journeyType`, `orderId?`, `status?`, `senderAccountNumber?`, `transactionReference?`.
21
+ - **`onUserJourneyCompleted` callback**: Single callback for all asynchronous payment flow completions.
22
+
23
+ ### Unchanged
24
+
25
+ - `CheckoutStatus` values `bank_transfer_submitted` and `pay_via_bank_completed` remain for granular `getStatus()` state checks.
26
+
8
27
  ## [3.1.0] - 2026-06-08
9
28
 
10
29
  ### Added
@@ -74,6 +93,8 @@ Checkout flows with camera-based bank authentication require native permissions:
74
93
 
75
94
  These are only required for flows that use camera-based bank authentication.
76
95
 
77
- ## [2.0.2]
96
+ ## [2.0.2] - 2025-11-26
97
+
98
+ Private v2 release candidate with experimental features. Not available for general use.
78
99
 
79
- Last v2 release.
100
+ Backwards compatible with `v1.x`
package/MIGRATION.md CHANGED
@@ -1,5 +1,84 @@
1
1
  # Migration Guide
2
2
 
3
+ ## v3 to v4
4
+
5
+ v4 consolidates the asynchronous payment flow callbacks into a single generic callback.
6
+
7
+ ### Removed Callbacks
8
+
9
+ | v3 | v4 |
10
+ |---|---|
11
+ | `onBankTransferSubmitted` | Use `onUserJourneyCompleted` with `journeyType: ASYNC_PAYMENT_EVENTS.BANK_TRANSFER_SUBMITTED` |
12
+ | `onPayViaBankCompleted` | Use `onUserJourneyCompleted` with `journeyType: ASYNC_PAYMENT_EVENTS.PAY_VIA_BANK_COMPLETED` |
13
+ | `onPayViaBankBankConnectionSuccessful` | Removed (no replacement) |
14
+
15
+ ### Removed Types
16
+
17
+ | v3 | v4 |
18
+ |---|---|
19
+ | `GlomoBankTransferPayload` | Use `GlomoUserJourneyCompletedPayload` |
20
+ | `GlomoPayViaBankConnectionPayload` | Removed |
21
+
22
+ ### New Types
23
+
24
+ | Type | Purpose |
25
+ |---|---|
26
+ | `ASYNC_PAYMENT_EVENTS` | Enum of asynchronous payment event types |
27
+ | `GlomoUserJourneyCompletedPayload` | Payload for `onUserJourneyCompleted` callback |
28
+
29
+ ### `onSdkError` is now required
30
+
31
+ `onSdkError` was optional in v3. In v4 it is required. If you were not passing it, add it:
32
+
33
+ ```tsx
34
+ onSdkError={(errors) => {
35
+ errors.forEach((e) => console.error(e.type, e.message, e.field));
36
+ }}
37
+ ```
38
+
39
+ ### Unchanged
40
+
41
+ - `CheckoutStatus` values `bank_transfer_submitted` and `pay_via_bank_completed` remain unchanged. `getStatus()` continues to return granular status values.
42
+
43
+ ### Before / After
44
+
45
+ **v3:**
46
+ ```tsx
47
+ <GlomoCheckout
48
+ onBankTransferSubmitted={(payload) => {
49
+ console.log("Transfer ref:", payload?.transactionReference);
50
+ }}
51
+ onPayViaBankCompleted={(payload) => {
52
+ console.log("Pay via bank:", payload.status);
53
+ }}
54
+ onPayViaBankBankConnectionSuccessful={(payload) => {
55
+ console.log("Bank connected:", payload?.bankName);
56
+ }}
57
+ // ...other props
58
+ />
59
+ ```
60
+
61
+ **v4:**
62
+ ```tsx
63
+ import { ASYNC_PAYMENT_EVENTS } from "@glomopay/react-native-sdk";
64
+
65
+ <GlomoCheckout
66
+ onUserJourneyCompleted={(payload) => {
67
+ switch (payload.journeyType) {
68
+ case ASYNC_PAYMENT_EVENTS.BANK_TRANSFER_SUBMITTED:
69
+ console.log("Transfer ref:", payload.transactionReference);
70
+ break;
71
+ case ASYNC_PAYMENT_EVENTS.PAY_VIA_BANK_COMPLETED:
72
+ console.log("Pay via bank:", payload.status);
73
+ break;
74
+ }
75
+ }}
76
+ // ...other props
77
+ />
78
+ ```
79
+
80
+ ---
81
+
3
82
  ## v2 to v3
4
83
 
5
84
  v3 replaces the LRS-only `GlomoLrsCheckout` with a unified `GlomoCheckout` that auto-detects order type.
package/README.md CHANGED
@@ -53,6 +53,7 @@ import React, { useRef } from "react";
53
53
  import { View, Button } from "react-native";
54
54
  import {
55
55
  GlomoCheckout,
56
+ ASYNC_PAYMENT_EVENTS,
56
57
  type GlomoCheckoutRef,
57
58
  type GlomoCheckoutPayload,
58
59
  type SdkError,
@@ -88,14 +89,15 @@ export default function PaymentScreen() {
88
89
  onConnectionError={(error) => {
89
90
  console.log("Connection error:", error);
90
91
  }}
91
- onBankTransferSubmitted={(payload) => {
92
- console.log("Bank transfer submitted:", payload?.transactionReference);
93
- }}
94
- onPayViaBankCompleted={(payload) => {
95
- console.log("Pay via bank completed:", payload.status);
96
- }}
97
- onPayViaBankBankConnectionSuccessful={(payload) => {
98
- console.log("Bank connected:", payload?.bankName);
92
+ onUserJourneyCompleted={(payload) => {
93
+ switch (payload.journeyType) {
94
+ case ASYNC_PAYMENT_EVENTS.BANK_TRANSFER_SUBMITTED:
95
+ console.log("Bank transfer submitted:", payload.transactionReference);
96
+ break;
97
+ case ASYNC_PAYMENT_EVENTS.PAY_VIA_BANK_COMPLETED:
98
+ console.log("Pay via bank completed:", payload.status);
99
+ break;
100
+ }
99
101
  }}
100
102
  onUserRefusedCameraPermissions={() => {
101
103
  console.log("User refused camera - cannot proceed with bank authentication");
@@ -109,13 +111,19 @@ export default function PaymentScreen() {
109
111
  }
110
112
  ```
111
113
 
112
- ## Breaking Changes (v3)
114
+ ## Breaking Changes (v4)
113
115
 
114
116
  - `GlomoLrsCheckout` has been replaced by `GlomoCheckout` - the new component now works for all checkout orders (including LRS)
115
117
  - `start()` is now async - returns `Promise<boolean>` instead of `boolean`
116
118
  - All LRS-specific exports have been renamed (e.g. `GlomoLrsCheckoutRef` -> `GlomoCheckoutRef`)
119
+ - `onBankTransferSubmitted` and `onPayViaBankCompleted` replaced by a single `onUserJourneyCompleted` callback
120
+ - `onPayViaBankBankConnectionSuccessful` removed entirely
121
+ - `GlomoBankTransferPayload` and `GlomoPayViaBankConnectionPayload` types removed
122
+ - `onSdkError` is now **required** - previously optional, now must be provided to ensure validation and device compliance errors are always surfaced
123
+ - New exports: `ASYNC_PAYMENT_EVENTS` enum and `GlomoUserJourneyCompletedPayload` type
124
+ - `CheckoutStatus` values `bank_transfer_submitted` and `pay_via_bank_completed` are unchanged
117
125
 
118
- For migration details, see the [Migration from v2](#migration-from-v2) section below or MIGRATION.md included in this package.
126
+ For migration details, see MIGRATION.md included in this package.
119
127
 
120
128
  ## Subscriptions Checkout
121
129
 
@@ -141,7 +149,6 @@ To process subscription payments, pass a `subscriptionId` instead of an `orderId
141
149
  When `subscriptionId` is provided:
142
150
  - The SDK skips order type detection (no API call)
143
151
  - The `subscriptionId` must start with `sub_`
144
- - Bank transfer callbacks (`onBankTransferSubmitted`, `onPayViaBankCompleted`) are not applicable - subscriptions are card-only
145
152
  - Do not pass both `orderId` and `subscriptionId` - the SDK will fire `onSdkError`
146
153
  - The `detecting_order_type` status is not emitted for subscription flows
147
154
 
@@ -150,8 +157,7 @@ When `subscriptionId` is provided:
150
157
  - **Cross-platform** - works on both iOS and Android
151
158
  - **TypeScript** - full type definitions for all exports
152
159
  - **Unified checkout** - renders the correct checkout flow automatically based on your order
153
- - **Bank transfer support** - callback for bank transfer submission events
154
- - **Pay via bank** - bank payment flow completion and connection callbacks
160
+ - **Asynchronous payment flows** - single `onUserJourneyCompleted` callback for bank transfer and pay via bank events
155
161
  - **Camera permissions** - built-in handling for bank authentication
156
162
  - **Device security** - optional **(but strongly recommended)** `jail-monkey` integration for rooted/jailbroken device detection
157
163
  - **Input validation** - publicKey and orderId format enforcement before checkout starts
@@ -209,10 +215,8 @@ The unified checkout component. Place it in your render tree and control it via
209
215
  | `onPaymentFailure` | `(payload: GlomoCheckoutPayload) => void` | Yes | Called when payment fails |
210
216
  | `onConnectionError` | `(error: unknown) => void` | No | Called on network/connection errors |
211
217
  | `onPaymentTerminate` | `() => void` | No | Called when user dismisses checkout (back button or swipe) |
212
- | `onSdkError` | `(errors: SdkError[]) => void` | No | Called on validation errors or device compliance failures |
213
- | `onBankTransferSubmitted` | `(payload: GlomoBankTransferPayload \| null \| undefined) => void` | No | Called when user submits bank transfer details |
214
- | `onPayViaBankCompleted` | `(payload: { status: string }) => void` | No | Called when pay via bank flow completes |
215
- | `onPayViaBankBankConnectionSuccessful` | `(payload: GlomoPayViaBankConnectionPayload \| null \| undefined) => void` | No | Called when bank connection is established during pay via bank flow |
218
+ | `onSdkError` | `(errors: SdkError[]) => void` | Yes | Called on validation errors or device compliance failures |
219
+ | `onUserJourneyCompleted` | `(payload: GlomoUserJourneyCompletedPayload) => void` | No | Called when an asynchronous payment flow completes (bank transfer submission, pay via bank completion). Check `payload.journeyType` to determine the flow. |
216
220
  | `onUserRefusedCameraPermissions` | `() => void` | No | Called when user denies camera access needed for bank authentication |
217
221
 
218
222
  *Exactly one of `orderId` or `subscriptionId` must be provided. If both or neither are set, `onSdkError` fires and `start()` returns `false`.
@@ -249,25 +253,24 @@ interface GlomoCheckoutPayload {
249
253
  }
250
254
  ```
251
255
 
252
- #### GlomoBankTransferPayload
256
+ #### ASYNC_PAYMENT_EVENTS
253
257
 
254
258
  ```ts
255
- interface GlomoBankTransferPayload {
256
- orderId: string;
257
- senderAccountNumber: string;
258
- transactionReference: string;
259
+ enum ASYNC_PAYMENT_EVENTS {
260
+ BANK_TRANSFER_SUBMITTED = "bank_transfer_submitted",
261
+ PAY_VIA_BANK_COMPLETED = "pay_via_bank_completed",
259
262
  }
260
263
  ```
261
264
 
262
- #### GlomoPayViaBankConnectionPayload
265
+ #### GlomoUserJourneyCompletedPayload
263
266
 
264
267
  ```ts
265
- interface GlomoPayViaBankConnectionPayload {
266
- bankIdentifier: string;
267
- cooldownPeriodInMinutes: number;
268
- bankName: string;
269
- bankImageSrc: string;
270
- bankImageAlt: string;
268
+ interface GlomoUserJourneyCompletedPayload {
269
+ journeyType: ASYNC_PAYMENT_EVENTS;
270
+ orderId?: string;
271
+ status?: string;
272
+ senderAccountNumber?: string;
273
+ transactionReference?: string;
271
274
  }
272
275
  ```
273
276
 
@@ -281,41 +284,34 @@ interface SdkError {
281
284
  }
282
285
  ```
283
286
 
284
- ## Bank Transfer Support
287
+ ## Asynchronous Payment Flows
285
288
 
286
- When the checkout flow includes a bank transfer option, the user submits transfer details (account number, reference) through the checkout UI. The SDK fires `onBankTransferSubmitted` with a `GlomoBankTransferPayload`:
289
+ The SDK fires `onUserJourneyCompleted` when an asynchronous payment flow completes. Use `payload.journeyType` to determine which flow triggered the callback:
287
290
 
288
291
  ```tsx
289
- onBankTransferSubmitted={(payload) => {
290
- // payload may be null/undefined if the checkout page omits it
291
- console.log("Transfer ref:", payload?.transactionReference);
292
+ onUserJourneyCompleted={(payload) => {
293
+ switch (payload.journeyType) {
294
+ case ASYNC_PAYMENT_EVENTS.BANK_TRANSFER_SUBMITTED:
295
+ /**
296
+ * User submitted bank transfer details.
297
+ * Relevant fields: orderId, senderAccountNumber, transactionReference
298
+ * Note: fields may be absent if the checkout page omits them.
299
+ */
300
+ console.log("Transfer ref:", payload.transactionReference);
301
+ break;
302
+ case ASYNC_PAYMENT_EVENTS.PAY_VIA_BANK_COMPLETED:
303
+ /**
304
+ * Pay via bank journey completed.
305
+ * Relevant fields: orderId, status
306
+ * The SDK deduplicates this event - fires only once per session.
307
+ */
308
+ console.log("Pay via bank status:", payload.status);
309
+ break;
310
+ }
292
311
  }}
293
312
  ```
294
313
 
295
- The checkout status transitions to `bank_transfer_submitted`.
296
-
297
- ## Pay via Bank Support
298
-
299
- The SDK fires `onPayViaBankCompleted` when the pay-via-bank journey completes:
300
-
301
- ```tsx
302
- onPayViaBankCompleted={(payload) => {
303
- // payload.status - e.g. "success", "failed", "unknown"
304
- console.log("Pay via bank status:", payload.status);
305
- }}
306
- ```
307
-
308
- The checkout status transitions to `pay_via_bank_completed`. The SDK deduplicates this event internally - the callback fires only once per checkout session.
309
-
310
- Additionally, `onPayViaBankBankConnectionSuccessful` fires when a bank account is successfully connected when initiating a pay-via-bank checkout, before the actual payment completes. This is informational only - it does not change the checkout status. Can be used to show a "bank connected" confirmation UI if desirable, while the payment continues in the background:
311
-
312
- ```tsx
313
- onPayViaBankBankConnectionSuccessful={(payload) => {
314
- // payload may be null/undefined if the checkout page omits it
315
- console.log("Connected to:", payload?.bankName);
316
- console.log("Cooldown:", payload?.cooldownPeriodInMinutes, "minutes");
317
- }}
318
- ```
314
+ The checkout status transitions to `bank_transfer_submitted` or `pay_via_bank_completed` respectively. Use `getStatus()` for granular programmatic checks.
319
315
 
320
316
  ## Camera Permissions
321
317
 
@@ -391,27 +387,9 @@ Validation failures fire `onSdkError` with `type: "validation_error"` and the re
391
387
 
392
388
  Providing both `orderId` and `subscriptionId` (or neither) also fires `onSdkError`.
393
389
 
394
- ## Migration from v2
395
-
396
- v3 replaces the LRS-only `GlomoLrsCheckout` with a unified `GlomoCheckout`.
397
-
398
- ### Renamed Exports
399
-
400
- | v2 | v3 |
401
- | -------------------------- | ------------------------- |
402
- | `GlomoLrsCheckout` | `GlomoCheckout` |
403
- | `GlomoLrsCheckoutRef` | `GlomoCheckoutRef` |
404
- | `GlomoLrsCheckoutProps` | `GlomoCheckoutProps` |
405
- | `GlomoLrsCheckoutPayload` | `GlomoCheckoutPayload` |
406
- | `GlomoLrsServer` | `GlomoServer` |
407
-
408
- ### Breaking Changes
409
-
410
- - **`start()` is now async**: Returns `Promise<boolean>` instead of `boolean`. Update call sites to `await ref.current?.start()`.
411
- - **New statuses**: `bank_transfer_submitted` and `pay_via_bank_completed` are new additions to `CheckoutStatus`.
412
- - **New callbacks**: `onBankTransferSubmitted`, `onPayViaBankCompleted`, and `onUserRefusedCameraPermissions` are available.
390
+ ## Migration from v1/v3
413
391
 
414
- See MIGRATION.md included in this package for a standalone migration guide with before/after code examples.
392
+ See MIGRATION.md included in this package for migration guides with before/after code examples.
415
393
 
416
394
  ## Troubleshooting
417
395
 
@@ -432,11 +410,7 @@ Check `onSdkError` for details. Common causes:
432
410
  ### Camera permission denied
433
411
 
434
412
  - Ensure `AndroidManifest.xml` and `Info.plist` include camera permission declarations
435
- - The `onUserRefusedCameraPermissions` callback will fire when the user denies
436
-
437
- ### `onPayViaBankCompleted` not firing
438
-
439
- - Ensure you are passing `onPayViaBankCompleted` as a prop to `GlomoCheckout`
413
+ - The `onUserRefusedCameraPermissions` callback will fire when the user denies camera permissions to your app
440
414
 
441
415
  ## Exports
442
416
 
@@ -447,14 +421,16 @@ export { GlomoCheckout } from "@glomopay/react-native-sdk";
447
421
  // Hooks (deprecated - use GlomoCheckout component with ref instead)
448
422
  export { useGlomoCheckout } from "@glomopay/react-native-sdk";
449
423
 
424
+ // Enums
425
+ export { ASYNC_PAYMENT_EVENTS } from "@glomopay/react-native-sdk";
426
+
450
427
  // Types
451
428
  export type {
452
429
  GlomoCheckoutRef,
453
430
  GlomoCheckoutProps,
454
431
  GlomoCheckoutPayload,
455
432
  CheckoutStatus,
456
- GlomoBankTransferPayload,
457
- GlomoPayViaBankConnectionPayload,
433
+ GlomoUserJourneyCompletedPayload,
458
434
  UseGlomoCheckoutReturn, // deprecated
459
435
  SdkError,
460
436
  } from "@glomopay/react-native-sdk";
@@ -462,19 +438,12 @@ export type {
462
438
 
463
439
  ## Security
464
440
 
465
- The SDK loads checkout pages in an isolated WebView. No PAN, CVV, or sensitive payment data passes through the React Native bridge - all sensitive input is handled within the WebView's sandboxed context.
466
-
467
441
  Device integrity checking is available via optional `jail-monkey` integration (see [Device Security Compliance](#device-security-compliance)).
468
442
 
469
- To report a security vulnerability, email security@glomopay.com. Do not open a public GitHub issue for security reports.
470
-
471
- ## Contributing
472
-
473
- This SDK is maintained by GlomoPay. We do not accept external contributions at this time.
443
+ To report a security vulnerability, email security@glomopay.com.
474
444
 
475
445
  ## Support
476
446
 
477
- - GitHub Issues: https://github.com/glomopay/glomopay-rn-sdk/issues
478
447
  - Email: developer@glomopay.com
479
448
 
480
449
  ## License
@@ -1,6 +1,7 @@
1
1
  /**
2
- * The unified GlomoPay Checkout Component (v3).
2
+ * The unified GlomoPay Checkout Component (v4).
3
3
  * Detects order type (LRS vs Standard) and delegates rendering to the appropriate inner component.
4
+ * Enforces error handling via `onSdkError()` as a mandatory prop.
4
5
  */
5
6
  import React from "react";
6
7
  import { type GlomoCheckoutRef, type GlomoCheckoutProps } from "./types/checkout";
@@ -1 +1 @@
1
- {"version":3,"file":"glomo-checkout.d.ts","sourceRoot":"","sources":["../src/glomo-checkout.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAsE,MAAM,OAAO,CAAC;AAG3F,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAwIlF,eAAO,MAAM,aAAa,6FAA2E,CAAC"}
1
+ {"version":3,"file":"glomo-checkout.d.ts","sourceRoot":"","sources":["../src/glomo-checkout.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAsE,MAAM,OAAO,CAAC;AAG3F,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAqHlF,eAAO,MAAM,aAAa,6FAA2E,CAAC"}
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  /**
3
- * The unified GlomoPay Checkout Component (v3).
3
+ * The unified GlomoPay Checkout Component (v4).
4
4
  * Detects order type (LRS vs Standard) and delegates rendering to the appropriate inner component.
5
+ * Enforces error handling via `onSdkError()` as a mandatory prop.
5
6
  */
6
7
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
8
  if (k2 === undefined) k2 = k;
@@ -57,43 +58,27 @@ function GlomoCheckoutComponent(props, ref) {
57
58
  const hasTrackedUnsupportedRef = (0, react_1.useRef)(false);
58
59
  const devMode = (_a = passedProps.devMode) !== null && _a !== void 0 ? _a : false;
59
60
  const mockMode = (0, react_1.useMemo)(() => { var _a, _b; return (_b = (_a = passedProps.publicKey) === null || _a === void 0 ? void 0 : _a.toLowerCase().startsWith("test_")) !== null && _b !== void 0 ? _b : false; }, [passedProps.publicKey]);
60
- // Extracting stable booleans for the tracking effect to avoid depending on passedProps object
61
- const hasBankTransferCallback = !!passedProps.onBankTransferSubmitted;
62
- const hasPayViaBankCallback = !!passedProps.onPayViaBankCompleted;
63
- const hasBankConnectionCallback = !!passedProps.onPayViaBankBankConnectionSuccessful;
61
+ // Extracting stable boolean for the tracking effect to avoid depending on passedProps object
62
+ const hasUserJourneyCallback = !!passedProps.onUserJourneyCompleted;
64
63
  (0, react_1.useEffect)(() => {
65
64
  if (orderType !== "subscriptions" || hasTrackedUnsupportedRef.current)
66
65
  return;
67
66
  hasTrackedUnsupportedRef.current = true;
68
- const unsupported = [
69
- hasBankTransferCallback && "onBankTransferSubmitted",
70
- hasPayViaBankCallback && "onPayViaBankCompleted",
71
- hasBankConnectionCallback && "onPayViaBankBankConnectionSuccessful",
72
- ].filter(Boolean);
73
- for (const name of unsupported) {
74
- (0, analytics_1.trackUseOfUnsupportedFunctionality)(name, passedProps.subscriptionId, passedProps.publicKey, devMode, mockMode, "");
67
+ if (hasUserJourneyCallback) {
68
+ (0, analytics_1.trackUseOfUnsupportedFunctionality)("onUserJourneyCompleted", passedProps.subscriptionId, passedProps.publicKey, devMode, mockMode, "");
75
69
  }
76
- }, [
77
- orderType,
78
- hasBankTransferCallback,
79
- hasPayViaBankCallback,
80
- hasBankConnectionCallback,
81
- passedProps.subscriptionId,
82
- passedProps.publicKey,
83
- devMode,
84
- mockMode,
85
- ]);
70
+ }, [orderType, hasUserJourneyCallback, passedProps.subscriptionId, passedProps.publicKey, devMode, mockMode]);
86
71
  // Delegating to the LRS checkout component once order type is resolved as LRS
87
72
  if (orderType === "lrs") {
88
73
  return (<glomo_lrs_checkout_1.GlomoLrsCheckout ref={innerLrsRef} server={passedProps.server} publicKey={passedProps.publicKey} orderId={passedProps.orderId} onPaymentSuccess={passedProps.onPaymentSuccess} onPaymentFailure={passedProps.onPaymentFailure} onConnectionError={passedProps.onConnectionError} onPaymentTerminate={passedProps.onPaymentTerminate} onSdkError={passedProps.onSdkError} devMode={passedProps.devMode}/>);
89
74
  }
90
75
  // Delegating to the Standard checkout component once order type is resolved as Standard
91
76
  if (orderType === "standard") {
92
- return (<glomo_standard_checkout_1.GlomoStandardCheckout ref={innerStandardRef} server={passedProps.server} publicKey={passedProps.publicKey} orderId={passedProps.orderId} onPaymentSuccess={passedProps.onPaymentSuccess} onPaymentFailure={passedProps.onPaymentFailure} onConnectionError={passedProps.onConnectionError} onPaymentTerminate={passedProps.onPaymentTerminate} onSdkError={passedProps.onSdkError} onBankTransferSubmitted={passedProps.onBankTransferSubmitted} onPayViaBankCompleted={passedProps.onPayViaBankCompleted} onPayViaBankBankConnectionSuccessful={passedProps.onPayViaBankBankConnectionSuccessful} onUserRefusedCameraPermissions={passedProps.onUserRefusedCameraPermissions} devMode={passedProps.devMode}/>);
77
+ return (<glomo_standard_checkout_1.GlomoStandardCheckout ref={innerStandardRef} server={passedProps.server} publicKey={passedProps.publicKey} orderId={passedProps.orderId} onPaymentSuccess={passedProps.onPaymentSuccess} onPaymentFailure={passedProps.onPaymentFailure} onConnectionError={passedProps.onConnectionError} onPaymentTerminate={passedProps.onPaymentTerminate} onSdkError={passedProps.onSdkError} onUserJourneyCompleted={passedProps.onUserJourneyCompleted} onUserRefusedCameraPermissions={passedProps.onUserRefusedCameraPermissions} devMode={passedProps.devMode}/>);
93
78
  }
94
79
  // Delegating to the Subscriptions checkout component when subscriptionId is provided (no API call)
95
80
  if (orderType === "subscriptions") {
96
- return (<glomo_subscriptions_checkout_1.GlomoSubscriptionsCheckout ref={innerSubscriptionsRef} server={passedProps.server} publicKey={passedProps.publicKey} subscriptionId={passedProps.subscriptionId} onPaymentSuccess={passedProps.onPaymentSuccess} onPaymentFailure={passedProps.onPaymentFailure} onConnectionError={passedProps.onConnectionError} onPaymentTerminate={passedProps.onPaymentTerminate} onSdkError={passedProps.onSdkError} onPayViaBankBankConnectionSuccessful={passedProps.onPayViaBankBankConnectionSuccessful} onUserRefusedCameraPermissions={passedProps.onUserRefusedCameraPermissions} devMode={passedProps.devMode}/>);
81
+ return (<glomo_subscriptions_checkout_1.GlomoSubscriptionsCheckout ref={innerSubscriptionsRef} server={passedProps.server} publicKey={passedProps.publicKey} subscriptionId={passedProps.subscriptionId} onPaymentSuccess={passedProps.onPaymentSuccess} onPaymentFailure={passedProps.onPaymentFailure} onConnectionError={passedProps.onConnectionError} onPaymentTerminate={passedProps.onPaymentTerminate} onSdkError={passedProps.onSdkError} onUserJourneyCompleted={passedProps.onUserJourneyCompleted} onUserRefusedCameraPermissions={passedProps.onUserRefusedCameraPermissions} devMode={passedProps.devMode}/>);
97
82
  }
98
83
  /**
99
84
  * No modal for detecting state - avoids iOS pageSheet conflict where
@@ -4,7 +4,7 @@ import { type UseLrsCheckoutOptions, type LrsCheckoutStatus } from "./use-lrs-ch
4
4
  import { type SdkError } from "./utils/analytics";
5
5
  export interface GlomoLrsCheckoutProps extends UseLrsCheckoutOptions {
6
6
  visible?: boolean;
7
- onSdkError?: (error: Array<SdkError>) => void;
7
+ onSdkError: (error: Array<SdkError>) => void;
8
8
  }
9
9
  export interface GlomoLrsCheckoutRef {
10
10
  start: () => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"glomo-lrs-checkout.d.ts","sourceRoot":"","sources":["../src/glomo-lrs-checkout.tsx"],"names":[],"mappings":"AAAA,0CAA0C;AAE1C,OAAO,KAAmD,MAAM,OAAO,CAAC;AAIxE,OAAO,EAAkB,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACxG,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAChE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;CACjD;AAED,MAAM,WAAW,mBAAmB;IAChC,KAAK,EAAE,MAAM,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,iBAAiB,CAAC;CACtC;AA2WD,eAAO,MAAM,gBAAgB,mGAAoF,CAAC"}
1
+ {"version":3,"file":"glomo-lrs-checkout.d.ts","sourceRoot":"","sources":["../src/glomo-lrs-checkout.tsx"],"names":[],"mappings":"AAAA,0CAA0C;AAE1C,OAAO,KAAmD,MAAM,OAAO,CAAC;AAIxE,OAAO,EAAkB,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACxG,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD,MAAM,WAAW,qBAAsB,SAAQ,qBAAqB;IAChE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;CAChD;AAED,MAAM,WAAW,mBAAmB;IAChC,KAAK,EAAE,MAAM,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,iBAAiB,CAAC;CACtC;AA2WD,eAAO,MAAM,gBAAgB,mGAAoF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"glomo-standard-checkout.d.ts","sourceRoot":"","sources":["../src/glomo-standard-checkout.tsx"],"names":[],"mappings":"AAAA,+CAA+C;AAE/C,OAAO,KAAmD,MAAM,OAAO,CAAC;AAKxE,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAC3G,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAGnE;;;;GAIG;AACH,MAAM,WAAW,kCAAmC,SAAQ,0BAA0B;IAClF,kBAAkB,CAAC,EAAE,yBAAyB,CAAC;IAC/C,sBAAsB,CAAC,EAAE,OAAO,CAAC;CACpC;AAmQD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAiD,KAAK,CAAC,yBAAyB,CAC9G,0BAA0B,GAAG,KAAK,CAAC,aAAa,CAAC,wBAAwB,CAAC,CAC7E,CAAC;AAIF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,qHAEzC,CAAC"}
1
+ {"version":3,"file":"glomo-standard-checkout.d.ts","sourceRoot":"","sources":["../src/glomo-standard-checkout.tsx"],"names":[],"mappings":"AAAA,+CAA+C;AAE/C,OAAO,KAAmD,MAAM,OAAO,CAAC;AAKxE,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAC3G,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAGnE;;;;GAIG;AACH,MAAM,WAAW,kCAAmC,SAAQ,0BAA0B;IAClF,kBAAkB,CAAC,EAAE,yBAAyB,CAAC;IAC/C,sBAAsB,CAAC,EAAE,OAAO,CAAC;CACpC;AA+PD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAiD,KAAK,CAAC,yBAAyB,CAC9G,0BAA0B,GAAG,KAAK,CAAC,aAAa,CAAC,wBAAwB,CAAC,CAC7E,CAAC;AAIF;;;GAGG;AACH,eAAO,MAAM,6BAA6B,qHAEzC,CAAC"}
@@ -57,7 +57,7 @@ const validation_1 = require("./utils/validation");
57
57
  * @param ref - The ref for the component
58
58
  * @param devMode - Turn on to see all logs, warnings, and errors in the console. Off by default
59
59
  */
60
- function GlomoStandardCheckoutComponent({ server, publicKey, orderId, onPaymentSuccess, onPaymentFailure, onConnectionError, onPaymentTerminate, onSdkError, onBankTransferSubmitted, onPayViaBankCompleted, onPayViaBankBankConnectionSuccessful, onUserRefusedCameraPermissions, devMode = false, _analyticsTrackers, _skipOrderIdValidation, }, ref) {
60
+ function GlomoStandardCheckoutComponent({ server, publicKey, orderId, onPaymentSuccess, onPaymentFailure, onConnectionError, onPaymentTerminate, onSdkError, onUserJourneyCompleted, onUserRefusedCameraPermissions, devMode = false, _analyticsTrackers, _skipOrderIdValidation, }, ref) {
61
61
  // Computing mockMode based on the publicKey prefix
62
62
  const mockMode = (0, react_1.useMemo)(() => {
63
63
  var _a;
@@ -76,9 +76,7 @@ function GlomoStandardCheckoutComponent({ server, publicKey, orderId, onPaymentS
76
76
  onConnectionError,
77
77
  onPaymentTerminate,
78
78
  onSdkError,
79
- onBankTransferSubmitted,
80
- onPayViaBankCompleted,
81
- onPayViaBankBankConnectionSuccessful,
79
+ onUserJourneyCompleted,
82
80
  onUserRefusedCameraPermissions,
83
81
  devMode,
84
82
  }, mockMode, { analyticsTrackers: _analyticsTrackers, _skipOrderIdValidation });
package/lib/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- /** The GlomoPay RN SDK v3 exports */
1
+ /** The GlomoPay RN SDK v4 exports */
2
2
  export { GlomoCheckout } from "./glomo-checkout";
3
- export { type GlomoCheckoutRef, type GlomoCheckoutProps, type GlomoCheckoutPayload, type CheckoutStatus, type GlomoBankTransferPayload, type GlomoPayViaBankConnectionPayload, } from "./types/checkout";
3
+ export { type GlomoCheckoutRef, type GlomoCheckoutProps, type GlomoCheckoutPayload, type CheckoutStatus, type GlomoUserJourneyCompletedPayload, ASYNC_PAYMENT_EVENTS, } from "./types/checkout";
4
4
  export { type GlomoServer } from "./config/base";
5
5
  export { type SdkError } from "./utils/analytics";
6
6
  export { useGlomoCheckout, type UseGlomoCheckoutReturn } from "./use-glomo-checkout";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAGrC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,gCAAgC,GACxC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAGrC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,cAAc,EACnB,KAAK,gCAAgC,EACrC,oBAAoB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC"}
package/lib/index.js CHANGED
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
- /** The GlomoPay RN SDK v3 exports */
2
+ /** The GlomoPay RN SDK v4 exports */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.useGlomoCheckout = exports.GlomoCheckout = void 0;
5
- // v3 public API - unified checkout
4
+ exports.useGlomoCheckout = exports.ASYNC_PAYMENT_EVENTS = exports.GlomoCheckout = void 0;
5
+ // v4 public API - unified checkout
6
6
  var glomo_checkout_1 = require("./glomo-checkout");
7
7
  Object.defineProperty(exports, "GlomoCheckout", { enumerable: true, get: function () { return glomo_checkout_1.GlomoCheckout; } });
8
+ var checkout_1 = require("./types/checkout");
9
+ Object.defineProperty(exports, "ASYNC_PAYMENT_EVENTS", { enumerable: true, get: function () { return checkout_1.ASYNC_PAYMENT_EVENTS; } });
8
10
  var use_glomo_checkout_1 = require("./use-glomo-checkout");
9
11
  Object.defineProperty(exports, "useGlomoCheckout", { enumerable: true, get: function () { return use_glomo_checkout_1.useGlomoCheckout; } });
@@ -1,4 +1,4 @@
1
- /** Unified v3 type definitions for GlomoCheckout */
1
+ /** Unified v4 type definitions for GlomoCheckout */
2
2
  import { type GlomoServer } from "../config/base";
3
3
  import { type SdkError } from "../utils/analytics";
4
4
  /** The payload for a successful or failed payment (unified across LRS and standard) */
@@ -7,19 +7,22 @@ export interface GlomoCheckoutPayload {
7
7
  paymentId: string;
8
8
  signature: string;
9
9
  }
10
- /** The payload for a bank transfer submission */
11
- export interface GlomoBankTransferPayload {
12
- orderId: string;
13
- senderAccountNumber: string;
14
- transactionReference: string;
10
+ /**
11
+ * Enum of asynchronous payment events that trigger the
12
+ * onUserJourneyCompleted callback. New events will be added
13
+ * here as additional flows are supported.
14
+ */
15
+ export declare enum ASYNC_PAYMENT_EVENTS {
16
+ BANK_TRANSFER_SUBMITTED = "bank_transfer_submitted",
17
+ PAY_VIA_BANK_COMPLETED = "pay_via_bank_completed"
15
18
  }
16
- /** The payload for a pay via bank - bank connection successful event */
17
- export interface GlomoPayViaBankConnectionPayload {
18
- bankIdentifier: string;
19
- cooldownPeriodInMinutes: number;
20
- bankName: string;
21
- bankImageSrc: string;
22
- bankImageAlt: string;
19
+ /** The payload for the onUserJourneyCompleted callback */
20
+ export interface GlomoUserJourneyCompletedPayload {
21
+ journeyType: ASYNC_PAYMENT_EVENTS;
22
+ orderId?: string;
23
+ status?: string;
24
+ senderAccountNumber?: string;
25
+ transactionReference?: string;
23
26
  }
24
27
  /** Unified checkout statuses - superset of LRS + standard statuses */
25
28
  export type CheckoutStatus = "ready" | "detecting_order_type" | "payment_in_progress" | "payment_successful" | "payment_failed" | "payment_cancelled" | "bank_transfer_submitted" | "pay_via_bank_completed";
@@ -40,12 +43,8 @@ interface GlomoCheckoutBaseProps {
40
43
  onPaymentFailure: (payload: GlomoCheckoutPayload) => void;
41
44
  onConnectionError?: (error: unknown) => void;
42
45
  onPaymentTerminate?: () => void;
43
- onSdkError?: (error: Array<SdkError>) => void;
44
- onBankTransferSubmitted?: (payload: GlomoBankTransferPayload | null | undefined) => void;
45
- onPayViaBankCompleted?: (payload: {
46
- status: string;
47
- }) => void;
48
- onPayViaBankBankConnectionSuccessful?: (payload: GlomoPayViaBankConnectionPayload | null | undefined) => void;
46
+ onSdkError: (error: Array<SdkError>) => void;
47
+ onUserJourneyCompleted?: (payload: GlomoUserJourneyCompletedPayload) => void;
49
48
  onUserRefusedCameraPermissions?: () => void;
50
49
  devMode?: boolean;
51
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../src/types/checkout.ts"],"names":[],"mappings":"AAAA,oDAAoD;AAEpD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,uFAAuF;AACvF,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,iDAAiD;AACjD,MAAM,WAAW,wBAAwB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,oBAAoB,EAAE,MAAM,CAAC;CAChC;AAED,wEAAwE;AACxE,MAAM,WAAW,gCAAgC;IAC7C,cAAc,EAAE,MAAM,CAAC;IACvB,uBAAuB,EAAE,MAAM,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,sEAAsE;AACtE,MAAM,MAAM,cAAc,GACpB,OAAO,GACP,sBAAsB,GACtB,qBAAqB,GACrB,oBAAoB,GACpB,gBAAgB,GAChB,mBAAmB,GACnB,yBAAyB,GACzB,wBAAwB,CAAC;AAE/B;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9B,SAAS,EAAE,MAAM,cAAc,CAAC;CACnC;AAED,iFAAiF;AACjF,UAAU,sBAAsB;IAC5B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC1D,gBAAgB,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC1D,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IAC9C,uBAAuB,CAAC,EAAE,CAAC,OAAO,EAAE,wBAAwB,GAAG,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;IACzF,qBAAqB,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC9D,oCAAoC,CAAC,EAAE,CAAC,OAAO,EAAE,gCAAgC,GAAG,IAAI,GAAG,SAAS,KAAK,IAAI,CAAC;IAC9G,8BAA8B,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GACnD,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC"}
1
+ {"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../src/types/checkout.ts"],"names":[],"mappings":"AAAA,oDAAoD;AAEpD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAEnD,uFAAuF;AACvF,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,oBAAY,oBAAoB;IAC5B,uBAAuB,4BAA4B;IACnD,sBAAsB,2BAA2B;CACpD;AAED,0DAA0D;AAC1D,MAAM,WAAW,gCAAgC;IAC7C,WAAW,EAAE,oBAAoB,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,sEAAsE;AACtE,MAAM,MAAM,cAAc,GACpB,OAAO,GACP,sBAAsB,GACtB,qBAAqB,GACrB,oBAAoB,GACpB,gBAAgB,GAChB,mBAAmB,GACnB,yBAAyB,GACzB,wBAAwB,CAAC;AAE/B;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9B,SAAS,EAAE,MAAM,cAAc,CAAC;CACnC;AAED,iFAAiF;AACjF,UAAU,sBAAsB;IAC5B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC1D,gBAAgB,EAAE,CAAC,OAAO,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAC1D,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,IAAI,CAAC;IAC7C,sBAAsB,CAAC,EAAE,CAAC,OAAO,EAAE,gCAAgC,KAAK,IAAI,CAAC;IAC7E,8BAA8B,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,sBAAsB,GACnD,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,cAAc,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,cAAc,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC"}
@@ -1,3 +1,14 @@
1
1
  "use strict";
2
- /** Unified v3 type definitions for GlomoCheckout */
2
+ /** Unified v4 type definitions for GlomoCheckout */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ASYNC_PAYMENT_EVENTS = void 0;
5
+ /**
6
+ * Enum of asynchronous payment events that trigger the
7
+ * onUserJourneyCompleted callback. New events will be added
8
+ * here as additional flows are supported.
9
+ */
10
+ var ASYNC_PAYMENT_EVENTS;
11
+ (function (ASYNC_PAYMENT_EVENTS) {
12
+ ASYNC_PAYMENT_EVENTS["BANK_TRANSFER_SUBMITTED"] = "bank_transfer_submitted";
13
+ ASYNC_PAYMENT_EVENTS["PAY_VIA_BANK_COMPLETED"] = "pay_via_bank_completed";
14
+ })(ASYNC_PAYMENT_EVENTS || (exports.ASYNC_PAYMENT_EVENTS = ASYNC_PAYMENT_EVENTS = {}));