@glomopay/react-native-sdk 2.0.1 → 3.0.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 (71) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +261 -314
  3. package/lib/config/base.d.ts +17 -11
  4. package/lib/config/base.d.ts.map +1 -1
  5. package/lib/config/base.js +19 -7
  6. package/lib/config/segment.js +3 -3
  7. package/lib/glomo-checkout.d.ts +8 -0
  8. package/lib/glomo-checkout.d.ts.map +1 -0
  9. package/lib/glomo-checkout.js +69 -0
  10. package/lib/glomo-lrs-checkout.d.ts.map +1 -1
  11. package/lib/glomo-lrs-checkout.js +9 -9
  12. package/lib/glomo-standard-checkout.d.ts +5 -0
  13. package/lib/glomo-standard-checkout.d.ts.map +1 -0
  14. package/lib/glomo-standard-checkout.js +218 -0
  15. package/lib/index.d.ts +5 -4
  16. package/lib/index.d.ts.map +1 -1
  17. package/lib/index.js +7 -5
  18. package/lib/injections/index.d.ts +1 -0
  19. package/lib/injections/index.d.ts.map +1 -1
  20. package/lib/injections/index.js +2 -0
  21. package/lib/injections/webview-flow.injection.d.ts.map +1 -1
  22. package/lib/injections/webview-flow.injection.js +106 -69
  23. package/lib/injections/webview-main.injection.d.ts.map +1 -1
  24. package/lib/injections/webview-main.injection.js +112 -77
  25. package/lib/injections/webview-standard.injection.d.ts +3 -0
  26. package/lib/injections/webview-standard.injection.d.ts.map +1 -0
  27. package/lib/injections/webview-standard.injection.js +214 -0
  28. package/lib/services/order-type-fetcher.d.ts +28 -0
  29. package/lib/services/order-type-fetcher.d.ts.map +1 -0
  30. package/lib/services/order-type-fetcher.js +99 -0
  31. package/lib/types/checkout.d.ts +53 -0
  32. package/lib/types/checkout.d.ts.map +1 -0
  33. package/lib/types/checkout.js +3 -0
  34. package/lib/types/standard-checkout.d.ts +40 -0
  35. package/lib/types/standard-checkout.d.ts.map +1 -0
  36. package/lib/types/standard-checkout.js +3 -0
  37. package/lib/use-glomo-checkout.d.ts +24 -0
  38. package/lib/use-glomo-checkout.d.ts.map +1 -0
  39. package/lib/use-glomo-checkout.js +182 -0
  40. package/lib/use-lrs-checkout.d.ts +9 -4
  41. package/lib/use-lrs-checkout.d.ts.map +1 -1
  42. package/lib/use-lrs-checkout.js +91 -93
  43. package/lib/use-standard-checkout.d.ts +65 -0
  44. package/lib/use-standard-checkout.d.ts.map +1 -0
  45. package/lib/use-standard-checkout.js +832 -0
  46. package/lib/utils/analytics.d.ts +102 -1
  47. package/lib/utils/analytics.d.ts.map +1 -1
  48. package/lib/utils/analytics.js +294 -21
  49. package/lib/utils/device-compliance.js +3 -3
  50. package/lib/utils/validation.d.ts.map +1 -1
  51. package/lib/utils/validation.js +7 -6
  52. package/package.json +3 -2
  53. package/src/config/base.ts +36 -17
  54. package/src/config/segment.ts +3 -3
  55. package/src/glomo-checkout.tsx +73 -0
  56. package/src/glomo-lrs-checkout.tsx +13 -10
  57. package/src/glomo-standard-checkout.tsx +324 -0
  58. package/src/index.ts +13 -7
  59. package/src/injections/index.ts +2 -0
  60. package/src/injections/webview-flow.injection.ts +106 -69
  61. package/src/injections/webview-main.injection.ts +112 -77
  62. package/src/injections/webview-standard.injection.ts +211 -0
  63. package/src/services/order-type-fetcher.ts +86 -0
  64. package/src/types/checkout.ts +65 -0
  65. package/src/types/standard-checkout.ts +49 -0
  66. package/src/use-glomo-checkout.tsx +228 -0
  67. package/src/use-lrs-checkout.tsx +115 -111
  68. package/src/use-standard-checkout.tsx +1185 -0
  69. package/src/utils/analytics.ts +431 -22
  70. package/src/utils/device-compliance.ts +3 -3
  71. package/src/utils/validation.ts +7 -8
package/CHANGELOG.md ADDED
@@ -0,0 +1,64 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [3.0.1] - 2026-06-02
9
+
10
+ ### Added
11
+
12
+ - **`onPayViaBankBankConnectionSuccessful` callback** - fires when a bank connection is successfully established during the pay via bank flow. Provides `GlomoPayViaBankConnectionPayload` (`bankIdentifier`, `cooldownPeriodInMinutes`, `bankName`, `bankImageSrc`, `bankImageAlt`). This is informational only and does not change the checkout status.
13
+ - **`GlomoPayViaBankConnectionPayload` type** - new exported type for the bank connection callback payload.
14
+
15
+ ### Fixed
16
+
17
+ - Repeat `start()` calls with the same orderId no longer fail silently due to cached API responses.
18
+ - Checkout dismissal now fully resets internal state, preventing stale UI on re-open.
19
+
20
+ ## [3.0.0] - 2026-06-01
21
+
22
+ ### Breaking Changes
23
+
24
+ - **New unified component**: `GlomoLrsCheckout` has been replaced by `GlomoCheckout`. The new component automatically detects the order type (LRS or Standard) and renders the appropriate checkout flow.
25
+ - **`start()` is now async**: Returns `Promise<boolean>` instead of `boolean`. Update call sites to `await`:
26
+ ```tsx
27
+ const started = await checkoutRef.current?.start();
28
+ ```
29
+ - **Renamed exports**:
30
+ | v2 | v3 |
31
+ | ------------------------- | ------------------------ |
32
+ | `GlomoLrsCheckout` | `GlomoCheckout` |
33
+ | `GlomoLrsCheckoutRef` | `GlomoCheckoutRef` |
34
+ | `GlomoLrsCheckoutProps` | `GlomoCheckoutProps` |
35
+ | `GlomoLrsCheckoutPayload` | `GlomoCheckoutPayload` |
36
+ | `GlomoLrsServer` | `GlomoServer` |
37
+ | `LrsCheckoutStatus` | `CheckoutStatus` |
38
+ | `useLrsCheckout` | `useGlomoCheckout` |
39
+ - **Removed exports**: v2 LRS-specific names are no longer available.
40
+
41
+ ### Added
42
+
43
+ - **Standard checkout support** - cards, bank transfers, pay via bank, and camera-based bank authentication flows, all through the same `GlomoCheckout` component. No integration changes needed - the order type is detected automatically.
44
+ - **`onBankTransferSubmitted` callback** - fires when the user submits bank transfer details in a standard checkout flow. Provides `GlomoBankTransferPayload` (`orderId`, `senderAccountNumber`, `transactionReference`).
45
+ - **`onPayViaBankCompleted` callback** - fires when the pay via bank journey completes. Provides `{ status: string }`.
46
+ - **`onUserRefusedCameraPermissions` callback** - fires when the user denies camera access during bank authentication (Android only). The checkout is dismissed automatically.
47
+ - **`detecting_order_type` checkout status** - returned by `getStatus()` while the SDK determines the order type.
48
+ - **`bank_transfer_submitted` checkout status** - indicates a bank transfer has been submitted and is awaiting confirmation.
49
+ - **`pay_via_bank_completed` checkout status** - indicates the pay via bank flow has completed.
50
+ - **`GlomoBankTransferPayload` type** - new exported type for the bank transfer callback payload.
51
+ - **`useGlomoCheckout` hook** - for advanced integration patterns needing direct access to order type detection state.
52
+
53
+ ### Platform Configuration (New)
54
+
55
+ Checkout flows with camera-based bank authentication require native permissions:
56
+
57
+ - **Android** (`AndroidManifest.xml`): `<uses-permission android:name="android.permission.CAMERA" />`
58
+ - **iOS** (`Info.plist`): `NSCameraUsageDescription` key
59
+
60
+ These are only required for flows that use camera-based bank authentication.
61
+
62
+ ## [2.0.2]
63
+
64
+ Last v2 release.