@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.
- package/CHANGELOG.md +79 -0
- package/MIGRATION.md +50 -0
- package/README.md +348 -316
- package/lib/config/base.d.ts +17 -11
- package/lib/config/base.d.ts.map +1 -1
- package/lib/config/base.js +19 -7
- package/lib/config/segment.js +3 -3
- package/lib/glomo-checkout.d.ts +8 -0
- package/lib/glomo-checkout.d.ts.map +1 -0
- package/lib/glomo-checkout.js +106 -0
- package/lib/glomo-lrs-checkout.js +9 -9
- package/lib/glomo-standard-checkout.d.ts +25 -0
- package/lib/glomo-standard-checkout.d.ts.map +1 -0
- package/lib/glomo-standard-checkout.js +229 -0
- package/lib/glomo-subscriptions-checkout.d.ts +8 -0
- package/lib/glomo-subscriptions-checkout.d.ts.map +1 -0
- package/lib/glomo-subscriptions-checkout.js +85 -0
- package/lib/index.d.ts +5 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -5
- package/lib/injections/index.d.ts +1 -0
- package/lib/injections/index.d.ts.map +1 -1
- package/lib/injections/index.js +2 -0
- package/lib/injections/webview-flow.injection.d.ts.map +1 -1
- package/lib/injections/webview-flow.injection.js +106 -69
- package/lib/injections/webview-main.injection.d.ts.map +1 -1
- package/lib/injections/webview-main.injection.js +112 -77
- package/lib/injections/webview-standard.injection.d.ts +3 -0
- package/lib/injections/webview-standard.injection.d.ts.map +1 -0
- package/lib/injections/webview-standard.injection.js +214 -0
- package/lib/services/order-type-fetcher.d.ts +28 -0
- package/lib/services/order-type-fetcher.d.ts.map +1 -0
- package/lib/services/order-type-fetcher.js +99 -0
- package/lib/types/checkout.d.ts +65 -0
- package/lib/types/checkout.d.ts.map +1 -0
- package/lib/types/checkout.js +3 -0
- package/lib/types/standard-checkout.d.ts +40 -0
- package/lib/types/standard-checkout.d.ts.map +1 -0
- package/lib/types/standard-checkout.js +3 -0
- package/lib/types/subscriptions-checkout.d.ts +29 -0
- package/lib/types/subscriptions-checkout.d.ts.map +1 -0
- package/lib/types/subscriptions-checkout.js +3 -0
- package/lib/use-glomo-checkout.d.ts +54 -0
- package/lib/use-glomo-checkout.d.ts.map +1 -0
- package/lib/use-glomo-checkout.js +261 -0
- package/lib/use-lrs-checkout.d.ts +9 -4
- package/lib/use-lrs-checkout.d.ts.map +1 -1
- package/lib/use-lrs-checkout.js +76 -93
- package/lib/use-standard-checkout.d.ts +74 -0
- package/lib/use-standard-checkout.d.ts.map +1 -0
- package/lib/use-standard-checkout.js +849 -0
- package/lib/utils/analytics.d.ts +188 -2
- package/lib/utils/analytics.d.ts.map +1 -1
- package/lib/utils/analytics.js +636 -22
- package/lib/utils/device-compliance.d.ts.map +1 -1
- package/lib/utils/device-compliance.js +3 -4
- package/lib/utils/validation.d.ts.map +1 -1
- package/lib/utils/validation.js +7 -6
- package/package.json +17 -5
- package/src/config/base.ts +36 -17
- package/src/config/segment.ts +3 -3
- package/src/glomo-checkout.tsx +147 -0
- package/src/glomo-lrs-checkout.tsx +9 -9
- package/src/glomo-standard-checkout.tsx +353 -0
- package/src/glomo-subscriptions-checkout.tsx +83 -0
- package/src/index.ts +13 -7
- package/src/injections/index.ts +2 -0
- package/src/injections/webview-flow.injection.ts +106 -69
- package/src/injections/webview-main.injection.ts +112 -77
- package/src/injections/webview-standard.injection.ts +211 -0
- package/src/services/order-type-fetcher.ts +86 -0
- package/src/types/checkout.ts +72 -0
- package/src/types/standard-checkout.ts +49 -0
- package/src/types/subscriptions-checkout.ts +31 -0
- package/src/use-glomo-checkout.tsx +369 -0
- package/src/use-lrs-checkout.tsx +91 -111
- package/src/use-standard-checkout.tsx +1203 -0
- package/src/utils/analytics.ts +908 -34
- package/src/utils/device-compliance.ts +3 -4
- package/src/utils/validation.ts +7 -8
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
*/
|
|
14
14
|
function getJailMonkey(): { isJailBroken: () => boolean } | null {
|
|
15
15
|
try {
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
17
16
|
const JailMonkey = require("jail-monkey");
|
|
18
17
|
if (JailMonkey && typeof JailMonkey.isJailBroken === "function") {
|
|
19
18
|
return JailMonkey;
|
|
@@ -39,7 +38,7 @@ export function checkDeviceCompliance(devMode: boolean = false): boolean | null
|
|
|
39
38
|
if (!JailMonkey) {
|
|
40
39
|
if (devMode) {
|
|
41
40
|
console.log(
|
|
42
|
-
"[
|
|
41
|
+
"[Glomo-RN-SDK] jail-monkey not available. Device compliance check skipped. " +
|
|
43
42
|
"Install jail-monkey for enhanced security compliance."
|
|
44
43
|
);
|
|
45
44
|
}
|
|
@@ -52,14 +51,14 @@ export function checkDeviceCompliance(devMode: boolean = false): boolean | null
|
|
|
52
51
|
const isCompromised = JailMonkey.isJailBroken();
|
|
53
52
|
if (devMode) {
|
|
54
53
|
console.log(
|
|
55
|
-
`[
|
|
54
|
+
`[Glomo-RN-SDK] Device compliance check: ${isCompromised ? "FAILED (device compromised)" : "PASSED"}`
|
|
56
55
|
);
|
|
57
56
|
}
|
|
58
57
|
return isCompromised;
|
|
59
58
|
} catch (error) {
|
|
60
59
|
if (devMode) {
|
|
61
60
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
62
|
-
console.error("[
|
|
61
|
+
console.error("[Glomo-RN-SDK] Error checking device compliance:", errorMessage);
|
|
63
62
|
}
|
|
64
63
|
// On error, allowing checkout to proceed (fail open strategy)
|
|
65
64
|
return null;
|
package/src/utils/validation.ts
CHANGED
|
@@ -60,14 +60,13 @@ export function isValidPaymentPayload(payload: unknown): payload is {
|
|
|
60
60
|
return false;
|
|
61
61
|
}
|
|
62
62
|
const p = payload as Record<string, unknown>;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
);
|
|
63
|
+
/**
|
|
64
|
+
* Accept payloads where orderId, paymentId, and signature are strings.
|
|
65
|
+
* Empty strings are allowed because some flows (e.g. open banking / pay via bank)
|
|
66
|
+
* send payment.success with empty fields when the payment completes on the
|
|
67
|
+
* bank's side before the checkout backend has resolved ids.
|
|
68
|
+
*/
|
|
69
|
+
return typeof p.orderId === "string" && typeof p.paymentId === "string" && typeof p.signature === "string";
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
/**
|