@juspay-tech/react-native-hyperswitch 0.2.1 → 0.3.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 (183) hide show
  1. package/android/build.gradle +4 -10
  2. package/android/src/main/AndroidManifest.xml +0 -19
  3. package/android/src/main/assets/hyperswitch.bundle +172 -162
  4. package/android/src/main/java/com/hyperswitchsdkreactnative/internal/ReactFragment.kt +35 -1
  5. package/android/src/main/java/com/hyperswitchsdkreactnative/modules/HyperswitchSdkNativeModule.kt +30 -6
  6. package/android/src/main/java/com/hyperswitchsdkreactnative/provider/HyperProvider.kt +3 -2
  7. package/ios/hyperswitchSDK/Core/NativeModule/OTAServices.swift +1 -1
  8. package/ios/hyperswitchSDK/Core/Resources/hyperswitch.bundle +172 -162
  9. package/lib/bs/src/context/HyperProvider-JuspayTechReactNativeHyperswitch.cmt +0 -0
  10. package/lib/bs/src/hooks/useHyper-JuspayTechReactNativeHyperswitch.cmt +0 -0
  11. package/lib/bs/src/modules/NativeHyperswitchSdk-JuspayTechReactNativeHyperswitch.cmt +0 -0
  12. package/lib/bs/src/types/PaymentSheetConfiguration-JuspayTechReactNativeHyperswitch.cmt +0 -0
  13. package/lib/commonjs/index.bundle.js +11 -0
  14. package/lib/commonjs/index.bundle.js.map +1 -0
  15. package/lib/module/index.bundle.js +11 -0
  16. package/lib/module/index.bundle.js.map +1 -0
  17. package/lib/typescript/{commonjs/babel.config.d.ts.map → babel.config.d.ts.map} +1 -1
  18. package/lib/typescript/{commonjs/eslint.config.d.mts.map → eslint.config.d.mts.map} +1 -1
  19. package/lib/typescript/rollup.config.d.ts +23 -0
  20. package/lib/typescript/rollup.config.d.ts.map +1 -0
  21. package/lib/typescript/{commonjs/scripts → scripts}/bootstrap.d.ts.map +1 -1
  22. package/lib/typescript/src/context/HyperProvider.gen.d.ts.map +1 -0
  23. package/lib/typescript/src/context/HyperProvider.res.d.ts.map +1 -0
  24. package/lib/typescript/src/hooks/useHyper.gen.d.ts.map +1 -0
  25. package/lib/typescript/src/hooks/useHyper.res.d.ts.map +1 -0
  26. package/lib/typescript/src/index.d.ts.map +1 -0
  27. package/lib/typescript/src/modules/NativeHyperswitchSdk.gen.d.ts.map +1 -0
  28. package/lib/typescript/src/modules/NativeHyperswitchSdk.res.d.ts.map +1 -0
  29. package/lib/typescript/src/shims/Js.shim.d.ts.map +1 -0
  30. package/lib/typescript/src/specs/ApplePayButtonNativeComponent.d.ts.map +1 -0
  31. package/lib/typescript/src/specs/GooglePayButtonNativeComponent.android.d.ts.map +1 -0
  32. package/lib/typescript/src/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts.map +1 -0
  33. package/lib/typescript/src/specs/NativeHyperswitchSdkNative.d.ts.map +1 -0
  34. package/lib/typescript/src/specs/NativeHyperswitchSdkReactNative.d.ts.map +1 -0
  35. package/lib/typescript/src/types/PaymentSheetConfiguration.gen.d.ts.map +1 -0
  36. package/lib/typescript/src/types/PaymentSheetConfiguration.res.d.ts.map +1 -0
  37. package/package.json +27 -27
  38. package/rescript.json +31 -0
  39. package/tsconfig.build.json +20 -0
  40. package/android/src/main/java/com/hyperswitchsdkreactnative/activity/RedirectActivity.kt +0 -39
  41. package/android/src/main/java/io/hyperswitch/logs/CrashHandler.kt +0 -29
  42. package/android/src/main/java/io/hyperswitch/logs/Debouncer.kt +0 -20
  43. package/android/src/main/java/io/hyperswitch/logs/HyperLogManager.kt +0 -113
  44. package/android/src/main/java/io/hyperswitch/logs/LogData.kt +0 -159
  45. package/android/src/main/java/io/hyperswitch/logs/LogFileManager.kt +0 -60
  46. package/android/src/main/java/io/hyperswitch/networking/HyperNetworking.kt +0 -73
  47. package/lib/commonjs/context/HyperProvider.gen.js +0 -16
  48. package/lib/commonjs/context/HyperProvider.gen.js.map +0 -1
  49. package/lib/commonjs/context/HyperProvider.res +0 -78
  50. package/lib/commonjs/context/HyperProvider.res.js +0 -98
  51. package/lib/commonjs/context/HyperProvider.res.js.map +0 -1
  52. package/lib/commonjs/hooks/useHyper.gen.js +0 -15
  53. package/lib/commonjs/hooks/useHyper.gen.js.map +0 -1
  54. package/lib/commonjs/hooks/useHyper.res +0 -142
  55. package/lib/commonjs/hooks/useHyper.res.js +0 -152
  56. package/lib/commonjs/hooks/useHyper.res.js.map +0 -1
  57. package/lib/commonjs/index.js +0 -26
  58. package/lib/commonjs/index.js.map +0 -1
  59. package/lib/commonjs/modules/NativeHyperswitchSdk.gen.js +0 -6
  60. package/lib/commonjs/modules/NativeHyperswitchSdk.gen.js.map +0 -1
  61. package/lib/commonjs/modules/NativeHyperswitchSdk.res +0 -55
  62. package/lib/commonjs/modules/NativeHyperswitchSdk.res.js +0 -14
  63. package/lib/commonjs/modules/NativeHyperswitchSdk.res.js.map +0 -1
  64. package/lib/commonjs/package.json +0 -1
  65. package/lib/commonjs/shims/Js.shim.js +0 -2
  66. package/lib/commonjs/shims/Js.shim.js.map +0 -1
  67. package/lib/commonjs/specs/ApplePayButtonNativeComponent.ts +0 -11
  68. package/lib/commonjs/specs/GooglePayButtonNativeComponent.android.js +0 -10
  69. package/lib/commonjs/specs/GooglePayButtonNativeComponent.android.js.map +0 -1
  70. package/lib/commonjs/specs/HyperswitchSdkReactNativeViewNativeComponent.ts +0 -10
  71. package/lib/commonjs/specs/NativeHyperswitchSdkNative.js +0 -9
  72. package/lib/commonjs/specs/NativeHyperswitchSdkNative.js.map +0 -1
  73. package/lib/commonjs/specs/NativeHyperswitchSdkReactNative.js +0 -9
  74. package/lib/commonjs/specs/NativeHyperswitchSdkReactNative.js.map +0 -1
  75. package/lib/commonjs/types/PaymentSheetConfiguration.gen.js +0 -2
  76. package/lib/commonjs/types/PaymentSheetConfiguration.gen.js.map +0 -1
  77. package/lib/commonjs/types/PaymentSheetConfiguration.res +0 -215
  78. package/lib/commonjs/types/PaymentSheetConfiguration.res.js +0 -4
  79. package/lib/commonjs/types/PaymentSheetConfiguration.res.js.map +0 -1
  80. package/lib/module/context/HyperProvider.gen.js +0 -11
  81. package/lib/module/context/HyperProvider.gen.js.map +0 -1
  82. package/lib/module/context/HyperProvider.res +0 -78
  83. package/lib/module/context/HyperProvider.res.js +0 -91
  84. package/lib/module/context/HyperProvider.res.js.map +0 -1
  85. package/lib/module/hooks/useHyper.gen.js +0 -10
  86. package/lib/module/hooks/useHyper.gen.js.map +0 -1
  87. package/lib/module/hooks/useHyper.res +0 -142
  88. package/lib/module/hooks/useHyper.res.js +0 -142
  89. package/lib/module/hooks/useHyper.res.js.map +0 -1
  90. package/lib/module/index.js +0 -5
  91. package/lib/module/index.js.map +0 -1
  92. package/lib/module/modules/NativeHyperswitchSdk.gen.js +0 -4
  93. package/lib/module/modules/NativeHyperswitchSdk.gen.js.map +0 -1
  94. package/lib/module/modules/NativeHyperswitchSdk.res +0 -55
  95. package/lib/module/modules/NativeHyperswitchSdk.res.js +0 -9
  96. package/lib/module/modules/NativeHyperswitchSdk.res.js.map +0 -1
  97. package/lib/module/package.json +0 -1
  98. package/lib/module/shims/Js.shim.js +0 -2
  99. package/lib/module/shims/Js.shim.js.map +0 -1
  100. package/lib/module/specs/ApplePayButtonNativeComponent.ts +0 -11
  101. package/lib/module/specs/GooglePayButtonNativeComponent.android.js +0 -5
  102. package/lib/module/specs/GooglePayButtonNativeComponent.android.js.map +0 -1
  103. package/lib/module/specs/HyperswitchSdkReactNativeViewNativeComponent.ts +0 -10
  104. package/lib/module/specs/NativeHyperswitchSdkNative.js +0 -5
  105. package/lib/module/specs/NativeHyperswitchSdkNative.js.map +0 -1
  106. package/lib/module/specs/NativeHyperswitchSdkReactNative.js +0 -5
  107. package/lib/module/specs/NativeHyperswitchSdkReactNative.js.map +0 -1
  108. package/lib/module/types/PaymentSheetConfiguration.gen.js +0 -2
  109. package/lib/module/types/PaymentSheetConfiguration.gen.js.map +0 -1
  110. package/lib/module/types/PaymentSheetConfiguration.res +0 -215
  111. package/lib/module/types/PaymentSheetConfiguration.res.js +0 -4
  112. package/lib/module/types/PaymentSheetConfiguration.res.js.map +0 -1
  113. package/lib/typescript/commonjs/package.json +0 -1
  114. package/lib/typescript/commonjs/src/context/HyperProvider.gen.d.ts.map +0 -1
  115. package/lib/typescript/commonjs/src/context/HyperProvider.res.d.ts.map +0 -1
  116. package/lib/typescript/commonjs/src/hooks/useHyper.gen.d.ts.map +0 -1
  117. package/lib/typescript/commonjs/src/hooks/useHyper.res.d.ts.map +0 -1
  118. package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
  119. package/lib/typescript/commonjs/src/modules/NativeHyperswitchSdk.gen.d.ts.map +0 -1
  120. package/lib/typescript/commonjs/src/modules/NativeHyperswitchSdk.res.d.ts.map +0 -1
  121. package/lib/typescript/commonjs/src/shims/Js.shim.d.ts.map +0 -1
  122. package/lib/typescript/commonjs/src/specs/ApplePayButtonNativeComponent.d.ts.map +0 -1
  123. package/lib/typescript/commonjs/src/specs/GooglePayButtonNativeComponent.android.d.ts.map +0 -1
  124. package/lib/typescript/commonjs/src/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts.map +0 -1
  125. package/lib/typescript/commonjs/src/specs/NativeHyperswitchSdkNative.d.ts.map +0 -1
  126. package/lib/typescript/commonjs/src/specs/NativeHyperswitchSdkReactNative.d.ts.map +0 -1
  127. package/lib/typescript/commonjs/src/types/PaymentSheetConfiguration.gen.d.ts.map +0 -1
  128. package/lib/typescript/commonjs/src/types/PaymentSheetConfiguration.res.d.ts.map +0 -1
  129. package/lib/typescript/module/babel.config.d.ts +0 -10
  130. package/lib/typescript/module/babel.config.d.ts.map +0 -1
  131. package/lib/typescript/module/eslint.config.d.mts +0 -3
  132. package/lib/typescript/module/eslint.config.d.mts.map +0 -1
  133. package/lib/typescript/module/package.json +0 -1
  134. package/lib/typescript/module/scripts/bootstrap.d.ts +0 -2
  135. package/lib/typescript/module/scripts/bootstrap.d.ts.map +0 -1
  136. package/lib/typescript/module/src/context/HyperProvider.gen.d.ts +0 -17
  137. package/lib/typescript/module/src/context/HyperProvider.gen.d.ts.map +0 -1
  138. package/lib/typescript/module/src/context/HyperProvider.res.d.ts +0 -20
  139. package/lib/typescript/module/src/context/HyperProvider.res.d.ts.map +0 -1
  140. package/lib/typescript/module/src/hooks/useHyper.gen.d.ts +0 -10
  141. package/lib/typescript/module/src/hooks/useHyper.gen.d.ts.map +0 -1
  142. package/lib/typescript/module/src/hooks/useHyper.res.d.ts +0 -95
  143. package/lib/typescript/module/src/hooks/useHyper.res.d.ts.map +0 -1
  144. package/lib/typescript/module/src/index.d.ts +0 -4
  145. package/lib/typescript/module/src/index.d.ts.map +0 -1
  146. package/lib/typescript/module/src/modules/NativeHyperswitchSdk.gen.d.ts +0 -24
  147. package/lib/typescript/module/src/modules/NativeHyperswitchSdk.gen.d.ts.map +0 -1
  148. package/lib/typescript/module/src/modules/NativeHyperswitchSdk.res.d.ts +0 -2
  149. package/lib/typescript/module/src/modules/NativeHyperswitchSdk.res.d.ts.map +0 -1
  150. package/lib/typescript/module/src/shims/Js.shim.d.ts +0 -4
  151. package/lib/typescript/module/src/shims/Js.shim.d.ts.map +0 -1
  152. package/lib/typescript/module/src/specs/ApplePayButtonNativeComponent.d.ts +0 -10
  153. package/lib/typescript/module/src/specs/ApplePayButtonNativeComponent.d.ts.map +0 -1
  154. package/lib/typescript/module/src/specs/GooglePayButtonNativeComponent.android.d.ts +0 -11
  155. package/lib/typescript/module/src/specs/GooglePayButtonNativeComponent.android.d.ts.map +0 -1
  156. package/lib/typescript/module/src/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts +0 -1
  157. package/lib/typescript/module/src/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts.map +0 -1
  158. package/lib/typescript/module/src/specs/NativeHyperswitchSdkNative.d.ts +0 -17
  159. package/lib/typescript/module/src/specs/NativeHyperswitchSdkNative.d.ts.map +0 -1
  160. package/lib/typescript/module/src/specs/NativeHyperswitchSdkReactNative.d.ts +0 -9
  161. package/lib/typescript/module/src/specs/NativeHyperswitchSdkReactNative.d.ts.map +0 -1
  162. package/lib/typescript/module/src/types/PaymentSheetConfiguration.gen.d.ts +0 -149
  163. package/lib/typescript/module/src/types/PaymentSheetConfiguration.gen.d.ts.map +0 -1
  164. package/lib/typescript/module/src/types/PaymentSheetConfiguration.res.d.ts +0 -1
  165. package/lib/typescript/module/src/types/PaymentSheetConfiguration.res.d.ts.map +0 -1
  166. /package/lib/typescript/{commonjs/babel.config.d.ts → babel.config.d.ts} +0 -0
  167. /package/lib/typescript/{commonjs/eslint.config.d.mts → eslint.config.d.mts} +0 -0
  168. /package/lib/typescript/{commonjs/scripts → scripts}/bootstrap.d.ts +0 -0
  169. /package/lib/typescript/{commonjs/src → src}/context/HyperProvider.gen.d.ts +0 -0
  170. /package/lib/typescript/{commonjs/src → src}/context/HyperProvider.res.d.ts +0 -0
  171. /package/lib/typescript/{commonjs/src → src}/hooks/useHyper.gen.d.ts +0 -0
  172. /package/lib/typescript/{commonjs/src → src}/hooks/useHyper.res.d.ts +0 -0
  173. /package/lib/typescript/{commonjs/src → src}/index.d.ts +0 -0
  174. /package/lib/typescript/{commonjs/src → src}/modules/NativeHyperswitchSdk.gen.d.ts +0 -0
  175. /package/lib/typescript/{commonjs/src → src}/modules/NativeHyperswitchSdk.res.d.ts +0 -0
  176. /package/lib/typescript/{commonjs/src → src}/shims/Js.shim.d.ts +0 -0
  177. /package/lib/typescript/{commonjs/src → src}/specs/ApplePayButtonNativeComponent.d.ts +0 -0
  178. /package/lib/typescript/{commonjs/src → src}/specs/GooglePayButtonNativeComponent.android.d.ts +0 -0
  179. /package/lib/typescript/{commonjs/src → src}/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts +0 -0
  180. /package/lib/typescript/{commonjs/src → src}/specs/NativeHyperswitchSdkNative.d.ts +0 -0
  181. /package/lib/typescript/{commonjs/src → src}/specs/NativeHyperswitchSdkReactNative.d.ts +0 -0
  182. /package/lib/typescript/{commonjs/src → src}/types/PaymentSheetConfiguration.gen.d.ts +0 -0
  183. /package/lib/typescript/{commonjs/src → src}/types/PaymentSheetConfiguration.res.d.ts +0 -0
@@ -1,142 +0,0 @@
1
- open NativeHyperswitchSdk
2
-
3
- let getError: (~error: string=?) => presentPaymentSheetResult = (
4
- ~error="Unknown error occurred while presenting payment sheet",
5
- ) => {
6
- {
7
- error: {
8
- code: "failed",
9
- message: error,
10
- },
11
- }
12
- }
13
-
14
- let _initPaymentSession = async (params: initPaymentSessionParams): initPaymentSessionResult => {
15
- try {
16
- await nativeHyperswitchSdk.initPaymentSession(
17
- ~paymentIntentClientSecret=params.paymentIntentClientSecret->Option.getOr(""),
18
- )
19
- {}
20
- } catch {
21
- | Exn.Error(obj) =>
22
- switch Exn.message(obj) {
23
- | Some(msg) => {error: msg}
24
- | None => {error: "Unknown error occurred while initializing payment sheet"}
25
- }
26
- | _ => {error: "Unexpected error occurred while initializing payment sheet"}
27
- }
28
- }
29
- let getData = (data, ~key : string, ~fallback : string)=>{
30
- data
31
- ->Option.flatMap(obj =>
32
- obj->Js.Dict.get(key)->Option.flatMap(json => json->Js.Json.decodeString)
33
- )
34
- ->Option.getOr(fallback)
35
- }
36
-
37
- let parsePaymentSheetResult = (result: 'a): presentPaymentSheetResult => {
38
- try {
39
- let parsed = switch Js.typeof(result) {
40
- | "string" => Js.Json.parseExn(result)
41
- | _ => result->Obj.magic
42
- }
43
- let decodedObject = parsed->Js.Json.decodeObject
44
-
45
- let status =
46
- decodedObject->getData(~key="status", ~fallback="failed")
47
- let errorMessage =
48
- decodedObject->getData(~key="error", ~fallback="")
49
-
50
-
51
- let code =
52
- decodedObject->getData(~key="code", ~fallback="")
53
-
54
- let typeData =
55
- decodedObject->getData(~key="type", ~fallback="")
56
-
57
- let message =
58
- decodedObject
59
- ->getData(~key="message", ~fallback="failed")
60
-
61
- let paymentResult = {
62
- status,
63
- message,
64
- error: errorMessage,
65
- \"type": typeData,
66
- }
67
- let error = {
68
- code,
69
- message: errorMessage,
70
- }
71
-
72
- if errorMessage != "" {
73
- {error, paymentResult}
74
- } else {
75
- {paymentResult: paymentResult}
76
- }
77
- } catch {
78
- | _ => getError(~error="Failed to parse payment sheet result")
79
- }
80
- }
81
-
82
- let _presentPaymentSheet = async (params: presentPaymentSheetParams): presentPaymentSheetResult => {
83
- try {
84
- let result = await nativeHyperswitchSdk.presentPaymentSheet(params)
85
- result->parsePaymentSheetResult
86
- } catch {
87
- | Exn.Error(obj) =>
88
- // Check if the error is an object error - if so, return the error
89
- switch Js.typeof(obj) {
90
- | "object" =>
91
- // Try to parse the object error
92
- try {
93
- let errorObj = obj->Obj.magic
94
- let parsedError = errorObj->parsePaymentSheetResult
95
- parsedError
96
- } catch {
97
- | _ =>
98
- switch Exn.message(obj) {
99
- | Some(error) => getError(~error)
100
- | None => getError()
101
- }
102
- }
103
- | _ =>
104
- switch Exn.message(obj) {
105
- | Some(error) => getError(~error)
106
- | None => getError()
107
- }
108
- }
109
- | _ => getError()
110
- }
111
- }
112
-
113
- type useHyper = {
114
- initPaymentSession: initPaymentSessionParams => promise<initPaymentSessionResult>,
115
- presentPaymentSheet: presentPaymentSheetParams => promise<presentPaymentSheetResult>,
116
- }
117
-
118
- @genType
119
- let useHyper = () => {
120
- let (contextData, _) = React.useContext(HyperProvider.hyperProviderContext)
121
- let isReady = contextData.isInitialized && contextData.error->Belt.Option.isNone
122
-
123
- let initPaymentSession = React.useCallback0((params: initPaymentSessionParams) => {
124
- _initPaymentSession(params)
125
- })
126
-
127
- let presentPaymentSheet = React.useCallback1((params: presentPaymentSheetParams) => {
128
- if !isReady {
129
- let a: promise<presentPaymentSheetResult> = Promise.resolve(
130
- getError(~error="Hyperswitch is not initialized"),
131
- )
132
- a
133
- } else {
134
- _presentPaymentSheet(params)
135
- }
136
- }, [isReady])
137
-
138
- {
139
- initPaymentSession,
140
- presentPaymentSheet,
141
- }
142
- }
@@ -1,142 +0,0 @@
1
- "use strict";
2
-
3
- // Generated by ReScript, PLEASE EDIT WITH CARE
4
-
5
- import * as React from "react";
6
- import * as Js_exn from "rescript/lib/es6/js_exn.js";
7
- import * as Js_dict from "rescript/lib/es6/js_dict.js";
8
- import * as Js_json from "rescript/lib/es6/js_json.js";
9
- import * as Belt_Option from "rescript/lib/es6/belt_Option.js";
10
- import * as Core__Option from "@rescript/core/src/Core__Option.res.js";
11
- import * as Caml_js_exceptions from "rescript/lib/es6/caml_js_exceptions.js";
12
- import * as HyperProvider$JuspayTechReactNativeHyperswitch from "../context/HyperProvider.res.js";
13
- import * as NativeHyperswitchSdk$JuspayTechReactNativeHyperswitch from "../modules/NativeHyperswitchSdk.res.js";
14
- function getError(errorOpt) {
15
- var error = errorOpt !== undefined ? errorOpt : "Unknown error occurred while presenting payment sheet";
16
- return {
17
- error: {
18
- code: "failed",
19
- message: error
20
- }
21
- };
22
- }
23
- async function _initPaymentSession(params) {
24
- try {
25
- await NativeHyperswitchSdk$JuspayTechReactNativeHyperswitch.nativeHyperswitchSdk.initPaymentSession(Core__Option.getOr(params.paymentIntentClientSecret, ""));
26
- return {};
27
- } catch (raw_obj) {
28
- var obj = Caml_js_exceptions.internalToOCamlException(raw_obj);
29
- if (obj.RE_EXN_ID !== Js_exn.$$Error) {
30
- return {
31
- error: "Unexpected error occurred while initializing payment sheet"
32
- };
33
- }
34
- var msg = obj._1.message;
35
- if (msg !== undefined) {
36
- return {
37
- error: msg
38
- };
39
- } else {
40
- return {
41
- error: "Unknown error occurred while initializing payment sheet"
42
- };
43
- }
44
- }
45
- }
46
- function getData(data, key, fallback) {
47
- return Core__Option.getOr(Core__Option.flatMap(data, function (obj) {
48
- return Core__Option.flatMap(Js_dict.get(obj, key), Js_json.decodeString);
49
- }), fallback);
50
- }
51
- function parsePaymentSheetResult(result) {
52
- try {
53
- var match = typeof result;
54
- var parsed = match === "string" ? JSON.parse(result) : result;
55
- var decodedObject = Js_json.decodeObject(parsed);
56
- var status = getData(decodedObject, "status", "failed");
57
- var errorMessage = getData(decodedObject, "error", "");
58
- var code = getData(decodedObject, "code", "");
59
- var typeData = getData(decodedObject, "type", "");
60
- var message = getData(decodedObject, "message", "failed");
61
- var paymentResult_error = errorMessage;
62
- var paymentResult_type = typeData;
63
- var paymentResult = {
64
- status: status,
65
- message: message,
66
- error: paymentResult_error,
67
- type: paymentResult_type
68
- };
69
- var error_code = code;
70
- var error_message = errorMessage;
71
- var error = {
72
- code: error_code,
73
- message: error_message
74
- };
75
- if (errorMessage !== "") {
76
- return {
77
- error: error,
78
- paymentResult: paymentResult
79
- };
80
- } else {
81
- return {
82
- paymentResult: paymentResult
83
- };
84
- }
85
- } catch (exn) {
86
- return getError("Failed to parse payment sheet result");
87
- }
88
- }
89
- async function _presentPaymentSheet(params) {
90
- try {
91
- var result = await NativeHyperswitchSdk$JuspayTechReactNativeHyperswitch.nativeHyperswitchSdk.presentPaymentSheet(params);
92
- return parsePaymentSheetResult(result);
93
- } catch (raw_obj) {
94
- var obj = Caml_js_exceptions.internalToOCamlException(raw_obj);
95
- if (obj.RE_EXN_ID !== Js_exn.$$Error) {
96
- return getError(undefined);
97
- }
98
- var obj$1 = obj._1;
99
- var match = typeof obj$1;
100
- if (match === "object") {
101
- try {
102
- return parsePaymentSheetResult(obj$1);
103
- } catch (exn) {
104
- var error = obj$1.message;
105
- if (error !== undefined) {
106
- return getError(error);
107
- } else {
108
- return getError(undefined);
109
- }
110
- }
111
- } else {
112
- var error$1 = obj$1.message;
113
- if (error$1 !== undefined) {
114
- return getError(error$1);
115
- } else {
116
- return getError(undefined);
117
- }
118
- }
119
- }
120
- }
121
- function useHyper() {
122
- var match = React.useContext(HyperProvider$JuspayTechReactNativeHyperswitch.hyperProviderContext);
123
- var contextData = match[0];
124
- var isReady = contextData.isInitialized && Belt_Option.isNone(contextData.error);
125
- var initPaymentSession = React.useCallback(function (params) {
126
- return _initPaymentSession(params);
127
- }, []);
128
- var presentPaymentSheet = React.useCallback(function (params) {
129
- if (isReady) {
130
- return _presentPaymentSheet(params);
131
- } else {
132
- return Promise.resolve(getError("Hyperswitch is not initialized"));
133
- }
134
- }, [isReady]);
135
- return {
136
- initPaymentSession: initPaymentSession,
137
- presentPaymentSheet: presentPaymentSheet
138
- };
139
- }
140
- export { getError, _initPaymentSession, getData, parsePaymentSheetResult, _presentPaymentSheet, useHyper };
141
- /* react Not a pure module */
142
- //# sourceMappingURL=useHyper.res.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["React","Js_exn","Js_dict","Js_json","Belt_Option","Core__Option","Caml_js_exceptions","HyperProvider$JuspayTechReactNativeHyperswitch","NativeHyperswitchSdk$JuspayTechReactNativeHyperswitch","getError","errorOpt","error","undefined","code","message","_initPaymentSession","params","nativeHyperswitchSdk","initPaymentSession","getOr","paymentIntentClientSecret","raw_obj","obj","internalToOCamlException","RE_EXN_ID","$$Error","msg","_1","getData","data","key","fallback","flatMap","get","decodeString","parsePaymentSheetResult","result","match","parsed","JSON","parse","decodedObject","decodeObject","status","errorMessage","typeData","paymentResult_error","paymentResult_type","paymentResult","type","error_code","error_message","exn","_presentPaymentSheet","presentPaymentSheet","obj$1","error$1","useHyper","useContext","hyperProviderContext","contextData","isReady","isInitialized","isNone","useCallback","Promise","resolve"],"sourceRoot":"../../../src","sources":["hooks/useHyper.res.js"],"mappings":";;AAAA;;AAEA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAO,KAAKC,MAAM,MAAM,4BAA4B;AACpD,OAAO,KAAKC,OAAO,MAAM,6BAA6B;AACtD,OAAO,KAAKC,OAAO,MAAM,6BAA6B;AACtD,OAAO,KAAKC,WAAW,MAAM,iCAAiC;AAC9D,OAAO,KAAKC,YAAY,MAAM,wCAAwC;AACtE,OAAO,KAAKC,kBAAkB,MAAM,wCAAwC;AAC5E,OAAO,KAAKC,8CAA8C,MAAM,iCAAiC;AACjG,OAAO,KAAKC,qDAAqD,MAAM,wCAAwC;AAE/G,SAASC,QAAQA,CAACC,QAAQ,EAAE;EAC1B,IAAIC,KAAK,GAAGD,QAAQ,KAAKE,SAAS,GAAGF,QAAQ,GAAG,uDAAuD;EACvG,OAAO;IACCC,KAAK,EAAE;MACLE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AAmB,CAACC,MAAM,CAAC;EACpC,CAAC,EAAG,EAAE,CAAC;EACb,IAAIsC,mBAAmB,GAAGtD,KAAK,CAACgE,WAAW,CAAE,UAAUhD,MAAM,EAAE;IACvD,IAAI6C,OAAO,EAAE;MACX,OAAOR,oBAAoB,CAACrC,MAAM,CAAC;IACrC,CAAC,MAAM;MACL,OAAOiD,OAAO,CAACC,OAAO,CAACzD,QAAQ,CAAC,gCAAgC,CAAC,CAAC;IACpE;EACF,CAAC,EAAG,CAACoD,OAAO,CAAC,CAAC;EACpB,OAAO;IACC3C,kBAAkB,EAAEA,kBAAkB;IACtCoC,mBAAmB,EAAEA;EACvB,CAAC;AACT;AAEA,SACE7C,QAAQ,EACRM,mBAAmB,EACnBa,OAAO,EACPO,uBAAuB,EACvBkB,oBAAoB,EACpBI,QAAQ;AAEV","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- export { make as HyperProvider, initHyperswitch } from "./context/HyperProvider.gen.js";
4
- export { useHyper } from "./hooks/useHyper.gen.js";
5
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["make","HyperProvider","initHyperswitch","useHyper"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAOA,SACEA,IAAI,IAAIC,aAAa,EACrBC,eAAe,QACV,gCAA6B;AAEpC,SAASC,QAAQ,QAAQ,yBAAsB","ignoreList":[]}
@@ -1,4 +0,0 @@
1
- "use strict";
2
-
3
- export {};
4
- //# sourceMappingURL=NativeHyperswitchSdk.gen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["modules/NativeHyperswitchSdk.gen.tsx"],"mappings":"","ignoreList":[]}
@@ -1,55 +0,0 @@
1
-
2
- type initialise = (
3
- ~publishableKey: string,
4
- ~customBackendUrl: string=?,
5
- ~customLogUrl: string=?,
6
- ~customParams: Js.Json.t=?,
7
- ) => promise<unit>
8
-
9
- type initPaymentSession = (~paymentIntentClientSecret: string) => promise<unit>
10
-
11
- @genType
12
- type initPaymentSessionParams = {paymentIntentClientSecret?: string}
13
-
14
- @genType
15
- type initPaymentSessionResult = {error?: string}
16
-
17
- @genType
18
- type presentPaymentSheetParams = PaymentSheetConfiguration.options
19
-
20
- type status =
21
- | @as("succeeded") Completed
22
- | @as("cancelled") Canceled
23
- | @as("Failed") Failed
24
-
25
- @genType
26
- type paymentResult = {
27
- status: string,
28
- message: string,
29
- error?: string,
30
- \"type"?: string,
31
- }
32
-
33
- @genType
34
- type error = {
35
- code?: string,
36
- message?: string
37
- }
38
-
39
- @genType
40
- type presentPaymentSheetResult = {
41
- error?: error,
42
- paymentResult?: paymentResult
43
- }
44
-
45
- @genType
46
- type presentPaymentSheet = presentPaymentSheetParams => promise<string>
47
-
48
- type nativeHyperswitchSdk = {
49
- initialise: initialise,
50
- initPaymentSession: initPaymentSession,
51
- presentPaymentSheet: presentPaymentSheet,
52
- }
53
-
54
- @module("../specs/NativeHyperswitchSdkReactNative")
55
- external nativeHyperswitchSdk: nativeHyperswitchSdk = "default"
@@ -1,9 +0,0 @@
1
- "use strict";
2
-
3
- // Generated by ReScript, PLEASE EDIT WITH CARE
4
-
5
- import NativeHyperswitchSdkReactNative from "../specs/NativeHyperswitchSdkReactNative.js";
6
- var nativeHyperswitchSdk = NativeHyperswitchSdkReactNative;
7
- export { nativeHyperswitchSdk };
8
- /* nativeHyperswitchSdk Not a pure module */
9
- //# sourceMappingURL=NativeHyperswitchSdk.res.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["NativeHyperswitchSdkReactNative","nativeHyperswitchSdk"],"sourceRoot":"../../../src","sources":["modules/NativeHyperswitchSdk.res.js"],"mappings":";;AAAA;;AAEA,OAAOA,+BAA+B,MAAM,6CAA0C;AAEtF,IAAIC,oBAAoB,GAAGD,+BAA+B;AAE1D,SACEC,oBAAoB;AAEtB","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"type":"module"}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=Js.shim.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["shims/Js.shim.ts"],"mappings":"","ignoreList":[]}
@@ -1,11 +0,0 @@
1
- import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
2
- import type { ViewProps } from 'react-native';
3
- import type { Double } from 'react-native/Libraries/Types/CodegenTypes';
4
-
5
- interface NativeProps extends ViewProps {
6
- buttonType?: string;
7
- buttonStyle?: string;
8
- cornerRadius?: Double;
9
- }
10
-
11
- export default codegenNativeComponent<NativeProps>('ApplePayView');
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
4
- export default codegenNativeComponent('GooglePayButton');
5
- //# sourceMappingURL=GooglePayButtonNativeComponent.android.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["codegenNativeComponent"],"sourceRoot":"../../../src","sources":["specs/GooglePayButtonNativeComponent.android.ts"],"mappings":";;AAAA,OAAOA,sBAAsB,MAAM,yDAAyD;AAW5F,eAAeA,sBAAsB,CAAc,iBAAiB,CAAC","ignoreList":[]}
@@ -1,10 +0,0 @@
1
- // import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
2
- // import type { ViewProps } from 'react-native';
3
-
4
- // interface NativeProps extends ViewProps {
5
- // color?: string;
6
- // }
7
-
8
- // export default codegenNativeComponent<NativeProps>(
9
- // 'HyperswitchSdkReactNativeView'
10
- // );
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- import { TurboModuleRegistry } from 'react-native';
4
- export default TurboModuleRegistry.getEnforcing('HyperModules');
5
- //# sourceMappingURL=NativeHyperswitchSdkNative.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeHyperswitchSdkNative.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AA+BlD,eAAeA,mBAAmB,CAACC,YAAY,CAAO,cAAc,CAAC","ignoreList":[]}
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- import { TurboModuleRegistry } from 'react-native';
4
- export default TurboModuleRegistry.getEnforcing('HyperswitchSdkReactNative');
5
- //# sourceMappingURL=NativeHyperswitchSdkReactNative.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../../src","sources":["specs/NativeHyperswitchSdkReactNative.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;AAalD,eAAeA,mBAAmB,CAACC,YAAY,CAC7C,2BACF,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=PaymentSheetConfiguration.gen.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/PaymentSheetConfiguration.gen.tsx"],"mappings":"","ignoreList":[]}
@@ -1,215 +0,0 @@
1
- type localeTypes =
2
- | En
3
- | He
4
- | Fr
5
- | En_GB
6
- | Ar
7
- | Ja
8
- | De
9
- | Fr_BE
10
- | Es
11
- | Ca
12
- | Pt
13
- | It
14
- | Pl
15
- | Nl
16
- | NI_BE
17
- | Sv
18
- | Ru
19
- | Lt
20
- | Cs
21
- | Sk
22
- | Ls
23
- | Cy
24
- | El
25
- | Et
26
- | Fi
27
- | Nb
28
- | Bs
29
- | Da
30
- | Ms
31
- | Tr_CY
32
-
33
- type fontFamilyTypes = DefaultIOS | DefaultAndroid | CustomFont(string) | DefaultWeb
34
-
35
- type placeholder = {
36
- cardNumber?: string,
37
- expiryDate?: string,
38
- cvv?: string,
39
- }
40
-
41
- type address = {
42
- first_name?: string,
43
- last_name?: string,
44
- city?: string,
45
- country?: string,
46
- line1?: string,
47
- line2?: string,
48
- zip?: string,
49
- state?: string,
50
- }
51
-
52
- type phone = {
53
- number?: string,
54
- country_code?: string,
55
- }
56
-
57
- type addressDetails = {
58
- address?: address,
59
- email?: string,
60
- phone?: phone,
61
- }
62
-
63
- type customerConfiguration = {
64
- id?: string,
65
- ephemeralKeySecret?: string,
66
- }
67
-
68
- type colors = {
69
- primary?: string,
70
- background?: string,
71
- componentBackground?: string,
72
- componentBorder?: string,
73
- componentDivider?: string,
74
- componentText?: string,
75
- primaryText?: string,
76
- secondaryText?: string,
77
- placeholderText?: string,
78
- icon?: string,
79
- error?: string,
80
- loaderBackground?: string,
81
- loaderForeground?: string,
82
- }
83
-
84
- type colorType = {
85
- light?: colors,
86
- dark?: colors,
87
- }
88
-
89
- // IOS Specific
90
- type offsetType = {
91
- x?: float,
92
- y?: float,
93
- }
94
- type shadowConfig = {
95
- color?: string,
96
- opacity?: float,
97
- blurRadius?: float,
98
- offset?: offsetType,
99
- intensity?: float,
100
- }
101
-
102
- type shapes = {
103
- borderRadius?: float,
104
- borderWidth?: float,
105
- shadow?: shadowConfig, // IOS Specific
106
- }
107
-
108
- type font = {
109
- family?: fontFamilyTypes,
110
- scale?: float,
111
- headingTextSizeAdjust?: float,
112
- subHeadingTextSizeAdjust?: float,
113
- placeholderTextSizeAdjust?: float,
114
- buttonTextSizeAdjust?: float,
115
- errorTextSizeAdjust?: float,
116
- linkTextSizeAdjust?: float,
117
- modalTextSizeAdjust?: float,
118
- cardTextSizeAdjust?: float,
119
- }
120
-
121
- type primaryButtonColor = {
122
- background?: string,
123
- text?: string,
124
- border?: string,
125
- }
126
- type primaryButtonColorType = {
127
- light?: primaryButtonColor,
128
- dark?: primaryButtonColor
129
- }
130
-
131
- type primaryButton = {
132
- shapes?: shapes,
133
- primaryButtonColor?: primaryButtonColorType,
134
- }
135
-
136
- type googlePayButtonType = BUY | BOOK | CHECKOUT | DONATE | ORDER | PAY | SUBSCRIBE | PLAIN
137
-
138
- type googlePayButtonStyle = [#light | #dark]
139
-
140
- type googlePayThemeBaseStyle = {
141
- light?: googlePayButtonStyle,
142
- dark?: googlePayButtonStyle,
143
- }
144
-
145
- type googlePayConfiguration = {
146
- buttonType?: googlePayButtonType,
147
- buttonStyle?: googlePayThemeBaseStyle,
148
- }
149
-
150
- type applePayButtonType = [
151
- | #buy
152
- | #setUp
153
- | #inStore
154
- | #donate
155
- | #checkout
156
- | #book
157
- | #subscribe
158
- | #plain
159
- ]
160
- type applePayButtonStyle = [#white | #whiteOutline | #black]
161
-
162
- type applePayThemeBaseStyle = {
163
- light?: applePayButtonStyle,
164
- dark?: applePayButtonStyle,
165
- }
166
-
167
- type applePayConfiguration = {
168
- buttonType?: applePayButtonType,
169
- buttonStyle?: applePayThemeBaseStyle,
170
- }
171
-
172
- type themeType =
173
- | Default
174
- | Light
175
- | Dark
176
- | Minimal
177
- | FlatMinimal
178
-
179
- type layoutType = [#tabs | #accordion | #spacedAccordion]
180
-
181
- type appearance = {
182
- locale?: localeTypes,
183
- colors?: colorType,
184
- shapes?: shapes,
185
- font?: font,
186
- primaryButton?: primaryButton,
187
- googlePay?: googlePayConfiguration,
188
- applePay?: applePayConfiguration,
189
- theme?: themeType,
190
- layout?: layoutType,
191
- }
192
-
193
- @genType
194
- type options = {
195
- allowsDelayedPaymentMethods?: bool,
196
- appearance?: appearance,
197
- shippingDetails?: addressDetails,
198
- primaryButtonLabel?: string,
199
- paymentSheetHeaderText?: string,
200
- savedPaymentScreenHeaderText?: string,
201
- merchantDisplayName?: string,
202
- defaultBillingDetails?: addressDetails,
203
- primaryButtonColor?: string,
204
- allowsPaymentMethodsRequiringShippingAddress?: bool,
205
- displaySavedPaymentMethodsCheckbox?: bool,
206
- displaySavedPaymentMethods?: bool,
207
- placeholder?: placeholder,
208
- defaultView?: bool,
209
- netceteraSDKApiKey?: string,
210
- displayDefaultSavedPaymentIcon?: bool,
211
- enablePartialLoading?: bool,
212
- customer?: customerConfiguration,
213
- paymentSheetHeaderLabel?: string,
214
- savedPaymentSheetHeaderLabel?: string,
215
- }
@@ -1,4 +0,0 @@
1
- // Generated by ReScript, PLEASE EDIT WITH CARE
2
- /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
3
- "use strict";
4
- //# sourceMappingURL=PaymentSheetConfiguration.res.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/PaymentSheetConfiguration.res.js"],"mappings":"AAAA;AACA;AAAA","ignoreList":[]}