@yuno-payments/yuno-sdk-react-native 1.0.17-rc.6 → 1.0.17-rc.7
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.
|
@@ -853,6 +853,12 @@ class YunoSdkModule(private val reactContext: ReactApplicationContext) :
|
|
|
853
853
|
try {
|
|
854
854
|
Log.d(TAG, "generateToken called with checkoutSession: $checkoutSession")
|
|
855
855
|
|
|
856
|
+
val activity = currentActivity
|
|
857
|
+
if (activity == null) {
|
|
858
|
+
promise.reject("ACTIVITY_UNAVAILABLE", "Current activity is null. Cannot generate token.")
|
|
859
|
+
return
|
|
860
|
+
}
|
|
861
|
+
|
|
856
862
|
// Convert ReadableMap to TokenCollectedData using Gson
|
|
857
863
|
val gson = Gson()
|
|
858
864
|
val jsonString = convertReadableMapToJson(tokenCollectedData)
|
|
@@ -864,11 +870,11 @@ class YunoSdkModule(private val reactContext: ReactApplicationContext) :
|
|
|
864
870
|
val apiClient = Yuno.apiClientPayment(
|
|
865
871
|
checkoutSession = checkoutSession,
|
|
866
872
|
countryCode = countryCode,
|
|
867
|
-
context =
|
|
873
|
+
context = activity.applicationContext
|
|
868
874
|
)
|
|
869
875
|
|
|
870
|
-
// Generate token
|
|
871
|
-
apiClient.generateToken(collectedData,
|
|
876
|
+
// Generate token - pass activity for WebView context
|
|
877
|
+
apiClient.generateToken(collectedData, activity)
|
|
872
878
|
.asFlow()
|
|
873
879
|
.onEach { result ->
|
|
874
880
|
try {
|
|
@@ -921,15 +927,21 @@ class YunoSdkModule(private val reactContext: ReactApplicationContext) :
|
|
|
921
927
|
try {
|
|
922
928
|
Log.d(TAG, "getThreeDSecureChallenge called with checkoutSession: $checkoutSession")
|
|
923
929
|
|
|
930
|
+
val activity = currentActivity
|
|
931
|
+
if (activity == null) {
|
|
932
|
+
promise.reject("ACTIVITY_UNAVAILABLE", "Current activity is null. Cannot get 3DS challenge.")
|
|
933
|
+
return
|
|
934
|
+
}
|
|
935
|
+
|
|
924
936
|
// Create API client
|
|
925
937
|
val apiClient = Yuno.apiClientPayment(
|
|
926
938
|
checkoutSession = checkoutSession,
|
|
927
939
|
countryCode = countryCode,
|
|
928
|
-
context =
|
|
940
|
+
context = activity.applicationContext
|
|
929
941
|
)
|
|
930
942
|
|
|
931
|
-
// Get 3DS challenge
|
|
932
|
-
apiClient.getThreeDSecureChallenge(
|
|
943
|
+
// Get 3DS challenge - pass activity for WebView context
|
|
944
|
+
apiClient.getThreeDSecureChallenge(activity, checkoutSession)
|
|
933
945
|
.asFlow()
|
|
934
946
|
.onEach { result ->
|
|
935
947
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yuno-payments/yuno-sdk-react-native",
|
|
3
|
-
"version": "1.0.17-rc.
|
|
3
|
+
"version": "1.0.17-rc.7",
|
|
4
4
|
"description": "Yuno React Native SDK empowers you to create seamless payment experiences in your native Android and iOS apps built with React Native.",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|