@yuno-payments/yuno-sdk-react-native 1.0.17-rc.7 → 1.0.17-rc.9

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.
@@ -26,6 +26,7 @@ import kotlinx.coroutines.CoroutineScope
26
26
  import kotlinx.coroutines.Dispatchers
27
27
  import kotlinx.coroutines.flow.launchIn
28
28
  import kotlinx.coroutines.flow.onEach
29
+ import kotlinx.coroutines.flow.catch
29
30
  import androidx.lifecycle.asFlow
30
31
 
31
32
  /**
@@ -903,6 +904,10 @@ class YunoSdkModule(private val reactContext: ReactApplicationContext) :
903
904
  promise.reject("TOKEN_GENERATION_ERROR", e.message)
904
905
  }
905
906
  }
907
+ .catch { e ->
908
+ Log.e(TAG, "❌ Flow error in token generation: ${e.message}")
909
+ promise.reject("TOKEN_GENERATION_ERROR", e.message ?: "Unknown error in token generation flow")
910
+ }
906
911
  .launchIn(CoroutineScope(Dispatchers.Main))
907
912
  } catch (e: Exception) {
908
913
  Log.e(TAG, "❌ Error in generateToken: ${e.message}")
@@ -962,6 +967,10 @@ class YunoSdkModule(private val reactContext: ReactApplicationContext) :
962
967
  promise.reject("THREE_DS_ERROR", e.message)
963
968
  }
964
969
  }
970
+ .catch { e ->
971
+ Log.e(TAG, "❌ Flow error in 3DS challenge: ${e.message}")
972
+ promise.reject("THREE_DS_ERROR", e.message ?: "Unknown error in 3DS challenge flow")
973
+ }
965
974
  .launchIn(CoroutineScope(Dispatchers.Main))
966
975
  } catch (e: Exception) {
967
976
  Log.e(TAG, "❌ Error in getThreeDSecureChallenge: ${e.message}")
package/ios/YunoSdk.swift CHANGED
@@ -591,9 +591,15 @@ extension YunoSdk {
591
591
 
592
592
  let jsonData = try JSONSerialization.data(withJSONObject: tokenCollectedData, options: [])
593
593
 
594
+ // Debug: Print the JSON string
595
+ if let jsonString = String(data: jsonData, encoding: .utf8) {
596
+ print("🐛 iOS generateToken JSON: \(jsonString)")
597
+ }
598
+
594
599
  // Decode to TokenCollectedData using the native SDK's Codable model
600
+ // Note: Don't use .convertFromSnakeCase because the SDK's models have custom decoders
601
+ // that already handle snake_case field names (checkout_session, payment_method, etc)
595
602
  let decoder = JSONDecoder()
596
- decoder.keyDecodingStrategy = .convertFromSnakeCase
597
603
  let collectedData = try decoder.decode(TokenCollectedData.self, from: jsonData)
598
604
 
599
605
  // Create API client using the native SDK's factory method
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.7",
3
+ "version": "1.0.17-rc.9",
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",