@glomopay/react-native-sdk 2.0.2 → 3.1.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 (80) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/MIGRATION.md +50 -0
  3. package/README.md +348 -316
  4. package/lib/config/base.d.ts +17 -11
  5. package/lib/config/base.d.ts.map +1 -1
  6. package/lib/config/base.js +19 -7
  7. package/lib/config/segment.js +3 -3
  8. package/lib/glomo-checkout.d.ts +8 -0
  9. package/lib/glomo-checkout.d.ts.map +1 -0
  10. package/lib/glomo-checkout.js +106 -0
  11. package/lib/glomo-lrs-checkout.js +9 -9
  12. package/lib/glomo-standard-checkout.d.ts +25 -0
  13. package/lib/glomo-standard-checkout.d.ts.map +1 -0
  14. package/lib/glomo-standard-checkout.js +229 -0
  15. package/lib/glomo-subscriptions-checkout.d.ts +8 -0
  16. package/lib/glomo-subscriptions-checkout.d.ts.map +1 -0
  17. package/lib/glomo-subscriptions-checkout.js +85 -0
  18. package/lib/index.d.ts +5 -4
  19. package/lib/index.d.ts.map +1 -1
  20. package/lib/index.js +7 -5
  21. package/lib/injections/index.d.ts +1 -0
  22. package/lib/injections/index.d.ts.map +1 -1
  23. package/lib/injections/index.js +2 -0
  24. package/lib/injections/webview-flow.injection.d.ts.map +1 -1
  25. package/lib/injections/webview-flow.injection.js +106 -69
  26. package/lib/injections/webview-main.injection.d.ts.map +1 -1
  27. package/lib/injections/webview-main.injection.js +112 -77
  28. package/lib/injections/webview-standard.injection.d.ts +3 -0
  29. package/lib/injections/webview-standard.injection.d.ts.map +1 -0
  30. package/lib/injections/webview-standard.injection.js +214 -0
  31. package/lib/services/order-type-fetcher.d.ts +28 -0
  32. package/lib/services/order-type-fetcher.d.ts.map +1 -0
  33. package/lib/services/order-type-fetcher.js +99 -0
  34. package/lib/types/checkout.d.ts +65 -0
  35. package/lib/types/checkout.d.ts.map +1 -0
  36. package/lib/types/checkout.js +3 -0
  37. package/lib/types/standard-checkout.d.ts +40 -0
  38. package/lib/types/standard-checkout.d.ts.map +1 -0
  39. package/lib/types/standard-checkout.js +3 -0
  40. package/lib/types/subscriptions-checkout.d.ts +29 -0
  41. package/lib/types/subscriptions-checkout.d.ts.map +1 -0
  42. package/lib/types/subscriptions-checkout.js +3 -0
  43. package/lib/use-glomo-checkout.d.ts +54 -0
  44. package/lib/use-glomo-checkout.d.ts.map +1 -0
  45. package/lib/use-glomo-checkout.js +261 -0
  46. package/lib/use-lrs-checkout.d.ts +9 -4
  47. package/lib/use-lrs-checkout.d.ts.map +1 -1
  48. package/lib/use-lrs-checkout.js +76 -93
  49. package/lib/use-standard-checkout.d.ts +74 -0
  50. package/lib/use-standard-checkout.d.ts.map +1 -0
  51. package/lib/use-standard-checkout.js +849 -0
  52. package/lib/utils/analytics.d.ts +188 -2
  53. package/lib/utils/analytics.d.ts.map +1 -1
  54. package/lib/utils/analytics.js +636 -22
  55. package/lib/utils/device-compliance.d.ts.map +1 -1
  56. package/lib/utils/device-compliance.js +3 -4
  57. package/lib/utils/validation.d.ts.map +1 -1
  58. package/lib/utils/validation.js +7 -6
  59. package/package.json +17 -5
  60. package/src/config/base.ts +36 -17
  61. package/src/config/segment.ts +3 -3
  62. package/src/glomo-checkout.tsx +147 -0
  63. package/src/glomo-lrs-checkout.tsx +9 -9
  64. package/src/glomo-standard-checkout.tsx +353 -0
  65. package/src/glomo-subscriptions-checkout.tsx +83 -0
  66. package/src/index.ts +13 -7
  67. package/src/injections/index.ts +2 -0
  68. package/src/injections/webview-flow.injection.ts +106 -69
  69. package/src/injections/webview-main.injection.ts +112 -77
  70. package/src/injections/webview-standard.injection.ts +211 -0
  71. package/src/services/order-type-fetcher.ts +86 -0
  72. package/src/types/checkout.ts +72 -0
  73. package/src/types/standard-checkout.ts +49 -0
  74. package/src/types/subscriptions-checkout.ts +31 -0
  75. package/src/use-glomo-checkout.tsx +369 -0
  76. package/src/use-lrs-checkout.tsx +91 -111
  77. package/src/use-standard-checkout.tsx +1203 -0
  78. package/src/utils/analytics.ts +908 -34
  79. package/src/utils/device-compliance.ts +3 -4
  80. package/src/utils/validation.ts +7 -8
@@ -0,0 +1,65 @@
1
+ /** Unified v3 type definitions for GlomoCheckout */
2
+ import { type GlomoServer } from "../config/base";
3
+ import { type SdkError } from "../utils/analytics";
4
+ /** The payload for a successful or failed payment (unified across LRS and standard) */
5
+ export interface GlomoCheckoutPayload {
6
+ orderId: string;
7
+ paymentId: string;
8
+ signature: string;
9
+ }
10
+ /** The payload for a bank transfer submission */
11
+ export interface GlomoBankTransferPayload {
12
+ orderId: string;
13
+ senderAccountNumber: string;
14
+ transactionReference: string;
15
+ }
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;
23
+ }
24
+ /** Unified checkout statuses - superset of LRS + standard statuses */
25
+ export type CheckoutStatus = "ready" | "detecting_order_type" | "payment_in_progress" | "payment_successful" | "payment_failed" | "payment_cancelled" | "bank_transfer_submitted" | "pay_via_bank_completed";
26
+ /**
27
+ * Ref handle for the unified checkout component.
28
+ * start() is async (returns Promise<boolean>) because the unified flow first detects order type
29
+ * via an API call before delegating to either the LRS or Standard inner component.
30
+ */
31
+ export interface GlomoCheckoutRef {
32
+ start: () => Promise<boolean>;
33
+ getStatus: () => CheckoutStatus;
34
+ }
35
+ /** Shared callback and configuration props for the unified checkout component */
36
+ interface GlomoCheckoutBaseProps {
37
+ server?: GlomoServer;
38
+ publicKey: string;
39
+ onPaymentSuccess: (payload: GlomoCheckoutPayload) => void;
40
+ onPaymentFailure: (payload: GlomoCheckoutPayload) => void;
41
+ onConnectionError?: (error: unknown) => void;
42
+ 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;
49
+ onUserRefusedCameraPermissions?: () => void;
50
+ devMode?: boolean;
51
+ }
52
+ /**
53
+ * Props for the unified checkout component.
54
+ * Exactly one of orderId or subscriptionId must be provided.
55
+ * TypeScript enforces this at compile time; a runtime guard in useGlomoCheckout catches JS consumers.
56
+ */
57
+ export type GlomoCheckoutProps = GlomoCheckoutBaseProps & ({
58
+ orderId: string;
59
+ subscriptionId?: never;
60
+ } | {
61
+ subscriptionId: string;
62
+ orderId?: never;
63
+ });
64
+ export {};
65
+ //# sourceMappingURL=checkout.d.ts.map
@@ -0,0 +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,qBAAq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,KAAK,CAAA;CAAE,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ /** Unified v3 type definitions for GlomoCheckout */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,40 @@
1
+ /** Type definitions for the Standard Checkout flow */
2
+ import { type GlomoServer } from "../config/base";
3
+ import { type SdkError } from "../utils/analytics";
4
+ import { type GlomoBankTransferPayload, type GlomoPayViaBankConnectionPayload } from "./checkout";
5
+ /** Standard checkout statuses */
6
+ export type StandardCheckoutStatus = "ready" | "payment_in_progress" | "payment_successful" | "payment_failed" | "payment_cancelled" | "bank_transfer_submitted" | "pay_via_bank_completed";
7
+ /** The payload for a successful or failed standard payment */
8
+ export interface GlomoStandardCheckoutPayload {
9
+ orderId: string;
10
+ paymentId: string;
11
+ signature: string;
12
+ }
13
+ /**
14
+ * Ref handle for the standard checkout component.
15
+ * start() is synchronous (returns boolean) because the standard flow does not need to detect
16
+ * order type - unlike the unified GlomoCheckoutRef whose start() is async (returns Promise<boolean>).
17
+ */
18
+ export interface GlomoStandardCheckoutRef {
19
+ start: () => boolean;
20
+ getStatus: () => StandardCheckoutStatus;
21
+ }
22
+ /** Props for the standard checkout component */
23
+ export interface GlomoStandardCheckoutProps {
24
+ server?: GlomoServer;
25
+ publicKey: string;
26
+ orderId: string;
27
+ onPaymentSuccess: (payload: GlomoStandardCheckoutPayload) => void;
28
+ onPaymentFailure: (payload: GlomoStandardCheckoutPayload) => void;
29
+ onConnectionError?: (error: unknown) => void;
30
+ onPaymentTerminate?: () => void;
31
+ onSdkError?: (error: Array<SdkError>) => void;
32
+ onBankTransferSubmitted?: (payload: GlomoBankTransferPayload | null | undefined) => void;
33
+ onPayViaBankCompleted?: (payload: {
34
+ status: string;
35
+ }) => void;
36
+ onPayViaBankBankConnectionSuccessful?: (payload: GlomoPayViaBankConnectionPayload | null | undefined) => void;
37
+ onUserRefusedCameraPermissions?: () => void;
38
+ devMode?: boolean;
39
+ }
40
+ //# sourceMappingURL=standard-checkout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standard-checkout.d.ts","sourceRoot":"","sources":["../../src/types/standard-checkout.ts"],"names":[],"mappings":"AAAA,sDAAsD;AAEtD,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,gCAAgC,EAAE,MAAM,YAAY,CAAC;AAElG,iCAAiC;AACjC,MAAM,MAAM,sBAAsB,GAC5B,OAAO,GACP,qBAAqB,GACrB,oBAAoB,GACpB,gBAAgB,GAChB,mBAAmB,GACnB,yBAAyB,GACzB,wBAAwB,CAAC;AAE/B,8DAA8D;AAC9D,MAAM,WAAW,4BAA4B;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACrC,KAAK,EAAE,MAAM,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,sBAAsB,CAAC;CAC3C;AAED,gDAAgD;AAChD,MAAM,WAAW,0BAA0B;IACvC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,CAAC,OAAO,EAAE,4BAA4B,KAAK,IAAI,CAAC;IAClE,gBAAgB,EAAE,CAAC,OAAO,EAAE,4BAA4B,KAAK,IAAI,CAAC;IAClE,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"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ /** Type definitions for the Standard Checkout flow */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,29 @@
1
+ /** Type definitions for the Subscriptions Checkout flow */
2
+ import { type GlomoServer } from "../config/base";
3
+ import { type SdkError } from "../utils/analytics";
4
+ import { type GlomoCheckoutPayload, type GlomoPayViaBankConnectionPayload } from "./checkout";
5
+ import { type StandardCheckoutStatus } from "./standard-checkout";
6
+ /** Props for the subscriptions checkout component */
7
+ export interface GlomoSubscriptionsCheckoutProps {
8
+ server?: GlomoServer;
9
+ publicKey: string;
10
+ subscriptionId: string;
11
+ onPaymentSuccess: (payload: GlomoCheckoutPayload) => void;
12
+ onPaymentFailure: (payload: GlomoCheckoutPayload) => void;
13
+ onConnectionError?: (error: unknown) => void;
14
+ onPaymentTerminate?: () => void;
15
+ onSdkError?: (error: Array<SdkError>) => void;
16
+ onPayViaBankBankConnectionSuccessful?: (payload: GlomoPayViaBankConnectionPayload | null | undefined) => void;
17
+ onUserRefusedCameraPermissions?: () => void;
18
+ devMode?: boolean;
19
+ }
20
+ /**
21
+ * Ref handle for the subscriptions checkout component.
22
+ * Same type as GlomoStandardCheckoutRef - start() is async at the unified level
23
+ * but delegates to the synchronous standard checkout start() internally.
24
+ */
25
+ export interface GlomoSubscriptionsCheckoutRef {
26
+ start: () => boolean;
27
+ getStatus: () => StandardCheckoutStatus;
28
+ }
29
+ //# sourceMappingURL=subscriptions-checkout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions-checkout.d.ts","sourceRoot":"","sources":["../../src/types/subscriptions-checkout.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAE3D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,gCAAgC,EAAE,MAAM,YAAY,CAAC;AAC9F,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,qDAAqD;AACrD,MAAM,WAAW,+BAA+B;IAC5C,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,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,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,WAAW,6BAA6B;IAC1C,KAAK,EAAE,MAAM,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,sBAAsB,CAAC;CAC3C"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ /** Type definitions for the Subscriptions Checkout flow */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Unified wrapper hook - detects order type (LRS vs Standard) via the order API
3
+ * and delegates to the appropriate inner checkout hook once resolved.
4
+ */
5
+ import { type GlomoCheckoutProps, type CheckoutStatus } from "./types/checkout";
6
+ import { type GlomoLrsCheckoutRef } from "./glomo-lrs-checkout";
7
+ import { type GlomoStandardCheckoutRef } from "./types/standard-checkout";
8
+ import { type GlomoSubscriptionsCheckoutRef } from "./types/subscriptions-checkout";
9
+ import { type OrderType } from "./services/order-type-fetcher";
10
+ /** Extended order type including subscriptions */
11
+ type ExtendedOrderType = OrderType | "subscriptions";
12
+ /**
13
+ * Public return type for useGlomoCheckout.
14
+ * Exposes only start() and getStatus() - no internal refs or state.
15
+ */
16
+ export interface UseGlomoCheckoutReturn {
17
+ start: () => Promise<boolean>;
18
+ getStatus: () => CheckoutStatus;
19
+ }
20
+ /**
21
+ * Internal return type - used by GlomoCheckout component.
22
+ * Not exported from the public API.
23
+ */
24
+ export interface UseGlomoCheckoutInternalReturn {
25
+ orderType: ExtendedOrderType | null;
26
+ detecting: boolean;
27
+ start: () => Promise<boolean>;
28
+ getStatus: () => CheckoutStatus;
29
+ innerLrsRef: React.RefObject<GlomoLrsCheckoutRef>;
30
+ innerStandardRef: React.RefObject<GlomoStandardCheckoutRef>;
31
+ innerSubscriptionsRef: React.RefObject<GlomoSubscriptionsCheckoutRef>;
32
+ props: GlomoCheckoutProps;
33
+ }
34
+ /**
35
+ * @deprecated Legacy hook - will be removed in a future major version.
36
+ *
37
+ * This hook does not provide reactive state. `getStatus()` returns a
38
+ * point-in-time snapshot and does not trigger re-renders on status changes.
39
+ * `start()` returns a promise identical to `GlomoCheckoutRef.start()`.
40
+ *
41
+ * Use the `GlomoCheckout` component with a ref instead:
42
+ *
43
+ * ```tsx
44
+ * const ref = useRef<GlomoCheckoutRef>(null);
45
+ * const started = await ref.current?.start();
46
+ * const status = ref.current?.getStatus();
47
+ * ```
48
+ */
49
+ export declare function useGlomoCheckout(props: GlomoCheckoutProps): UseGlomoCheckoutReturn;
50
+ export declare function useGlomoCheckout(props: GlomoCheckoutProps, internalOptions: {
51
+ _suppressDeprecationWarning: true;
52
+ }): UseGlomoCheckoutInternalReturn;
53
+ export {};
54
+ //# sourceMappingURL=use-glomo-checkout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-glomo-checkout.d.ts","sourceRoot":"","sources":["../src/use-glomo-checkout.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,EAAE,KAAK,kBAAkB,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChF,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AACpF,OAAO,EAAE,KAAK,SAAS,EAAkB,MAAM,+BAA+B,CAAC;AAU/E,kDAAkD;AAClD,KAAK,iBAAiB,GAAG,SAAS,GAAG,eAAe,CAAC;AAErD;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACnC,KAAK,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9B,SAAS,EAAE,MAAM,cAAc,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC3C,SAAS,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACpC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9B,SAAS,EAAE,MAAM,cAAc,CAAC;IAChC,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;IAClD,gBAAgB,EAAE,KAAK,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC;IAC5D,qBAAqB,EAAE,KAAK,CAAC,SAAS,CAAC,6BAA6B,CAAC,CAAC;IACtE,KAAK,EAAE,kBAAkB,CAAC;CAC7B;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,kBAAkB,GAAG,sBAAsB,CAAC;AACpF,wBAAgB,gBAAgB,CAC5B,KAAK,EAAE,kBAAkB,EACzB,eAAe,EAAE;IAAE,2BAA2B,EAAE,IAAI,CAAA;CAAE,GACvD,8BAA8B,CAAC"}
@@ -0,0 +1,261 @@
1
+ "use strict";
2
+ /**
3
+ * Unified wrapper hook - detects order type (LRS vs Standard) via the order API
4
+ * and delegates to the appropriate inner checkout hook once resolved.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.useGlomoCheckout = useGlomoCheckout;
8
+ const react_1 = require("react");
9
+ const order_type_fetcher_1 = require("./services/order-type-fetcher");
10
+ const validation_1 = require("./utils/validation");
11
+ const analytics_1 = require("./utils/analytics");
12
+ function useGlomoCheckout(props, internalOptions) {
13
+ var _a, _b;
14
+ const { server, publicKey, orderId, subscriptionId, onSdkError, devMode = false } = props;
15
+ // Order type resolved from the API - null until detection completes
16
+ const [orderType, setOrderType] = (0, react_1.useState)(null);
17
+ // Whether order type detection is in progress
18
+ const [detecting, setDetecting] = (0, react_1.useState)(false);
19
+ // Whether the props have a mutual exclusion error
20
+ const [propsError, setPropsError] = (0, react_1.useState)(false);
21
+ // Stabilizing onSdkError ref to avoid re-running effects on inline callback changes
22
+ const onSdkErrorRef = (0, react_1.useRef)(onSdkError);
23
+ onSdkErrorRef.current = onSdkError;
24
+ // One-time deprecation warning for direct merchant usage
25
+ const suppressWarning = (_a = internalOptions === null || internalOptions === void 0 ? void 0 : internalOptions._suppressDeprecationWarning) !== null && _a !== void 0 ? _a : false;
26
+ const mockMode = (_b = publicKey === null || publicKey === void 0 ? void 0 : publicKey.toLowerCase().startsWith("test_")) !== null && _b !== void 0 ? _b : false;
27
+ const hasWarnedRef = (0, react_1.useRef)(false);
28
+ (0, react_1.useEffect)(() => {
29
+ if (!hasWarnedRef.current && !suppressWarning) {
30
+ hasWarnedRef.current = true;
31
+ console.warn("[Glomo-RN-SDK] useGlomoCheckout is deprecated and will be removed in a future major version. " +
32
+ "Use the GlomoCheckout component with a ref instead. " +
33
+ "This hook does not provide reactive state - getStatus() is a point-in-time snapshot, not a reactive value.");
34
+ (0, analytics_1.trackUseOfUnsupportedFunctionality)("useGlomoCheckout", orderId !== null && orderId !== void 0 ? orderId : subscriptionId, publicKey, devMode, mockMode, "");
35
+ }
36
+ }, [suppressWarning, orderId, subscriptionId, publicKey, devMode, mockMode]);
37
+ // Refs for the inner LRS, Standard, and Subscriptions checkout components
38
+ const innerLrsRef = (0, react_1.useRef)(null);
39
+ const innerStandardRef = (0, react_1.useRef)(null);
40
+ const innerSubscriptionsRef = (0, react_1.useRef)(null);
41
+ /** Mutual exclusion guard - firing onSdkError if both or neither id is provided */
42
+ (0, react_1.useEffect)(() => {
43
+ const hasBoth = Boolean(orderId) && Boolean(subscriptionId);
44
+ const hasNeither = !orderId && !subscriptionId;
45
+ if (hasBoth) {
46
+ setPropsError(true);
47
+ (0, validation_1.safeCallback)(onSdkErrorRef.current, [[{ type: "validation_error", message: "Provide either orderId or subscriptionId, not both" }]], "onSdkError", devMode);
48
+ }
49
+ else if (hasNeither) {
50
+ setPropsError(true);
51
+ (0, validation_1.safeCallback)(onSdkErrorRef.current, [[{ type: "validation_error", message: "Provide orderId or subscriptionId" }]], "onSdkError", devMode);
52
+ }
53
+ else {
54
+ setPropsError(false);
55
+ }
56
+ }, [orderId, subscriptionId, devMode]);
57
+ /**
58
+ * Tracking whether start() has been called and the inner component needs to be auto-started.
59
+ * This bridges the gap between order type resolution (async) and inner component mount (next render).
60
+ */
61
+ const pendingStartRef = (0, react_1.useRef)(false);
62
+ /**
63
+ * Generation counter for stale fetch detection.
64
+ * Incremented on every start() call and on orderId/publicKey changes. After fetchOrderType
65
+ * resolves, the result is discarded if the generation has moved on (props changed mid-flight).
66
+ */
67
+ const fetchGenerationRef = (0, react_1.useRef)(0);
68
+ /**
69
+ * Holds the resolve function for the pending start() promise.
70
+ * This allows the useEffect that auto-starts the inner component to resolve the merchant's
71
+ * awaited promise with the actual result of the inner start().
72
+ */
73
+ const pendingStartResolveRef = (0, react_1.useRef)(null);
74
+ // Deriving the unified checkout status from the inner component's status
75
+ const getStatus = (0, react_1.useCallback)(() => {
76
+ if (detecting) {
77
+ return "detecting_order_type";
78
+ }
79
+ // Delegating to the inner component's getStatus() once order type is resolved
80
+ if (orderType === "lrs" && innerLrsRef.current) {
81
+ return innerLrsRef.current.getStatus();
82
+ }
83
+ if (orderType === "standard" && innerStandardRef.current) {
84
+ return innerStandardRef.current.getStatus();
85
+ }
86
+ if (orderType === "subscriptions" && innerSubscriptionsRef.current) {
87
+ return innerSubscriptionsRef.current.getStatus();
88
+ }
89
+ return "ready";
90
+ }, [detecting, orderType]);
91
+ /**
92
+ * Initiator for the unified checkout flow.
93
+ * Validates inputs, calls the order type detection API, and marks the inner component for auto-start.
94
+ */
95
+ const start = (0, react_1.useCallback)(async () => {
96
+ // If a previous start() call is still pending, resolve it as false before proceeding
97
+ if (pendingStartResolveRef.current) {
98
+ pendingStartResolveRef.current(false);
99
+ pendingStartResolveRef.current = null;
100
+ }
101
+ if (devMode) {
102
+ console.log("[Glomo-RN-SDK] start() called");
103
+ }
104
+ // Aborting if mutual exclusion guard detected a props error
105
+ if (propsError) {
106
+ if (devMode) {
107
+ console.error("[Glomo-RN-SDK] start() aborted: invalid orderId/subscriptionId combination");
108
+ }
109
+ return false;
110
+ }
111
+ // Validating inputs before making the API call
112
+ const errors = [];
113
+ if (!(0, validation_1.isValidPublicKey)(publicKey)) {
114
+ errors.push({
115
+ type: "validation_error",
116
+ message: "Invalid publicKey: must start with 'live_', 'mock_', or 'test_' and be a valid string",
117
+ field: "publicKey",
118
+ });
119
+ }
120
+ /**
121
+ * For subscriptions flow, skipping orderId validation entirely - GlomoSubscriptionsCheckout
122
+ * owns subscriptionId validation (trim, empty, prefix). For order flow, validating orderId.
123
+ */
124
+ if (!subscriptionId && !(0, validation_1.isValidOrderId)(orderId)) {
125
+ errors.push({
126
+ type: "validation_error",
127
+ message: "Invalid orderId: must start with 'order_' and be a valid string",
128
+ field: "orderId",
129
+ });
130
+ }
131
+ // Reporting validation errors and aborting if any
132
+ if (errors.length > 0) {
133
+ if (devMode) {
134
+ console.error("[Glomo-RN-SDK] Validation failed.");
135
+ }
136
+ (0, validation_1.safeCallback)(onSdkError, [errors], "onSdkError", devMode);
137
+ return false;
138
+ }
139
+ /**
140
+ * For subscriptions, orderType is already "subscriptions" and the inner component is mounted.
141
+ * Calling start() directly - no promise/effect bridge needed since no async detection occurs.
142
+ */
143
+ if (subscriptionId) {
144
+ if (innerSubscriptionsRef.current) {
145
+ const started = innerSubscriptionsRef.current.start();
146
+ if (devMode) {
147
+ console.log(`[Glomo-RN-SDK] Subscriptions inner start() returned: ${started}`);
148
+ }
149
+ return started;
150
+ }
151
+ if (devMode) {
152
+ console.error("[Glomo-RN-SDK] Subscriptions component not mounted");
153
+ }
154
+ return false;
155
+ }
156
+ // Detecting order type via the API
157
+ setDetecting(true);
158
+ const thisGeneration = ++fetchGenerationRef.current;
159
+ if (devMode) {
160
+ console.log("[Glomo-RN-SDK] Detecting order type...");
161
+ }
162
+ (0, analytics_1.trackOrderTypeDetectionStarted)(orderId, publicKey, devMode);
163
+ const result = await (0, order_type_fetcher_1.fetchOrderType)({ orderId: orderId, publicKey, server, devMode });
164
+ // Discarding stale result if props changed while the fetch was in flight
165
+ if (thisGeneration !== fetchGenerationRef.current) {
166
+ if (devMode) {
167
+ console.log("[Glomo-RN-SDK] Discarding stale order type result (props changed mid-flight)");
168
+ }
169
+ return false;
170
+ }
171
+ setDetecting(false);
172
+ // Handling detection failure
173
+ if (!result.success) {
174
+ if (devMode) {
175
+ console.error(`[Glomo-RN-SDK] Order type detection failed: ${result.error}`);
176
+ }
177
+ (0, analytics_1.trackOrderTypeDetectionFailed)(orderId, publicKey, result.error, devMode);
178
+ (0, validation_1.safeCallback)(onSdkError, [[{ type: "validation_error", message: result.error }]], "onSdkError", devMode);
179
+ return false;
180
+ }
181
+ if (devMode) {
182
+ console.log(`[Glomo-RN-SDK] Order type resolved: ${result.orderType}`);
183
+ }
184
+ (0, analytics_1.trackOrderTypeDetectionResolved)(orderId, publicKey, result.orderType, devMode);
185
+ // Setting the resolved order type - this triggers a re-render that mounts the inner component
186
+ setOrderType(result.orderType);
187
+ // Returning a promise that resolves only when the inner component's start() completes
188
+ return new Promise((resolve) => {
189
+ pendingStartResolveRef.current = resolve;
190
+ pendingStartRef.current = true;
191
+ });
192
+ }, [devMode, publicKey, orderId, subscriptionId, server, onSdkError, propsError]);
193
+ /**
194
+ * Auto-starting the inner component after order type is resolved and the component has rendered.
195
+ * The pendingStartRef bridges the async gap: start() sets it, and this effect fires after
196
+ * the inner component mounts in the next render cycle.
197
+ */
198
+ (0, react_1.useEffect)(() => {
199
+ if (!pendingStartRef.current || !orderType) {
200
+ return;
201
+ }
202
+ // Forwarding start() to the appropriate inner component
203
+ let started = false;
204
+ if (orderType === "lrs" && innerLrsRef.current) {
205
+ pendingStartRef.current = false;
206
+ started = innerLrsRef.current.start();
207
+ if (devMode) {
208
+ console.log(`[Glomo-RN-SDK] LRS inner start() returned: ${started}`);
209
+ }
210
+ }
211
+ else if (orderType === "standard" && innerStandardRef.current) {
212
+ pendingStartRef.current = false;
213
+ started = innerStandardRef.current.start();
214
+ if (devMode) {
215
+ console.log(`[Glomo-RN-SDK] Standard inner start() returned: ${started}`);
216
+ }
217
+ }
218
+ else if (orderType === "subscriptions") {
219
+ // No-op: subscription start() calls the inner component directly (not via this effect bridge).
220
+ // If we reach here, pendingStartRef was set unexpectedly - resolve false defensively.
221
+ pendingStartRef.current = false;
222
+ }
223
+ // Resolving the merchant's awaited start() promise with the inner component's result
224
+ if (pendingStartResolveRef.current) {
225
+ pendingStartResolveRef.current(started);
226
+ pendingStartResolveRef.current = null;
227
+ }
228
+ }, [orderType, devMode]);
229
+ /**
230
+ * Resetting order type state when orderId, subscriptionId, or publicKey changes.
231
+ * For subscriptions, setting orderType to "subscriptions" directly (no API call needed).
232
+ * For orders, resetting to null to force re-detection on next start().
233
+ * Single effect owns all orderType transitions to avoid race conditions.
234
+ */
235
+ (0, react_1.useEffect)(() => {
236
+ // Invalidating any in-flight fetchOrderType call so its stale result is discarded
237
+ fetchGenerationRef.current++;
238
+ if (pendingStartResolveRef.current) {
239
+ pendingStartResolveRef.current(false);
240
+ pendingStartResolveRef.current = null;
241
+ }
242
+ setDetecting(false);
243
+ pendingStartRef.current = false;
244
+ if (subscriptionId && !orderId) {
245
+ setOrderType("subscriptions");
246
+ }
247
+ else {
248
+ setOrderType(null);
249
+ }
250
+ }, [orderId, subscriptionId, publicKey]);
251
+ return {
252
+ orderType,
253
+ detecting,
254
+ start,
255
+ getStatus,
256
+ innerLrsRef,
257
+ innerStandardRef,
258
+ innerSubscriptionsRef,
259
+ props,
260
+ };
261
+ }
@@ -1,11 +1,16 @@
1
1
  /** Main SDK hook for the GlomoPay LRS Checkout flow */
2
2
  import React from "react";
3
3
  import { type NativeSyntheticEvent } from "react-native";
4
- import { WebViewNavigation, WebViewMessageEvent, type WebView } from "react-native-webview";
5
- import { type GlomoLrsServer } from "./config/base";
4
+ import { type WebViewNavigation, type WebViewMessageEvent, type WebView } from "react-native-webview";
5
+ import { type GlomoServer } from "./config/base";
6
6
  import { type SdkError } from "./utils/analytics";
7
7
  /** LRS checkout statuses */
8
- export type LrsCheckoutStatus = "ready" | "payment_in_progress" | "payment_successful" | "payment_failed" | "payment_cancelled";
8
+ export type LrsCheckoutStatus = "ready" | "payment_in_progress" | "payment_successful" | "payment_failed" | "payment_cancelled"
9
+ /**
10
+ * These are not currently emitted by LRS flows, but I'm intentionally including them so that the SDK is forwards compatible.
11
+ * The SDK would also then effectively handle these events without a patch if LRS gains bank transfer / pay-via-bank support in the future.
12
+ */
13
+ | "bank_transfer_submitted" | "pay_via_bank_completed";
9
14
  /**
10
15
  * Tracks whether the education carousel WebView has signalled that it has content to show.
11
16
  * - "pending": waiting for the carousel to report its state (default/reset value)
@@ -20,7 +25,7 @@ export interface GlomoLrsCheckoutPayload {
20
25
  }
21
26
  /** The options for the useLrsCheckout hook */
22
27
  export interface UseLrsCheckoutOptions {
23
- server?: GlomoLrsServer;
28
+ server?: GlomoServer;
24
29
  publicKey: string;
25
30
  orderId: string;
26
31
  onPaymentSuccess: (payload: GlomoLrsCheckoutPayload) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"use-lrs-checkout.d.ts","sourceRoot":"","sources":["../src/use-lrs-checkout.tsx"],"names":[],"mappings":"AAAA,uDAAuD;AAEvD,OAAO,KAA4D,MAAM,OAAO,CAAC;AACjF,OAAO,EAAY,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEnE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,KAAK,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAI5F,OAAO,EAAuB,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAGzE,OAAO,EAaH,KAAK,QAAQ,EAChB,MAAM,mBAAmB,CAAC;AAE3B,4BAA4B;AAC5B,MAAM,MAAM,iBAAiB,GAEvB,OAAO,GAGP,qBAAqB,GAGrB,oBAAoB,GAGpB,gBAAgB,GAGhB,mBAAmB,CAAC;AAE1B;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,YAAY,CAAC;AAE9D,qDAAqD;AACrD,MAAM,WAAW,uBAAuB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED,8CAA8C;AAC9C,MAAM,WAAW,qBAAqB;IAClC,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CA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