@jimrising/easymerchantsdk-react-native 2.3.4 → 2.3.5

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 (62) hide show
  1. package/README.md +1 -1
  2. package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule.dex +0 -0
  3. package/android/build/.transforms/e9a664a11ce12edf79cd87b1e07aa243/transformed/classes/classes_dex/classes.dex +0 -0
  4. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -1
  5. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  6. package/android/build.gradle +1 -1
  7. package/ios/ApiManager/APIRequest.swift +1 -4
  8. package/ios/Bundle/EasyPayBundle.swift +1 -1
  9. package/ios/Classes/EasyMerchantSdk.m +2 -2
  10. package/ios/Classes/EasyMerchantSdk.swift +3 -3
  11. package/ios/CustomComponents/PlanSelector.swift +1 -1
  12. package/ios/Example/Base.lproj/Main.storyboard +183 -22
  13. package/ios/Example/ViewController.swift +208 -182
  14. package/ios/Helper/GrailPayHelper.swift +0 -1
  15. package/ios/Models/Request.swift +96 -71
  16. package/ios/Models/SDKResult.swift +32 -25
  17. package/ios/Pods/UserDefaults/UserStoreSingleton.swift +59 -60
  18. package/ios/Pods/ViewControllers/AdditionalInfoVC.swift +360 -150
  19. package/ios/Pods/ViewControllers/BaseVC.swift +2 -1
  20. package/ios/Pods/ViewControllers/BillingInfoVC/BillingInfoVC.swift +401 -196
  21. package/ios/Pods/ViewControllers/Clean Runner_2025-07-23T14-58-05.txt +13 -0
  22. package/ios/Pods/ViewControllers/EmailVerificationVC.swift +0 -7
  23. package/ios/Pods/ViewControllers/GrailPayVC.swift +11 -3
  24. package/ios/Pods/ViewControllers/OTPVerificationVC.swift +252 -105
  25. package/ios/Pods/ViewControllers/PaymentDoneVC.swift +20 -5
  26. package/ios/Pods/ViewControllers/PaymentErrorVC.swift +2 -2
  27. package/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift +804 -347
  28. package/ios/Pods/ViewControllers/PaymentInformation/SavedAccountsTVC/SavedAccountTVC.swift +0 -1
  29. package/ios/Pods/ViewControllers/PaymentStatusWebViewVC.swift +1 -1
  30. package/ios/Pods/ViewControllers/ThreeDSecurePaymentDoneVC.swift +68 -66
  31. package/ios/Resources/Assets.xcassets/payment_done_icon.imageset/Contents.json +3 -0
  32. package/ios/easymerchantsdk.podspec +1 -1
  33. package/package.json +1 -1
  34. package/ios/CustomComponents/CheckboxButton.swift +0 -66
  35. package/ios/Models/AdditionalInfo.swift +0 -53
  36. package/ios/Models/BillingInfo.swift +0 -60
  37. package/ios/Pods/ViewControllers/CustomOverlay.swift +0 -199
  38. package/ios/Resources/Assets.xcassets/Card/Amex.imageset/206682_american_express_method_card_payment_icon.svg +0 -1
  39. package/ios/Resources/Assets.xcassets/Card/Amex.imageset/Contents.json +0 -12
  40. package/ios/Resources/Assets.xcassets/Card/Contents.json +0 -6
  41. package/ios/Resources/Assets.xcassets/Card/DinersClub.imageset/472318_card_club_diners_dinner_payment_icon.svg +0 -1
  42. package/ios/Resources/Assets.xcassets/Card/DinersClub.imageset/Contents.json +0 -12
  43. package/ios/Resources/Assets.xcassets/Card/Discover.imageset/206686_network_payment_discover_card_method_icon.svg +0 -1
  44. package/ios/Resources/Assets.xcassets/Card/Discover.imageset/Contents.json +0 -12
  45. package/ios/Resources/Assets.xcassets/Card/JCB.imageset/358102_card_jcb_payment_icon.svg +0 -1
  46. package/ios/Resources/Assets.xcassets/Card/JCB.imageset/Contents.json +0 -12
  47. package/ios/Resources/Assets.xcassets/Card/MasterCard.imageset/206680_master_method_card_payment_icon.svg +0 -1
  48. package/ios/Resources/Assets.xcassets/Card/MasterCard.imageset/Contents.json +0 -12
  49. package/ios/Resources/Assets.xcassets/Card/UnionPay.imageset/1468976_card_payment_unionpay_icon.svg +0 -1
  50. package/ios/Resources/Assets.xcassets/Card/UnionPay.imageset/Contents.json +0 -12
  51. package/ios/Resources/Assets.xcassets/Card/Visa.imageset/206684_visa_method_card_payment_icon.svg +0 -1
  52. package/ios/Resources/Assets.xcassets/Card/Visa.imageset/Contents.json +0 -12
  53. package/ios/Resources/Assets.xcassets/Card/maestro.imageset/Contents.json +0 -12
  54. package/ios/Resources/Assets.xcassets/Card/maestro.imageset/maestro.svg +0 -1
  55. package/ios/Resources/Assets.xcassets/Card/paypal.imageset/206675_paypal_method_payment_icon.svg +0 -1
  56. package/ios/Resources/Assets.xcassets/Card/paypal.imageset/Contents.json +0 -12
  57. package/ios/Resources/Assets.xcassets/Card/rupay.imageset/Contents.json +0 -12
  58. package/ios/Resources/Assets.xcassets/Card/rupay.imageset/rupay.svg +0 -1
  59. package/ios/Resources/Assets.xcassets/Card/unknown_card.imageset/4635000_card_credit_digital_money_icon.svg +0 -1
  60. package/ios/Resources/Assets.xcassets/Card/unknown_card.imageset/Contents.json +0 -12
  61. package/ios/Resources/Assets.xcassets/Card/worldpay.imageset/Contents.json +0 -12
  62. package/ios/Resources/Assets.xcassets/Card/worldpay.imageset/worldpay.svg +0 -1
@@ -0,0 +1,13 @@
1
+
2
+ Showing Recent Messages
3
+
4
+ Prepare clean
5
+ error: Could not delete `/Users/mony.dhingra/Downloads/em-MobileCheckoutSDK-Flutter/easymerchant_flutter_app/build/ios/iphoneos` because it was not created by the build system and it is not a subfolder of derived data.
6
+ note: To mark this directory as deletable by the build system, run `xattr -w com.apple.xcode.CreatedByBuildSystem true /Users/mony.dhingra/Downloads/em-MobileCheckoutSDK-Flutter/easymerchant_flutter_app/build/ios/iphoneos` when it is created.
7
+
8
+
9
+ Could not delete `/Users/mony.dhingra/Downloads/em-MobileCheckoutSDK-Flutter/easymerchant_flutter_app/build/ios/iphoneos` because it was not created by the build system and it is not a subfolder of derived data.
10
+
11
+
12
+
13
+ Clean failed 23/07/25, 2:58 PM 0.1 seconds
@@ -178,13 +178,6 @@ class EmailVerificationVC: BaseVC {
178
178
  print("Setting clientToken header: \(token ?? "None")")
179
179
  request.addValue(token ?? "", forHTTPHeaderField: "Client-Token")
180
180
 
181
- // Add API headers
182
- if let apiKey = EnvironmentConfig.apiKey,
183
- let apiSecret = EnvironmentConfig.apiSecret {
184
- request.addValue(apiKey, forHTTPHeaderField: "x-api-key")
185
- request.addValue(apiSecret, forHTTPHeaderField: "x-api-secret")
186
- }
187
-
188
181
  let params: [String: Any] = [
189
182
  "card_search_value": txtFieldEmail.text ?? "",
190
183
  "card_search_key": "email"
@@ -398,7 +398,11 @@ public class GrailPayVC: UIViewController {
398
398
  private func handleError(_ error: Error) {
399
399
  DispatchQueue.main.async {
400
400
  self.loadingIndicator.stopAnimating()
401
- self.onCompletion?(SDKResult(error: error as NSError))
401
+ let errorData: [String: Any] = [
402
+ "status": false,
403
+ "message": error.localizedDescription
404
+ ]
405
+ self.onCompletion?(SDKResult(type: .error, data: errorData as NSDictionary))
402
406
  self.dismiss(animated: true)
403
407
  }
404
408
  }
@@ -444,7 +448,7 @@ extension GrailPayVC: WKScriptMessageHandler {
444
448
  if !didHandleBankConnection {
445
449
  didHandleBankConnection = true
446
450
  DispatchQueue.main.async {
447
- self.onCompletion?(SDKResult(type: .success, chargeData: ["data": [selectedAccount]]))
451
+ self.onCompletion?(SDKResult(type: .success, data: ["data": [selectedAccount]] as NSDictionary))
448
452
  self.dismiss(animated: true)
449
453
  }
450
454
  }
@@ -456,7 +460,11 @@ extension GrailPayVC: WKScriptMessageHandler {
456
460
  }
457
461
  print("User exited linking flow")
458
462
  DispatchQueue.main.async {
459
- self.onCompletion?(SDKResult(type: .cancelled))
463
+ let cancelData: [String: Any] = [
464
+ "status": false,
465
+ "message": "User cancelled the payment"
466
+ ]
467
+ self.onCompletion?(SDKResult(type: .cancelled, data: cancelData as NSDictionary))
460
468
  self.dismiss(animated: true)
461
469
  }
462
470
 
@@ -619,26 +619,47 @@ class OTPVerificationVC: BaseVC {
619
619
  params["description"] = "Hosted payment checkout"
620
620
  }
621
621
 
622
+ // Add these if recurring is enabled
623
+ // if let req = request, req.is_recurring == true {
624
+ // if let recurringType = req.recurringStartDateType, recurringType == .custom {
625
+ // // Only send start_date if type is .custom and field is not empty
626
+ // if let startDateText = startDate, !startDateText.isEmpty {
627
+ // let inputFormatter = DateFormatter()
628
+ // inputFormatter.dateFormat = "dd/MM/yyyy"
629
+ //
630
+ // let outputFormatter = DateFormatter()
631
+ // outputFormatter.dateFormat = "MM/dd/yyyy"
632
+ //
633
+ // if let date = inputFormatter.date(from: startDateText) {
634
+ // let apiFormattedDate = outputFormatter.string(from: date)
635
+ // params["start_date"] = apiFormattedDate
636
+ // } else {
637
+ // print("Invalid date format in startDateText")
638
+ // }
639
+ // }
640
+ // }
641
+ //
642
+ // params["interval"] = chosenPlan?.lowercased()
643
+ // }
644
+
622
645
  // Add these if recurring is enabled
623
646
  if let req = request, req.is_recurring == true {
624
- if let recurringType = req.recurringStartDateType, recurringType == .custom {
625
- // Only send start_date if type is .custom and field is not empty
626
- if let startDateText = startDate, !startDateText.isEmpty {
627
- let inputFormatter = DateFormatter()
628
- inputFormatter.dateFormat = "dd/MM/yyyy"
629
-
630
- let outputFormatter = DateFormatter()
631
- outputFormatter.dateFormat = "MM/dd/yyyy"
632
-
633
- if let date = inputFormatter.date(from: startDateText) {
634
- let apiFormattedDate = outputFormatter.string(from: date)
635
- params["start_date"] = apiFormattedDate
636
- } else {
637
- print("Invalid date format in startDateText")
638
- }
647
+ if let startDateText = startDate, !startDateText.isEmpty {
648
+ let inputFormatter = DateFormatter()
649
+ inputFormatter.dateFormat = "dd/MM/yyyy"
650
+
651
+ let outputFormatter = DateFormatter()
652
+ outputFormatter.dateFormat = "MM/dd/yyyy"
653
+
654
+ if let date = inputFormatter.date(from: startDateText) {
655
+ let apiFormattedDate = outputFormatter.string(from: date)
656
+ params["start_date"] = apiFormattedDate
657
+ } else {
658
+ print("Invalid date format in startDateText")
639
659
  }
640
660
  }
641
661
 
662
+ // interval is still required
642
663
  params["interval"] = chosenPlan?.lowercased()
643
664
  }
644
665
 
@@ -788,26 +809,47 @@ class OTPVerificationVC: BaseVC {
788
809
  params["create_customer"] = "1"
789
810
  }
790
811
 
812
+ // Add these if recurring is enabled
813
+ // if let req = request, req.is_recurring == true {
814
+ // if let recurringType = req.recurringStartDateType, recurringType == .custom {
815
+ // // Only send start_date if type is .custom and field is not empty
816
+ // if let startDateText = startDate, !startDateText.isEmpty {
817
+ // let inputFormatter = DateFormatter()
818
+ // inputFormatter.dateFormat = "dd/MM/yyyy"
819
+ //
820
+ // let outputFormatter = DateFormatter()
821
+ // outputFormatter.dateFormat = "MM/dd/yyyy"
822
+ //
823
+ // if let date = inputFormatter.date(from: startDateText) {
824
+ // let apiFormattedDate = outputFormatter.string(from: date)
825
+ // params["start_date"] = apiFormattedDate
826
+ // } else {
827
+ // print("Invalid date format in startDateText")
828
+ // }
829
+ // }
830
+ // }
831
+ //
832
+ // params["interval"] = chosenPlan?.lowercased()
833
+ // }
834
+
791
835
  // Add these if recurring is enabled
792
836
  if let req = request, req.is_recurring == true {
793
- if let recurringType = req.recurringStartDateType, recurringType == .custom {
794
- // Only send start_date if type is .custom and field is not empty
795
- if let startDateText = startDate, !startDateText.isEmpty {
796
- let inputFormatter = DateFormatter()
797
- inputFormatter.dateFormat = "dd/MM/yyyy"
798
-
799
- let outputFormatter = DateFormatter()
800
- outputFormatter.dateFormat = "MM/dd/yyyy"
801
-
802
- if let date = inputFormatter.date(from: startDateText) {
803
- let apiFormattedDate = outputFormatter.string(from: date)
804
- params["start_date"] = apiFormattedDate
805
- } else {
806
- print("Invalid date format in startDateText")
807
- }
837
+ if let startDateText = startDate, !startDateText.isEmpty {
838
+ let inputFormatter = DateFormatter()
839
+ inputFormatter.dateFormat = "dd/MM/yyyy"
840
+
841
+ let outputFormatter = DateFormatter()
842
+ outputFormatter.dateFormat = "MM/dd/yyyy"
843
+
844
+ if let date = inputFormatter.date(from: startDateText) {
845
+ let apiFormattedDate = outputFormatter.string(from: date)
846
+ params["start_date"] = apiFormattedDate
847
+ } else {
848
+ print("Invalid date format in startDateText")
808
849
  }
809
850
  }
810
851
 
852
+ // interval is still required
811
853
  params["interval"] = chosenPlan?.lowercased()
812
854
  }
813
855
 
@@ -1008,26 +1050,47 @@ class OTPVerificationVC: BaseVC {
1008
1050
  params["description"] = "Hosted payment checkout"
1009
1051
  }
1010
1052
 
1053
+ // Add these if recurring is enabled
1054
+ // if let req = request, req.is_recurring == true {
1055
+ // if let recurringType = req.recurringStartDateType, recurringType == .custom {
1056
+ // // Only send start_date if type is .custom and field is not empty
1057
+ // if let startDateText = startDate, !startDateText.isEmpty {
1058
+ // let inputFormatter = DateFormatter()
1059
+ // inputFormatter.dateFormat = "dd/MM/yyyy"
1060
+ //
1061
+ // let outputFormatter = DateFormatter()
1062
+ // outputFormatter.dateFormat = "MM/dd/yyyy"
1063
+ //
1064
+ // if let date = inputFormatter.date(from: startDateText) {
1065
+ // let apiFormattedDate = outputFormatter.string(from: date)
1066
+ // params["start_date"] = apiFormattedDate
1067
+ // } else {
1068
+ // print("Invalid date format in startDateText")
1069
+ // }
1070
+ // }
1071
+ // }
1072
+ //
1073
+ // params["interval"] = chosenPlan?.lowercased()
1074
+ // }
1075
+
1011
1076
  // Add these if recurring is enabled
1012
1077
  if let req = request, req.is_recurring == true {
1013
- if let recurringType = req.recurringStartDateType, recurringType == .custom {
1014
- // Only send start_date if type is .custom and field is not empty
1015
- if let startDateText = startDate, !startDateText.isEmpty {
1016
- let inputFormatter = DateFormatter()
1017
- inputFormatter.dateFormat = "dd/MM/yyyy"
1018
-
1019
- let outputFormatter = DateFormatter()
1020
- outputFormatter.dateFormat = "MM/dd/yyyy"
1021
-
1022
- if let date = inputFormatter.date(from: startDateText) {
1023
- let apiFormattedDate = outputFormatter.string(from: date)
1024
- params["start_date"] = apiFormattedDate
1025
- } else {
1026
- print("Invalid date format in startDateText")
1027
- }
1078
+ if let startDateText = startDate, !startDateText.isEmpty {
1079
+ let inputFormatter = DateFormatter()
1080
+ inputFormatter.dateFormat = "dd/MM/yyyy"
1081
+
1082
+ let outputFormatter = DateFormatter()
1083
+ outputFormatter.dateFormat = "MM/dd/yyyy"
1084
+
1085
+ if let date = inputFormatter.date(from: startDateText) {
1086
+ let apiFormattedDate = outputFormatter.string(from: date)
1087
+ params["start_date"] = apiFormattedDate
1088
+ } else {
1089
+ print("Invalid date format in startDateText")
1028
1090
  }
1029
1091
  }
1030
1092
 
1093
+ // interval is still required
1031
1094
  params["interval"] = chosenPlan?.lowercased()
1032
1095
  }
1033
1096
 
@@ -1176,26 +1239,47 @@ class OTPVerificationVC: BaseVC {
1176
1239
  params["create_customer"] = "1"
1177
1240
  }
1178
1241
 
1242
+ // Add these if recurring is enabled
1243
+ // if let req = request, req.is_recurring == true {
1244
+ // if let recurringType = req.recurringStartDateType, recurringType == .custom {
1245
+ // // Only send start_date if type is .custom and field is not empty
1246
+ // if let startDateText = startDate, !startDateText.isEmpty {
1247
+ // let inputFormatter = DateFormatter()
1248
+ // inputFormatter.dateFormat = "dd/MM/yyyy"
1249
+ //
1250
+ // let outputFormatter = DateFormatter()
1251
+ // outputFormatter.dateFormat = "MM/dd/yyyy"
1252
+ //
1253
+ // if let date = inputFormatter.date(from: startDateText) {
1254
+ // let apiFormattedDate = outputFormatter.string(from: date)
1255
+ // params["start_date"] = apiFormattedDate
1256
+ // } else {
1257
+ // print("Invalid date format in startDateText")
1258
+ // }
1259
+ // }
1260
+ // }
1261
+ //
1262
+ // params["interval"] = chosenPlan?.lowercased()
1263
+ // }
1264
+
1179
1265
  // Add these if recurring is enabled
1180
1266
  if let req = request, req.is_recurring == true {
1181
- if let recurringType = req.recurringStartDateType, recurringType == .custom {
1182
- // Only send start_date if type is .custom and field is not empty
1183
- if let startDateText = startDate, !startDateText.isEmpty {
1184
- let inputFormatter = DateFormatter()
1185
- inputFormatter.dateFormat = "dd/MM/yyyy"
1186
-
1187
- let outputFormatter = DateFormatter()
1188
- outputFormatter.dateFormat = "MM/dd/yyyy"
1189
-
1190
- if let date = inputFormatter.date(from: startDateText) {
1191
- let apiFormattedDate = outputFormatter.string(from: date)
1192
- params["start_date"] = apiFormattedDate
1193
- } else {
1194
- print("Invalid date format in startDateText")
1195
- }
1267
+ if let startDateText = startDate, !startDateText.isEmpty {
1268
+ let inputFormatter = DateFormatter()
1269
+ inputFormatter.dateFormat = "dd/MM/yyyy"
1270
+
1271
+ let outputFormatter = DateFormatter()
1272
+ outputFormatter.dateFormat = "MM/dd/yyyy"
1273
+
1274
+ if let date = inputFormatter.date(from: startDateText) {
1275
+ let apiFormattedDate = outputFormatter.string(from: date)
1276
+ params["start_date"] = apiFormattedDate
1277
+ } else {
1278
+ print("Invalid date format in startDateText")
1196
1279
  }
1197
1280
  }
1198
1281
 
1282
+ // interval is still required
1199
1283
  params["interval"] = chosenPlan?.lowercased()
1200
1284
  }
1201
1285
 
@@ -1381,26 +1465,47 @@ class OTPVerificationVC: BaseVC {
1381
1465
  }
1382
1466
  params["description"] = descriptionValue
1383
1467
 
1468
+ // Add these if recurring is enabled
1469
+ // if let req = request, req.is_recurring == true {
1470
+ // if let recurringType = req.recurringStartDateType, recurringType == .custom {
1471
+ // // Only send start_date if type is .custom and field is not empty
1472
+ // if let startDateText = startDate, !startDateText.isEmpty {
1473
+ // let inputFormatter = DateFormatter()
1474
+ // inputFormatter.dateFormat = "dd/MM/yyyy"
1475
+ //
1476
+ // let outputFormatter = DateFormatter()
1477
+ // outputFormatter.dateFormat = "MM/dd/yyyy"
1478
+ //
1479
+ // if let date = inputFormatter.date(from: startDateText) {
1480
+ // let apiFormattedDate = outputFormatter.string(from: date)
1481
+ // params["start_date"] = apiFormattedDate
1482
+ // } else {
1483
+ // print("Invalid date format in startDateText")
1484
+ // }
1485
+ // }
1486
+ // }
1487
+ //
1488
+ // params["interval"] = chosenPlan?.lowercased()
1489
+ // }
1490
+
1384
1491
  // Add these if recurring is enabled
1385
1492
  if let req = request, req.is_recurring == true {
1386
- if let recurringType = req.recurringStartDateType, recurringType == .custom {
1387
- // Only send start_date if type is .custom and field is not empty
1388
- if let startDateText = startDate, !startDateText.isEmpty {
1389
- let inputFormatter = DateFormatter()
1390
- inputFormatter.dateFormat = "dd/MM/yyyy"
1391
-
1392
- let outputFormatter = DateFormatter()
1393
- outputFormatter.dateFormat = "MM/dd/yyyy"
1394
-
1395
- if let date = inputFormatter.date(from: startDateText) {
1396
- let apiFormattedDate = outputFormatter.string(from: date)
1397
- params["start_date"] = apiFormattedDate
1398
- } else {
1399
- print("Invalid date format in startDateText")
1400
- }
1493
+ if let startDateText = startDate, !startDateText.isEmpty {
1494
+ let inputFormatter = DateFormatter()
1495
+ inputFormatter.dateFormat = "dd/MM/yyyy"
1496
+
1497
+ let outputFormatter = DateFormatter()
1498
+ outputFormatter.dateFormat = "MM/dd/yyyy"
1499
+
1500
+ if let date = inputFormatter.date(from: startDateText) {
1501
+ let apiFormattedDate = outputFormatter.string(from: date)
1502
+ params["start_date"] = apiFormattedDate
1503
+ } else {
1504
+ print("Invalid date format in startDateText")
1401
1505
  }
1402
1506
  }
1403
1507
 
1508
+ // interval is still required
1404
1509
  params["interval"] = chosenPlan?.lowercased()
1405
1510
  }
1406
1511
 
@@ -1544,26 +1649,47 @@ class OTPVerificationVC: BaseVC {
1544
1649
  params["create_customer"] = "1"
1545
1650
  }
1546
1651
 
1652
+ // Add these if recurring is enabled
1653
+ // if let req = request, req.is_recurring == true {
1654
+ // if let recurringType = req.recurringStartDateType, recurringType == .custom {
1655
+ // // Only send start_date if type is .custom and field is not empty
1656
+ // if let startDateText = startDate, !startDateText.isEmpty {
1657
+ // let inputFormatter = DateFormatter()
1658
+ // inputFormatter.dateFormat = "dd/MM/yyyy"
1659
+ //
1660
+ // let outputFormatter = DateFormatter()
1661
+ // outputFormatter.dateFormat = "MM/dd/yyyy"
1662
+ //
1663
+ // if let date = inputFormatter.date(from: startDateText) {
1664
+ // let apiFormattedDate = outputFormatter.string(from: date)
1665
+ // params["start_date"] = apiFormattedDate
1666
+ // } else {
1667
+ // print("Invalid date format in startDateText")
1668
+ // }
1669
+ // }
1670
+ // }
1671
+ //
1672
+ // params["interval"] = chosenPlan?.lowercased()
1673
+ // }
1674
+
1547
1675
  // Add these if recurring is enabled
1548
1676
  if let req = request, req.is_recurring == true {
1549
- if let recurringType = req.recurringStartDateType, recurringType == .custom {
1550
- // Only send start_date if type is .custom and field is not empty
1551
- if let startDateText = startDate, !startDateText.isEmpty {
1552
- let inputFormatter = DateFormatter()
1553
- inputFormatter.dateFormat = "dd/MM/yyyy"
1554
-
1555
- let outputFormatter = DateFormatter()
1556
- outputFormatter.dateFormat = "MM/dd/yyyy"
1557
-
1558
- if let date = inputFormatter.date(from: startDateText) {
1559
- let apiFormattedDate = outputFormatter.string(from: date)
1560
- params["start_date"] = apiFormattedDate
1561
- } else {
1562
- print("Invalid date format in startDateText")
1563
- }
1677
+ if let startDateText = startDate, !startDateText.isEmpty {
1678
+ let inputFormatter = DateFormatter()
1679
+ inputFormatter.dateFormat = "dd/MM/yyyy"
1680
+
1681
+ let outputFormatter = DateFormatter()
1682
+ outputFormatter.dateFormat = "MM/dd/yyyy"
1683
+
1684
+ if let date = inputFormatter.date(from: startDateText) {
1685
+ let apiFormattedDate = outputFormatter.string(from: date)
1686
+ params["start_date"] = apiFormattedDate
1687
+ } else {
1688
+ print("Invalid date format in startDateText")
1564
1689
  }
1565
1690
  }
1566
1691
 
1692
+ // interval is still required
1567
1693
  params["interval"] = chosenPlan?.lowercased()
1568
1694
  }
1569
1695
 
@@ -1717,26 +1843,47 @@ class OTPVerificationVC: BaseVC {
1717
1843
  }
1718
1844
  params["description"] = descriptionValue
1719
1845
 
1846
+ // Add these if recurring is enabled
1847
+ // if let req = request, req.is_recurring == true {
1848
+ // if let recurringType = req.recurringStartDateType, recurringType == .custom {
1849
+ // // Only send start_date if type is .custom and field is not empty
1850
+ // if let startDateText = startDate, !startDateText.isEmpty {
1851
+ // let inputFormatter = DateFormatter()
1852
+ // inputFormatter.dateFormat = "dd/MM/yyyy"
1853
+ //
1854
+ // let outputFormatter = DateFormatter()
1855
+ // outputFormatter.dateFormat = "MM/dd/yyyy"
1856
+ //
1857
+ // if let date = inputFormatter.date(from: startDateText) {
1858
+ // let apiFormattedDate = outputFormatter.string(from: date)
1859
+ // params["start_date"] = apiFormattedDate
1860
+ // } else {
1861
+ // print("Invalid date format in startDateText")
1862
+ // }
1863
+ // }
1864
+ // }
1865
+ //
1866
+ // params["interval"] = chosenPlan?.lowercased()
1867
+ // }
1868
+
1720
1869
  // Add these if recurring is enabled
1721
1870
  if let req = request, req.is_recurring == true {
1722
- if let recurringType = req.recurringStartDateType, recurringType == .custom {
1723
- // Only send start_date if type is .custom and field is not empty
1724
- if let startDateText = startDate, !startDateText.isEmpty {
1725
- let inputFormatter = DateFormatter()
1726
- inputFormatter.dateFormat = "dd/MM/yyyy"
1727
-
1728
- let outputFormatter = DateFormatter()
1729
- outputFormatter.dateFormat = "MM/dd/yyyy"
1730
-
1731
- if let date = inputFormatter.date(from: startDateText) {
1732
- let apiFormattedDate = outputFormatter.string(from: date)
1733
- params["start_date"] = apiFormattedDate
1734
- } else {
1735
- print("Invalid date format in startDateText")
1736
- }
1871
+ if let startDateText = startDate, !startDateText.isEmpty {
1872
+ let inputFormatter = DateFormatter()
1873
+ inputFormatter.dateFormat = "dd/MM/yyyy"
1874
+
1875
+ let outputFormatter = DateFormatter()
1876
+ outputFormatter.dateFormat = "MM/dd/yyyy"
1877
+
1878
+ if let date = inputFormatter.date(from: startDateText) {
1879
+ let apiFormattedDate = outputFormatter.string(from: date)
1880
+ params["start_date"] = apiFormattedDate
1881
+ } else {
1882
+ print("Invalid date format in startDateText")
1737
1883
  }
1738
1884
  }
1739
1885
 
1886
+ // interval is still required
1740
1887
  params["interval"] = chosenPlan?.lowercased()
1741
1888
  }
1742
1889
 
@@ -250,11 +250,26 @@ class PaymentDoneVC: UIViewController {
250
250
  }
251
251
  }
252
252
 
253
- // Create SDK result with updated charge data
254
- let result = SDKResult(type: .success,
255
- chargeData: finalChargeData,
256
- billingInfo: billingInfo,
257
- additionalInfo: additionalInfo)
253
+ // Create response dictionary with all data
254
+ var response: [String: Any] = [:]
255
+
256
+ // Add charge data
257
+ for (key, value) in finalChargeData {
258
+ response[key] = value
259
+ }
260
+
261
+ // Add billing info if available
262
+ if let billing = billingInfo {
263
+ response["billingInfo"] = billing
264
+ }
265
+
266
+ // Add additional info if available
267
+ if let additional = additionalInfo {
268
+ response["additionalInfo"] = additional
269
+ }
270
+
271
+ // Create SDK result with combined data
272
+ let result = SDKResult(type: .success, data: response as NSDictionary)
258
273
 
259
274
  // Notify delegate and dismiss
260
275
  easyPayDelegate?.easyPayController(self.navigationController as! EasyPayViewController, didFinishWith: result)
@@ -69,14 +69,14 @@ class PaymentErrorVC: UIViewController {
69
69
  "message": errorMessage ?? "Unknown error"
70
70
  ]
71
71
 
72
- let result = SDKResult(type: .error, chargeData: errorData)
72
+ let result = SDKResult(type: .error, data: errorData as NSDictionary)
73
73
  easyPayDelegate?.easyPayController(self.navigationController as! EasyPayViewController, didFinishWith: result)
74
74
 
75
75
  if let easyPayVC = self.navigationController as? EasyPayViewController {
76
76
  easyPayVC.dismiss(animated: true) {
77
77
  if let delegate = easyPayVC.easyPayDelegate {
78
78
  UserStoreSingleton.shared.isLoggedIn = false
79
- let errorResult = SDKResult(type: .error, chargeData: errorData)
79
+ let errorResult = SDKResult(type: .error, data: errorData as NSDictionary)
80
80
  delegate.easyPayController(easyPayVC, didFinishWith: errorResult)
81
81
  }
82
82
  }