@juspay-tech/react-native-hyperswitch 1.0.0-alpha.0 → 1.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/src/main/java/com/hyperswitchsdkreactnative/headless/HeadlessManager.kt +4 -4
- package/android/src/main/java/com/hyperswitchsdkreactnative/provider/HyperFragment.kt +4 -4
- package/lib/bs/build.ninja +1 -1
- package/lib/bs/src/context/HyperProvider-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/context/WidgetRegistry-JuspayTechReactNativeHyperswitch.cmi +0 -0
- package/lib/bs/src/context/WidgetRegistry-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/core/Hyper-JuspayTechReactNativeHyperswitch.cmi +0 -0
- package/lib/bs/src/core/Hyper-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/core/HyperElements-JuspayTechReactNativeHyperswitch.cmi +0 -0
- package/lib/bs/src/core/HyperElements-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/hooks/usePaymentSession-JuspayTechReactNativeHyperswitch.cmi +0 -0
- package/lib/bs/src/hooks/usePaymentSession-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/hooks/useWidget-JuspayTechReactNativeHyperswitch.cmi +0 -0
- package/lib/bs/src/hooks/useWidget-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/modules/NativeHyperswitchSdk-JuspayTechReactNativeHyperswitch.cmi +0 -0
- package/lib/bs/src/modules/NativeHyperswitchSdk-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/types/HyperTypes-JuspayTechReactNativeHyperswitch.cmi +0 -0
- package/lib/bs/src/types/HyperTypes-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/types/NativeModuleTypes-JuspayTechReactNativeHyperswitch.cmi +0 -0
- package/lib/bs/src/types/NativeModuleTypes-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/types/PaymentSheetConfiguration-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/utils/AppearanceTransformer-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/utils/EventValidator-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/utils/NewArchUtils-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/utils/PaymentSheetEventManager-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/utils/ReactNativeUtils-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/utils/ResponseHandler-JuspayTechReactNativeHyperswitch.cmi +0 -0
- package/lib/bs/src/utils/ResponseHandler-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/views/CvcWidget-JuspayTechReactNativeHyperswitch.cmi +0 -0
- package/lib/bs/src/views/CvcWidget-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/views/NativePaymentWidget-JuspayTechReactNativeHyperswitch.cmi +0 -0
- package/lib/bs/src/views/NativePaymentWidget-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/views/NativePaymentWidgetImpl-JuspayTechReactNativeHyperswitch.cmi +0 -0
- package/lib/bs/src/views/NativePaymentWidgetImpl-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/bs/src/views/PaymentWidget-JuspayTechReactNativeHyperswitch.cmi +0 -0
- package/lib/bs/src/views/PaymentWidget-JuspayTechReactNativeHyperswitch.cmt +0 -0
- package/lib/commonjs/index.bundle.js.map +1 -1
- package/lib/module/index.bundle.js.map +1 -1
- package/lib/rescript.lock +1 -0
- package/package.json +5 -2
- package/rescript.json +1 -0
- package/src/core/Hyper.res.js +2 -2
- package/src/core/HyperElements.res.js +2 -2
- package/src/modules/NativeHyperswitchSdk.res.js +1 -1
- package/src/utils/PaymentSheetEventManager.res.js +1 -1
- package/src/utils/ResponseHandler.res.js +3 -3
|
@@ -2,10 +2,10 @@ package com.hyperswitchsdkreactnative.headless
|
|
|
2
2
|
|
|
3
3
|
import android.app.Application
|
|
4
4
|
import android.os.Bundle
|
|
5
|
+
import com.hyperswitchsdkreactnative.BuildConfig
|
|
5
6
|
import com.facebook.react.bridge.Arguments
|
|
6
7
|
import com.facebook.react.bridge.ReactContext
|
|
7
8
|
import com.facebook.react.bridge.UiThreadUtil
|
|
8
|
-
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
|
|
9
9
|
import com.facebook.react.ReactHost
|
|
10
10
|
import com.facebook.react.ReactInstanceEventListener
|
|
11
11
|
import com.facebook.react.ReactNativeHost
|
|
@@ -15,7 +15,7 @@ import com.hyperswitchsdkreactnative.provider.ReactNativeController
|
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Manages starting HeadlessJsTask for headless payment methods.
|
|
18
|
-
*
|
|
18
|
+
*
|
|
19
19
|
* Uses the RN wrapper's ReactNativeController to start a HeadlessJsTask
|
|
20
20
|
* named "HyperHeadless" which runs the JS bundle's headless task logic.
|
|
21
21
|
*/
|
|
@@ -50,7 +50,7 @@ object HeadlessManager {
|
|
|
50
50
|
|
|
51
51
|
UiThreadUtil.runOnUiThread {
|
|
52
52
|
val reactContext: ReactContext? = try {
|
|
53
|
-
if (
|
|
53
|
+
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
54
54
|
reactHost.currentReactContext
|
|
55
55
|
} else {
|
|
56
56
|
reactNativeHost.reactInstanceManager?.currentReactContext
|
|
@@ -63,7 +63,7 @@ object HeadlessManager {
|
|
|
63
63
|
invokeStartTask(reactContext, props)
|
|
64
64
|
} else {
|
|
65
65
|
// ReactContext not yet ready, wait for initialization
|
|
66
|
-
if (
|
|
66
|
+
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
67
67
|
reactHost.addReactInstanceEventListener(
|
|
68
68
|
object : ReactInstanceEventListener {
|
|
69
69
|
override fun onReactContextInitialized(context: ReactContext) {
|
|
@@ -90,7 +90,7 @@ class HyperFragment : ReactFragment() {
|
|
|
90
90
|
return
|
|
91
91
|
}
|
|
92
92
|
callbacks[CallbackType.UPDATE_INTENT_INIT] = HyperCallback.UpdateIntent(callback)
|
|
93
|
-
|
|
93
|
+
reactNativeHost.reactInstanceManager.currentReactContext
|
|
94
94
|
?.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
95
95
|
?.emit("updateIntentInit", Arguments.createMap().apply {
|
|
96
96
|
putInt("rootTag", rootTag)
|
|
@@ -120,7 +120,7 @@ class HyperFragment : ReactFragment() {
|
|
|
120
120
|
return
|
|
121
121
|
}
|
|
122
122
|
callbacks[CallbackType.UPDATE_INTENT_COMPLETE] = HyperCallback.UpdateIntent(callback)
|
|
123
|
-
|
|
123
|
+
reactNativeHost.reactInstanceManager.currentReactContext
|
|
124
124
|
?.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
125
125
|
?.emit("updateIntentComplete", Arguments.createMap().apply {
|
|
126
126
|
putString("sdkAuthorization", sdkAuthorization)
|
|
@@ -151,7 +151,7 @@ class HyperFragment : ReactFragment() {
|
|
|
151
151
|
return
|
|
152
152
|
}
|
|
153
153
|
callbacks[CallbackType.CONFIRM_ACTION] = HyperCallback.Payment(callback)
|
|
154
|
-
|
|
154
|
+
reactNativeHost.reactInstanceManager.currentReactContext
|
|
155
155
|
?.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
156
156
|
?.emit("triggerWidgetAction", Arguments.createMap().apply {
|
|
157
157
|
putString("actionType", EventName.CONFIRM_PAYMENT_ACTION.name)
|
|
@@ -274,7 +274,7 @@ class HyperFragment : ReactFragment() {
|
|
|
274
274
|
map.putInt("rootTag", rootTag)
|
|
275
275
|
map.putString("paymentToken", paymentToken)
|
|
276
276
|
map.putString("paymentMethodId", paymentMethodId)
|
|
277
|
-
|
|
277
|
+
reactNativeHost.reactInstanceManager.currentReactContext
|
|
278
278
|
?.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter::class.java)
|
|
279
279
|
?.emit("triggerWidgetAction", map)
|
|
280
280
|
}
|
package/lib/bs/build.ninja
CHANGED
|
@@ -10,7 +10,7 @@ rule deps
|
|
|
10
10
|
restat = 1
|
|
11
11
|
o src/views/CvcWidget.d : deps src/views/CvcWidget.ast
|
|
12
12
|
rule mij
|
|
13
|
-
command = /Users/shivam.shashank/Documents/exp/react-native-hyperswitch/packages/@juspay-tech/react-native-hyperswitch/node_modules/rescript/darwinarm64/bsc.exe -bs-ns JuspayTechReactNativeHyperswitch -I . -I src/types -I src/context -I src/core -I src/specs -I src/utils -I src/__tests__ -I src/shims -I src/hooks -I src/modules -I src/views -I src -I /Users/shivam.shashank/Documents/exp/react-native-hyperswitch/packages/@juspay-tech/react-native-hyperswitch/node_modules/@rescript/react/lib/ocaml -I /Users/shivam.shashank/Documents/exp/react-native-hyperswitch/packages/@juspay-tech/react-native-hyperswitch/node_modules/rescript-react-native/lib/ocaml -I /Users/shivam.shashank/Documents/exp/react-native-hyperswitch/packages/@juspay-tech/react-native-hyperswitch/node_modules/@rescript/core/lib/ocaml -open RescriptCore -bs-gentype -uncurried -bs-package-name @juspay-tech/react-native-hyperswitch -bs-package-output esmodule:$in_d:.res.js -bs-v $g_finger $i
|
|
13
|
+
command = /Users/shivam.shashank/Documents/exp/react-native-hyperswitch/packages/@juspay-tech/react-native-hyperswitch/node_modules/rescript/darwinarm64/bsc.exe -bs-ns JuspayTechReactNativeHyperswitch -I . -I src/types -I src/context -I src/core -I src/specs -I src/utils -I src/__tests__ -I src/shims -I src/hooks -I src/modules -I src/views -I src -I /Users/shivam.shashank/Documents/exp/react-native-hyperswitch/packages/@juspay-tech/react-native-hyperswitch/node_modules/@rescript/react/lib/ocaml -I /Users/shivam.shashank/Documents/exp/react-native-hyperswitch/packages/@juspay-tech/react-native-hyperswitch/node_modules/rescript-react-native/lib/ocaml -I /Users/shivam.shashank/Documents/exp/react-native-hyperswitch/packages/@juspay-tech/react-native-hyperswitch/node_modules/@rescript/core/lib/ocaml -open RescriptCore -bs-gentype -uncurried -bs-package-name @juspay-tech/react-native-hyperswitch -bs-package-output esmodule:$in_d:.res.js -runtime /Users/shivam.shashank/Documents/exp/react-native-hyperswitch/packages/@juspay-tech/react-native-hyperswitch/node_modules/@rescript/std -bs-v $g_finger $i
|
|
14
14
|
dyndep = 1
|
|
15
15
|
restat = 1
|
|
16
16
|
o src/views/CvcWidget-JuspayTechReactNativeHyperswitch.cmj src/views/CvcWidget-JuspayTechReactNativeHyperswitch.cmi ../../src/views/CvcWidget.res.js : mij src/views/CvcWidget.ast
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|