@jimrising/easymerchantsdk-react-native 1.4.2 → 1.4.3

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 (27) hide show
  1. package/README.md +1 -1
  2. package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$1.dex +0 -0
  3. package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$2.dex +0 -0
  4. package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule.dex +0 -0
  5. package/android/build/.transforms/e9a664a11ce12edf79cd87b1e07aa243/transformed/classes/classes_dex/classes.dex +0 -0
  6. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  7. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$1.class +0 -0
  8. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$2.class +0 -0
  9. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule.class +0 -0
  10. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule$1.class +0 -0
  11. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule$2.class +0 -0
  12. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule.class +0 -0
  13. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  14. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule$1.class.uniqueId2 +0 -0
  15. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule$2.class.uniqueId0 +0 -0
  16. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule.class.uniqueId3 +0 -0
  17. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  18. package/android/build.gradle +1 -1
  19. package/android/src/main/java/com/reactlibrary/RNEasymerchantsdkModule.java +0 -1
  20. package/ios/Pods/ViewControllers/AdditionalInfoVC.swift +49 -52
  21. package/ios/Pods/ViewControllers/BillingInfoVC/BillingInfoVC.swift +74 -45
  22. package/ios/Pods/ViewControllers/OTPVerificationVC.swift +109 -33
  23. package/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift +1036 -146
  24. package/ios/Pods/ViewControllers/ThreeDSecurePaymentDoneVC.swift +0 -248
  25. package/ios/easymerchantsdk.podspec +1 -1
  26. package/ios/easymerchantsdk.storyboard +291 -92
  27. package/package.json +1 -1
@@ -72,6 +72,8 @@ class OTPVerificationVC: BaseVC {
72
72
  var billingInfo: [FieldItem]?
73
73
  var visibility: FieldsVisibility?
74
74
 
75
+ var amount: Int?
76
+
75
77
  override func viewDidLoad() {
76
78
  super.viewDidLoad()
77
79
 
@@ -359,7 +361,14 @@ class OTPVerificationVC: BaseVC {
359
361
  }
360
362
  } else {
361
363
  print("customer_id not found in nested data. Falling back to nil.")
362
- self.paymentIntentApi(customerId: nil)
364
+ if let request = self.request {
365
+ if request.secureAuthentication == true {
366
+ self.threeDSecurePaymentSavedCardApi(customerId: nil)
367
+ }
368
+ else {
369
+ self.paymentIntentApi(customerId: nil)
370
+ }
371
+ }
363
372
  }
364
373
  }
365
374
  else if self.selectedPaymentMethod == "Bank" {
@@ -1225,23 +1234,43 @@ class OTPVerificationVC: BaseVC {
1225
1234
  uRLRequest.addValue(apiSecret, forHTTPHeaderField: "X-Api-Secret")
1226
1235
  }
1227
1236
 
1237
+ let emailPrefix = userEmail?.components(separatedBy: "@").first ?? ""
1238
+
1228
1239
  var params: [String: Any] = [
1229
1240
  "account_id": self.grailPayAccountID ?? "",
1230
1241
  "account_type": self.selectedGrailPayAccountType ?? "",
1231
1242
  "name": self.selectedGrailPayAccountName ?? "",
1232
- // "description": "payment checkout",
1233
1243
  "save_account": 1,
1234
1244
  "is_default": 1,
1235
1245
  "customer_id": customerId ?? "",
1236
- "email": UserStoreSingleton.shared.merchantEmail ?? ""
1246
+ "email": userEmail ?? "",
1247
+ "create_customer": "1",
1237
1248
  ]
1238
1249
 
1239
- // Billing Info
1240
- if let visibility = visibility, visibility.billing == true,
1241
- let billing = billingInfo, !billing.isEmpty {
1250
+ if let customerId = customerId {
1251
+ params["customer"] = customerId
1252
+ } else {
1253
+ params["username"] = emailPrefix
1254
+ }
1255
+
1256
+ // // Billing Info
1257
+ // if let visibility = visibility, visibility.billing == true,
1258
+ // let billing = billingInfo, !billing.isEmpty {
1259
+ // var billingDict: [String: Any] = [:]
1260
+ // billing.forEach { billingDict[$0.name] = $0.value }
1261
+ //
1262
+ // params["address"] = billingDict["address"] as? String ?? ""
1263
+ // params["country"] = billingDict["country"] as? String ?? ""
1264
+ // params["state"] = billingDict["state"] as? String ?? ""
1265
+ // params["city"] = billingDict["city"] as? String ?? ""
1266
+ // params["zip"] = billingDict["postal_code"] as? String ?? ""
1267
+ // }
1268
+
1269
+ // Always include Billing Info if available
1270
+ if let billing = billingInfo, !billing.isEmpty {
1242
1271
  var billingDict: [String: Any] = [:]
1243
1272
  billing.forEach { billingDict[$0.name] = $0.value }
1244
-
1273
+
1245
1274
  params["address"] = billingDict["address"] as? String ?? ""
1246
1275
  params["country"] = billingDict["country"] as? String ?? ""
1247
1276
  params["state"] = billingDict["state"] as? String ?? ""
@@ -1249,18 +1278,34 @@ class OTPVerificationVC: BaseVC {
1249
1278
  params["zip"] = billingDict["postal_code"] as? String ?? ""
1250
1279
  }
1251
1280
 
1252
- // Additional Info or default description
1253
- var descriptionValue: String = "Hosted payment checkout" // default
1254
- if let visibility = visibility, visibility.additional == true,
1255
- let additional = additionalInfo, !additional.isEmpty {
1256
-
1281
+ // // Additional Info or default description
1282
+ // var descriptionValue: String = "Hosted payment checkout" // default
1283
+ // if let visibility = visibility, visibility.additional == true,
1284
+ // let additional = additionalInfo, !additional.isEmpty {
1285
+ //
1286
+ // var additionalDict: [String: Any] = [:]
1287
+ // additional.forEach { additionalDict[$0.name] = $0.value }
1288
+ //
1289
+ // if let desc = additionalDict["description"] as? String, !desc.isEmpty {
1290
+ // descriptionValue = desc
1291
+ // }
1292
+ //
1293
+ // if let phone = additionalDict["phone_number"] as? String, !phone.isEmpty {
1294
+ // params["phone_number"] = phone
1295
+ // }
1296
+ // }
1297
+ // params["description"] = descriptionValue
1298
+
1299
+ // Always include Additional Info if available
1300
+ var descriptionValue: String = "Hosted payment checkout"
1301
+ if let additional = additionalInfo, !additional.isEmpty {
1257
1302
  var additionalDict: [String: Any] = [:]
1258
1303
  additional.forEach { additionalDict[$0.name] = $0.value }
1259
-
1304
+
1260
1305
  if let desc = additionalDict["description"] as? String, !desc.isEmpty {
1261
1306
  descriptionValue = desc
1262
1307
  }
1263
-
1308
+
1264
1309
  if let phone = additionalDict["phone_number"] as? String, !phone.isEmpty {
1265
1310
  params["phone_number"] = phone
1266
1311
  }
@@ -1341,19 +1386,19 @@ class OTPVerificationVC: BaseVC {
1341
1386
  // Conditionally pass raw FieldItem array
1342
1387
  paymentDoneVC.visibility = self.visibility
1343
1388
 
1344
- if self.visibility?.billing == true {
1389
+ // if self.visibility?.billing == true {
1345
1390
  paymentDoneVC.billingInfoData = self.billingInfo
1346
1391
  var billingDict: [String: Any] = [:]
1347
1392
  self.billingInfo?.forEach { billingDict[$0.name] = $0.value }
1348
1393
  paymentDoneVC.billingInfo = billingDict
1349
- }
1394
+ // }
1350
1395
 
1351
- if self.visibility?.additional == true {
1396
+ // if self.visibility?.additional == true {
1352
1397
  paymentDoneVC.additionalInfoData = self.additionalInfo
1353
1398
  var additionalDict: [String: Any] = [:]
1354
1399
  self.additionalInfo?.forEach { additionalDict[$0.name] = $0.value }
1355
1400
  paymentDoneVC.additionalInfo = additionalDict
1356
- }
1401
+ // }
1357
1402
  self.navigationController?.pushViewController(paymentDoneVC, animated: true)
1358
1403
  }
1359
1404
  }
@@ -1565,12 +1610,42 @@ class OTPVerificationVC: BaseVC {
1565
1610
  "customer_id": customerId ?? ""
1566
1611
  ]
1567
1612
 
1568
- // Billing Info
1569
- if let visibility = visibility, visibility.billing == true,
1570
- let billing = billingInfo, !billing.isEmpty {
1613
+ // // Billing Info
1614
+ // if let visibility = visibility, visibility.billing == true,
1615
+ // let billing = billingInfo, !billing.isEmpty {
1616
+ // var billingDict: [String: Any] = [:]
1617
+ // billing.forEach { billingDict[$0.name] = $0.value }
1618
+ //
1619
+ // params["address"] = billingDict["address"] as? String ?? ""
1620
+ // params["country"] = billingDict["country"] as? String ?? ""
1621
+ // params["state"] = billingDict["state"] as? String ?? ""
1622
+ // params["city"] = billingDict["city"] as? String ?? ""
1623
+ // params["zip"] = billingDict["postal_code"] as? String ?? ""
1624
+ // }
1625
+ //
1626
+ // // Additional Info or default description
1627
+ // var descriptionValue: String = "Hosted payment checkout" // default
1628
+ // if let visibility = visibility, visibility.additional == true,
1629
+ // let additional = additionalInfo, !additional.isEmpty {
1630
+ //
1631
+ // var additionalDict: [String: Any] = [:]
1632
+ // additional.forEach { additionalDict[$0.name] = $0.value }
1633
+ //
1634
+ // if let desc = additionalDict["description"] as? String, !desc.isEmpty {
1635
+ // descriptionValue = desc
1636
+ // }
1637
+ //
1638
+ // if let phone = additionalDict["phone_number"] as? String, !phone.isEmpty {
1639
+ // params["phone_number"] = phone
1640
+ // }
1641
+ // }
1642
+ // params["description"] = descriptionValue
1643
+
1644
+ // Always include Billing Info if available
1645
+ if let billing = billingInfo, !billing.isEmpty {
1571
1646
  var billingDict: [String: Any] = [:]
1572
1647
  billing.forEach { billingDict[$0.name] = $0.value }
1573
-
1648
+
1574
1649
  params["address"] = billingDict["address"] as? String ?? ""
1575
1650
  params["country"] = billingDict["country"] as? String ?? ""
1576
1651
  params["state"] = billingDict["state"] as? String ?? ""
@@ -1578,18 +1653,16 @@ class OTPVerificationVC: BaseVC {
1578
1653
  params["zip"] = billingDict["postal_code"] as? String ?? ""
1579
1654
  }
1580
1655
 
1581
- // Additional Info or default description
1582
- var descriptionValue: String = "Hosted payment checkout" // default
1583
- if let visibility = visibility, visibility.additional == true,
1584
- let additional = additionalInfo, !additional.isEmpty {
1585
-
1656
+ // Always include Additional Info if available
1657
+ var descriptionValue: String = "Hosted payment checkout"
1658
+ if let additional = additionalInfo, !additional.isEmpty {
1586
1659
  var additionalDict: [String: Any] = [:]
1587
1660
  additional.forEach { additionalDict[$0.name] = $0.value }
1588
-
1661
+
1589
1662
  if let desc = additionalDict["description"] as? String, !desc.isEmpty {
1590
1663
  descriptionValue = desc
1591
1664
  }
1592
-
1665
+
1593
1666
  if let phone = additionalDict["phone_number"] as? String, !phone.isEmpty {
1594
1667
  params["phone_number"] = phone
1595
1668
  }
@@ -1619,6 +1692,8 @@ class OTPVerificationVC: BaseVC {
1619
1692
  params["interval"] = chosenPlan?.lowercased()
1620
1693
  }
1621
1694
 
1695
+ print(params)
1696
+
1622
1697
  do {
1623
1698
  let jsonData = try JSONSerialization.data(withJSONObject: params, options: .prettyPrinted)
1624
1699
  uRLRequest.httpBody = jsonData
@@ -1669,20 +1744,21 @@ class OTPVerificationVC: BaseVC {
1669
1744
  // Pass billing and additional info
1670
1745
  // Conditionally pass raw FieldItem array
1671
1746
  paymentDoneVC.visibility = self.visibility
1747
+ paymentDoneVC.amount = self.amount
1672
1748
 
1673
- if self.visibility?.billing == true {
1749
+ // if self.visibility?.billing == true {
1674
1750
  paymentDoneVC.billingInfoData = self.billingInfo
1675
1751
  var billingDict: [String: Any] = [:]
1676
1752
  self.billingInfo?.forEach { billingDict[$0.name] = $0.value }
1677
1753
  paymentDoneVC.billingInfo = billingDict
1678
- }
1754
+ // }
1679
1755
 
1680
- if self.visibility?.additional == true {
1756
+ // if self.visibility?.additional == true {
1681
1757
  paymentDoneVC.additionalInfoData = self.additionalInfo
1682
1758
  var additionalDict: [String: Any] = [:]
1683
1759
  self.additionalInfo?.forEach { additionalDict[$0.name] = $0.value }
1684
1760
  paymentDoneVC.additionalInfo = additionalDict
1685
- }
1761
+ // }
1686
1762
  self.navigationController?.pushViewController(paymentDoneVC, animated: true)
1687
1763
  }
1688
1764
  }