@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.
- package/android/build.gradle +4 -10
- package/android/src/main/AndroidManifest.xml +0 -19
- package/android/src/main/assets/hyperswitch.bundle +172 -162
- package/android/src/main/java/com/hyperswitchsdkreactnative/internal/ReactFragment.kt +35 -1
- package/android/src/main/java/com/hyperswitchsdkreactnative/modules/HyperswitchSdkNativeModule.kt +30 -6
- package/android/src/main/java/com/hyperswitchsdkreactnative/provider/HyperProvider.kt +3 -2
- package/ios/hyperswitchSDK/Core/NativeModule/OTAServices.swift +1 -1
- package/ios/hyperswitchSDK/Core/Resources/hyperswitch.bundle +172 -162
- package/lib/bs/src/context/HyperProvider-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/hooks/useHyper-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/modules/NativeHyperswitchSdk-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/types/PaymentSheetConfiguration-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/commonjs/index.bundle.js +11 -0
- package/lib/commonjs/index.bundle.js.map +1 -0
- package/lib/module/index.bundle.js +11 -0
- package/lib/module/index.bundle.js.map +1 -0
- package/lib/typescript/{commonjs/babel.config.d.ts.map → babel.config.d.ts.map} +1 -1
- package/lib/typescript/{commonjs/eslint.config.d.mts.map → eslint.config.d.mts.map} +1 -1
- package/lib/typescript/rollup.config.d.ts +23 -0
- package/lib/typescript/rollup.config.d.ts.map +1 -0
- package/lib/typescript/{commonjs/scripts → scripts}/bootstrap.d.ts.map +1 -1
- package/lib/typescript/src/context/HyperProvider.gen.d.ts.map +1 -0
- package/lib/typescript/src/context/HyperProvider.res.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useHyper.gen.d.ts.map +1 -0
- package/lib/typescript/src/hooks/useHyper.res.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/modules/NativeHyperswitchSdk.gen.d.ts.map +1 -0
- package/lib/typescript/src/modules/NativeHyperswitchSdk.res.d.ts.map +1 -0
- package/lib/typescript/src/shims/Js.shim.d.ts.map +1 -0
- package/lib/typescript/src/specs/ApplePayButtonNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/GooglePayButtonNativeComponent.android.d.ts.map +1 -0
- package/lib/typescript/src/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeHyperswitchSdkNative.d.ts.map +1 -0
- package/lib/typescript/src/specs/NativeHyperswitchSdkReactNative.d.ts.map +1 -0
- package/lib/typescript/src/types/PaymentSheetConfiguration.gen.d.ts.map +1 -0
- package/lib/typescript/src/types/PaymentSheetConfiguration.res.d.ts.map +1 -0
- package/package.json +27 -27
- package/rescript.json +31 -0
- package/tsconfig.build.json +20 -0
- package/android/src/main/java/com/hyperswitchsdkreactnative/activity/RedirectActivity.kt +0 -39
- package/android/src/main/java/io/hyperswitch/logs/CrashHandler.kt +0 -29
- package/android/src/main/java/io/hyperswitch/logs/Debouncer.kt +0 -20
- package/android/src/main/java/io/hyperswitch/logs/HyperLogManager.kt +0 -113
- package/android/src/main/java/io/hyperswitch/logs/LogData.kt +0 -159
- package/android/src/main/java/io/hyperswitch/logs/LogFileManager.kt +0 -60
- package/android/src/main/java/io/hyperswitch/networking/HyperNetworking.kt +0 -73
- package/lib/commonjs/context/HyperProvider.gen.js +0 -16
- package/lib/commonjs/context/HyperProvider.gen.js.map +0 -1
- package/lib/commonjs/context/HyperProvider.res +0 -78
- package/lib/commonjs/context/HyperProvider.res.js +0 -98
- package/lib/commonjs/context/HyperProvider.res.js.map +0 -1
- package/lib/commonjs/hooks/useHyper.gen.js +0 -15
- package/lib/commonjs/hooks/useHyper.gen.js.map +0 -1
- package/lib/commonjs/hooks/useHyper.res +0 -142
- package/lib/commonjs/hooks/useHyper.res.js +0 -152
- package/lib/commonjs/hooks/useHyper.res.js.map +0 -1
- package/lib/commonjs/index.js +0 -26
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/modules/NativeHyperswitchSdk.gen.js +0 -6
- package/lib/commonjs/modules/NativeHyperswitchSdk.gen.js.map +0 -1
- package/lib/commonjs/modules/NativeHyperswitchSdk.res +0 -55
- package/lib/commonjs/modules/NativeHyperswitchSdk.res.js +0 -14
- package/lib/commonjs/modules/NativeHyperswitchSdk.res.js.map +0 -1
- package/lib/commonjs/package.json +0 -1
- package/lib/commonjs/shims/Js.shim.js +0 -2
- package/lib/commonjs/shims/Js.shim.js.map +0 -1
- package/lib/commonjs/specs/ApplePayButtonNativeComponent.ts +0 -11
- package/lib/commonjs/specs/GooglePayButtonNativeComponent.android.js +0 -10
- package/lib/commonjs/specs/GooglePayButtonNativeComponent.android.js.map +0 -1
- package/lib/commonjs/specs/HyperswitchSdkReactNativeViewNativeComponent.ts +0 -10
- package/lib/commonjs/specs/NativeHyperswitchSdkNative.js +0 -9
- package/lib/commonjs/specs/NativeHyperswitchSdkNative.js.map +0 -1
- package/lib/commonjs/specs/NativeHyperswitchSdkReactNative.js +0 -9
- package/lib/commonjs/specs/NativeHyperswitchSdkReactNative.js.map +0 -1
- package/lib/commonjs/types/PaymentSheetConfiguration.gen.js +0 -2
- package/lib/commonjs/types/PaymentSheetConfiguration.gen.js.map +0 -1
- package/lib/commonjs/types/PaymentSheetConfiguration.res +0 -215
- package/lib/commonjs/types/PaymentSheetConfiguration.res.js +0 -4
- package/lib/commonjs/types/PaymentSheetConfiguration.res.js.map +0 -1
- package/lib/module/context/HyperProvider.gen.js +0 -11
- package/lib/module/context/HyperProvider.gen.js.map +0 -1
- package/lib/module/context/HyperProvider.res +0 -78
- package/lib/module/context/HyperProvider.res.js +0 -91
- package/lib/module/context/HyperProvider.res.js.map +0 -1
- package/lib/module/hooks/useHyper.gen.js +0 -10
- package/lib/module/hooks/useHyper.gen.js.map +0 -1
- package/lib/module/hooks/useHyper.res +0 -142
- package/lib/module/hooks/useHyper.res.js +0 -142
- package/lib/module/hooks/useHyper.res.js.map +0 -1
- package/lib/module/index.js +0 -5
- package/lib/module/index.js.map +0 -1
- package/lib/module/modules/NativeHyperswitchSdk.gen.js +0 -4
- package/lib/module/modules/NativeHyperswitchSdk.gen.js.map +0 -1
- package/lib/module/modules/NativeHyperswitchSdk.res +0 -55
- package/lib/module/modules/NativeHyperswitchSdk.res.js +0 -9
- package/lib/module/modules/NativeHyperswitchSdk.res.js.map +0 -1
- package/lib/module/package.json +0 -1
- package/lib/module/shims/Js.shim.js +0 -2
- package/lib/module/shims/Js.shim.js.map +0 -1
- package/lib/module/specs/ApplePayButtonNativeComponent.ts +0 -11
- package/lib/module/specs/GooglePayButtonNativeComponent.android.js +0 -5
- package/lib/module/specs/GooglePayButtonNativeComponent.android.js.map +0 -1
- package/lib/module/specs/HyperswitchSdkReactNativeViewNativeComponent.ts +0 -10
- package/lib/module/specs/NativeHyperswitchSdkNative.js +0 -5
- package/lib/module/specs/NativeHyperswitchSdkNative.js.map +0 -1
- package/lib/module/specs/NativeHyperswitchSdkReactNative.js +0 -5
- package/lib/module/specs/NativeHyperswitchSdkReactNative.js.map +0 -1
- package/lib/module/types/PaymentSheetConfiguration.gen.js +0 -2
- package/lib/module/types/PaymentSheetConfiguration.gen.js.map +0 -1
- package/lib/module/types/PaymentSheetConfiguration.res +0 -215
- package/lib/module/types/PaymentSheetConfiguration.res.js +0 -4
- package/lib/module/types/PaymentSheetConfiguration.res.js.map +0 -1
- package/lib/typescript/commonjs/package.json +0 -1
- package/lib/typescript/commonjs/src/context/HyperProvider.gen.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/context/HyperProvider.res.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/hooks/useHyper.gen.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/hooks/useHyper.res.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/NativeHyperswitchSdk.gen.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/NativeHyperswitchSdk.res.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/shims/Js.shim.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/specs/ApplePayButtonNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/specs/GooglePayButtonNativeComponent.android.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/specs/NativeHyperswitchSdkNative.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/specs/NativeHyperswitchSdkReactNative.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/PaymentSheetConfiguration.gen.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/types/PaymentSheetConfiguration.res.d.ts.map +0 -1
- package/lib/typescript/module/babel.config.d.ts +0 -10
- package/lib/typescript/module/babel.config.d.ts.map +0 -1
- package/lib/typescript/module/eslint.config.d.mts +0 -3
- package/lib/typescript/module/eslint.config.d.mts.map +0 -1
- package/lib/typescript/module/package.json +0 -1
- package/lib/typescript/module/scripts/bootstrap.d.ts +0 -2
- package/lib/typescript/module/scripts/bootstrap.d.ts.map +0 -1
- package/lib/typescript/module/src/context/HyperProvider.gen.d.ts +0 -17
- package/lib/typescript/module/src/context/HyperProvider.gen.d.ts.map +0 -1
- package/lib/typescript/module/src/context/HyperProvider.res.d.ts +0 -20
- package/lib/typescript/module/src/context/HyperProvider.res.d.ts.map +0 -1
- package/lib/typescript/module/src/hooks/useHyper.gen.d.ts +0 -10
- package/lib/typescript/module/src/hooks/useHyper.gen.d.ts.map +0 -1
- package/lib/typescript/module/src/hooks/useHyper.res.d.ts +0 -95
- package/lib/typescript/module/src/hooks/useHyper.res.d.ts.map +0 -1
- package/lib/typescript/module/src/index.d.ts +0 -4
- package/lib/typescript/module/src/index.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/NativeHyperswitchSdk.gen.d.ts +0 -24
- package/lib/typescript/module/src/modules/NativeHyperswitchSdk.gen.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/NativeHyperswitchSdk.res.d.ts +0 -2
- package/lib/typescript/module/src/modules/NativeHyperswitchSdk.res.d.ts.map +0 -1
- package/lib/typescript/module/src/shims/Js.shim.d.ts +0 -4
- package/lib/typescript/module/src/shims/Js.shim.d.ts.map +0 -1
- package/lib/typescript/module/src/specs/ApplePayButtonNativeComponent.d.ts +0 -10
- package/lib/typescript/module/src/specs/ApplePayButtonNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/specs/GooglePayButtonNativeComponent.android.d.ts +0 -11
- package/lib/typescript/module/src/specs/GooglePayButtonNativeComponent.android.d.ts.map +0 -1
- package/lib/typescript/module/src/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts +0 -1
- package/lib/typescript/module/src/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/module/src/specs/NativeHyperswitchSdkNative.d.ts +0 -17
- package/lib/typescript/module/src/specs/NativeHyperswitchSdkNative.d.ts.map +0 -1
- package/lib/typescript/module/src/specs/NativeHyperswitchSdkReactNative.d.ts +0 -9
- package/lib/typescript/module/src/specs/NativeHyperswitchSdkReactNative.d.ts.map +0 -1
- package/lib/typescript/module/src/types/PaymentSheetConfiguration.gen.d.ts +0 -149
- package/lib/typescript/module/src/types/PaymentSheetConfiguration.gen.d.ts.map +0 -1
- package/lib/typescript/module/src/types/PaymentSheetConfiguration.res.d.ts +0 -1
- package/lib/typescript/module/src/types/PaymentSheetConfiguration.res.d.ts.map +0 -1
- /package/lib/typescript/{commonjs/babel.config.d.ts → babel.config.d.ts} +0 -0
- /package/lib/typescript/{commonjs/eslint.config.d.mts → eslint.config.d.mts} +0 -0
- /package/lib/typescript/{commonjs/scripts → scripts}/bootstrap.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/context/HyperProvider.gen.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/context/HyperProvider.res.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/hooks/useHyper.gen.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/hooks/useHyper.res.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/index.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/modules/NativeHyperswitchSdk.gen.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/modules/NativeHyperswitchSdk.res.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/shims/Js.shim.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/specs/ApplePayButtonNativeComponent.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/specs/GooglePayButtonNativeComponent.android.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/specs/HyperswitchSdkReactNativeViewNativeComponent.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/specs/NativeHyperswitchSdkNative.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/specs/NativeHyperswitchSdkReactNative.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/types/PaymentSheetConfiguration.gen.d.ts +0 -0
- /package/lib/typescript/{commonjs/src → src}/types/PaymentSheetConfiguration.res.d.ts +0 -0
|
@@ -30,12 +30,18 @@ import com.facebook.react.shell.MainReactPackage
|
|
|
30
30
|
import com.hyperswitchsdkreactnative.BuildConfig
|
|
31
31
|
import com.hyperswitchsdkreactnative.R
|
|
32
32
|
import com.hyperswitchsdkreactnative.internal.DefaultReactHost.getDefaultReactHost
|
|
33
|
+
import com.hyperswitchsdkreactnative.modules.HyperswitchSdkReactNativeModule
|
|
33
34
|
import com.hyperswitchsdkreactnative.provider.HyperProvider
|
|
35
|
+
import com.proyecto26.inappbrowser.ChromeTabsDismissedEvent
|
|
36
|
+
import com.proyecto26.inappbrowser.ChromeTabsManagerActivity
|
|
34
37
|
import `in`.juspay.hyperota.LazyDownloadCallback
|
|
35
38
|
import `in`.juspay.hyperotareact.HyperOTAReact
|
|
36
39
|
import io.hyperswitch.hyperota.HyperOtaLogger
|
|
37
40
|
import io.hyperswitch.react.SDKEnvironment
|
|
38
41
|
import io.hyperswitch.react.Utils.Companion.checkEnvironment
|
|
42
|
+
import io.hyperswitch.redirect.RedirectEvent
|
|
43
|
+
import org.greenrobot.eventbus.EventBus
|
|
44
|
+
import org.greenrobot.eventbus.Subscribe
|
|
39
45
|
|
|
40
46
|
/**
|
|
41
47
|
* Fragment for creating a React View. This allows the developer to "embed" a React Application
|
|
@@ -46,7 +52,6 @@ internal open class ReactFragment : Fragment(), PermissionAwareActivity {
|
|
|
46
52
|
|
|
47
53
|
private var disableHostLifecycleEvents = false
|
|
48
54
|
private var permissionListener: PermissionListener? = null
|
|
49
|
-
|
|
50
55
|
override fun onCreate(savedInstanceState: Bundle?) {
|
|
51
56
|
super.onCreate(savedInstanceState)
|
|
52
57
|
var mainComponentName: String? = null
|
|
@@ -73,6 +78,7 @@ internal open class ReactFragment : Fragment(), PermissionAwareActivity {
|
|
|
73
78
|
fabricEnabled,
|
|
74
79
|
))
|
|
75
80
|
}
|
|
81
|
+
registerEventBus()
|
|
76
82
|
}
|
|
77
83
|
|
|
78
84
|
/**
|
|
@@ -81,6 +87,33 @@ internal open class ReactFragment : Fragment(), PermissionAwareActivity {
|
|
|
81
87
|
* method if your application class does not implement `ReactApplication` or you simply have a
|
|
82
88
|
* different mechanism for storing a `ReactNativeHost`, e.g. as a static field somewhere.
|
|
83
89
|
*/
|
|
90
|
+
|
|
91
|
+
@Subscribe
|
|
92
|
+
fun onEvent(event: RedirectEvent) {
|
|
93
|
+
unRegisterEventBus()
|
|
94
|
+
EventBus.getDefault().post(
|
|
95
|
+
ChromeTabsDismissedEvent(
|
|
96
|
+
event.message,
|
|
97
|
+
event.resultType,
|
|
98
|
+
event.isError
|
|
99
|
+
)
|
|
100
|
+
)
|
|
101
|
+
startActivity(ChromeTabsManagerActivity.createDismissIntent(context))
|
|
102
|
+
}
|
|
103
|
+
private fun registerEventBus() {try{
|
|
104
|
+
if (!EventBus.getDefault().isRegistered(this)) {
|
|
105
|
+
EventBus.getDefault().register(this)
|
|
106
|
+
}
|
|
107
|
+
}catch(_: Exception){}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
fun unRegisterEventBus() {
|
|
111
|
+
try {
|
|
112
|
+
if (EventBus.getDefault().isRegistered(this)) {
|
|
113
|
+
EventBus.getDefault().unregister(this)
|
|
114
|
+
}
|
|
115
|
+
}catch(_: Exception){}
|
|
116
|
+
}
|
|
84
117
|
@Suppress("DEPRECATION")
|
|
85
118
|
@Deprecated(
|
|
86
119
|
"You should not use ReactNativeHost directly in the New Architecture. Use ReactHost instead.",
|
|
@@ -159,6 +192,7 @@ internal open class ReactFragment : Fragment(), PermissionAwareActivity {
|
|
|
159
192
|
|
|
160
193
|
override fun onDestroy() {
|
|
161
194
|
super.onDestroy()
|
|
195
|
+
unRegisterEventBus()
|
|
162
196
|
if (!disableHostLifecycleEvents) {
|
|
163
197
|
reactDelegate.onHostDestroy()
|
|
164
198
|
} else {
|
package/android/src/main/java/com/hyperswitchsdkreactnative/modules/HyperswitchSdkNativeModule.kt
CHANGED
|
@@ -38,7 +38,6 @@ class HyperswitchSdkNativeModule(reactContext: ReactApplicationContext) :
|
|
|
38
38
|
|
|
39
39
|
@ReactMethod
|
|
40
40
|
override fun launchGPay(requestObj: String, callback: Callback) {
|
|
41
|
-
Log.i("Manideep", "called gpay here")
|
|
42
41
|
currentActivity?.let {
|
|
43
42
|
GooglePayCallbackManager.setCallback(
|
|
44
43
|
it,
|
|
@@ -61,8 +60,8 @@ class HyperswitchSdkNativeModule(reactContext: ReactApplicationContext) :
|
|
|
61
60
|
@ReactMethod
|
|
62
61
|
override fun exitPaymentsheet(rootTag: Double, result: String, reset: Boolean) {
|
|
63
62
|
try {
|
|
64
|
-
resetView()
|
|
65
63
|
resolvePromise(result)
|
|
64
|
+
resetView()
|
|
66
65
|
} catch (e: JSONException) {
|
|
67
66
|
// Log.e(NAME, "Failed to parse JSON result: $result", e)
|
|
68
67
|
resolvePromise(result)
|
|
@@ -73,7 +72,13 @@ class HyperswitchSdkNativeModule(reactContext: ReactApplicationContext) :
|
|
|
73
72
|
@ReactMethod
|
|
74
73
|
override fun exitPaymentMethodManagement(rootTag: Double, result: String, reset: Boolean) {
|
|
75
74
|
// Log.d(NAME, "exitPaymentMethodManagement called $result")
|
|
76
|
-
|
|
75
|
+
try {
|
|
76
|
+
resolvePromise(result)
|
|
77
|
+
resetView()
|
|
78
|
+
} catch (e: JSONException) {
|
|
79
|
+
// Log.e(NAME, "Failed to parse JSON result: $result", e)
|
|
80
|
+
resolvePromise(result)
|
|
81
|
+
}
|
|
77
82
|
|
|
78
83
|
// Implementation for exiting payment method management
|
|
79
84
|
}
|
|
@@ -81,7 +86,14 @@ class HyperswitchSdkNativeModule(reactContext: ReactApplicationContext) :
|
|
|
81
86
|
@ReactMethod
|
|
82
87
|
override fun exitWidget(result: String, widgetType: String) {
|
|
83
88
|
// Log.d(NAME, "exitWidget called with result: $result, widgetType: $widgetType")
|
|
84
|
-
|
|
89
|
+
try {
|
|
90
|
+
resolvePromise(result)
|
|
91
|
+
resetView()
|
|
92
|
+
} catch (e: JSONException) {
|
|
93
|
+
// Log.e(NAME, "Failed to parse JSON result: $result", e)
|
|
94
|
+
resolvePromise(result)
|
|
95
|
+
}
|
|
96
|
+
|
|
85
97
|
|
|
86
98
|
// Implementation for exiting widget
|
|
87
99
|
}
|
|
@@ -89,7 +101,13 @@ class HyperswitchSdkNativeModule(reactContext: ReactApplicationContext) :
|
|
|
89
101
|
@ReactMethod
|
|
90
102
|
override fun exitCardForm(result: String) {
|
|
91
103
|
// Log.d(NAME, "exitCardForm called with result: $result")
|
|
92
|
-
|
|
104
|
+
try {
|
|
105
|
+
resolvePromise(result)
|
|
106
|
+
resetView()
|
|
107
|
+
} catch (e: JSONException) {
|
|
108
|
+
// Log.e(NAME, "Failed to parse JSON result: $result", e)
|
|
109
|
+
resolvePromise(result)
|
|
110
|
+
}
|
|
93
111
|
|
|
94
112
|
// Implementation for exiting card form
|
|
95
113
|
}
|
|
@@ -97,7 +115,13 @@ class HyperswitchSdkNativeModule(reactContext: ReactApplicationContext) :
|
|
|
97
115
|
@ReactMethod
|
|
98
116
|
override fun exitWidgetPaymentsheet(rootTag: Double, result: String, reset: Boolean) {
|
|
99
117
|
// Log.d(NAME, "exitWidgetPaymentsheet called")
|
|
100
|
-
|
|
118
|
+
try {
|
|
119
|
+
resolvePromise(result)
|
|
120
|
+
resetView()
|
|
121
|
+
} catch (e: JSONException) {
|
|
122
|
+
// Log.e(NAME, "Failed to parse JSON result: $result", e)
|
|
123
|
+
resolvePromise(result)
|
|
124
|
+
}
|
|
101
125
|
|
|
102
126
|
// Implementation for exiting widget payment sheet
|
|
103
127
|
}
|
|
@@ -91,6 +91,7 @@ internal class HyperProvider internal constructor(private val activity: Activity
|
|
|
91
91
|
activity?.let {
|
|
92
92
|
try {
|
|
93
93
|
if (reactFragment != null) {
|
|
94
|
+
reactFragment!!.unRegisterEventBus()
|
|
94
95
|
it.supportFragmentManager.beginTransaction().remove(reactFragment!!).commitAllowingStateLoss()
|
|
95
96
|
}
|
|
96
97
|
if (reset) {
|
|
@@ -103,7 +104,7 @@ internal class HyperProvider internal constructor(private val activity: Activity
|
|
|
103
104
|
|
|
104
105
|
companion object {
|
|
105
106
|
@JvmStatic
|
|
106
|
-
var reactFragment:
|
|
107
|
+
var reactFragment: ReactFragment? = null
|
|
107
108
|
|
|
108
109
|
@JvmStatic
|
|
109
110
|
private var publishableKey: String? = null
|
|
@@ -205,7 +206,7 @@ internal class HyperProvider internal constructor(private val activity: Activity
|
|
|
205
206
|
|
|
206
207
|
private fun getHyperParams(context: Activity, configuration: Bundle): Bundle = Bundle().apply {
|
|
207
208
|
putString("appId", context.packageName)
|
|
208
|
-
putString("country", context.resources?.configuration?.
|
|
209
|
+
putString("country", context.resources?.configuration?.locales?.get(0)?.country)
|
|
209
210
|
putString("user-agent", getUserAgent(context))
|
|
210
211
|
putDouble("launchTime", getCurrentTime())
|
|
211
212
|
putString("sdkVersion", BuildConfig.VERSION_NAME)
|
|
@@ -102,7 +102,7 @@ public final class OTAServices {
|
|
|
102
102
|
"forceUpdate": true,
|
|
103
103
|
"localAssets": (getHyperOTAPlist(configKey) ?? "releaseConfigURL") == "releaseConfigURL",
|
|
104
104
|
"fileName": getHyperOTAPlist("fileName") ?? "" ,
|
|
105
|
-
"releaseConfigURL": (getHyperOTAPlist(configKey) ?? "") + "/mobile-ota/ios/" + SDKVersion.current + "/config.json",
|
|
105
|
+
"releaseConfigURL": (getHyperOTAPlist(configKey) ?? "") + "/mobile-ota/rn/ios/" + SDKVersion.current + "/config.json",
|
|
106
106
|
] as [String: Any]
|
|
107
107
|
self.otaServices = HyperOTAServices(payload: payload, loggerDelegate: logger, baseBundle: Bundle(for: OTAServices.self))
|
|
108
108
|
}
|