@jimrising/easymerchantsdk-react-native 1.0.8 → 1.1.0

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 (82) hide show
  1. package/.idea/caches/deviceStreaming.xml +417 -0
  2. package/.idea/easymerchantsdk-react-native.iml +9 -0
  3. package/.idea/em-MobileCheckoutSDK-ReactNative.iml +0 -0
  4. package/.idea/misc.xml +5 -0
  5. package/.idea/modules.xml +8 -0
  6. package/.idea/vcs.xml +6 -0
  7. package/.idea/workspace.xml +20 -725
  8. package/README.md +2 -2
  9. package/android/build/.transforms/27d3a0c22098810ca42038b1b8102417/results.bin +1 -0
  10. package/android/build/.transforms/27d3a0c22098810ca42038b1b8102417/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/BuildConfig.dex +0 -0
  11. package/android/build/.transforms/27d3a0c22098810ca42038b1b8102417/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$1.dex +0 -0
  12. package/android/build/.transforms/27d3a0c22098810ca42038b1b8102417/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule.dex +0 -0
  13. package/android/build/.transforms/27d3a0c22098810ca42038b1b8102417/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkPackage.dex +0 -0
  14. package/android/build/.transforms/27d3a0c22098810ca42038b1b8102417/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  15. package/android/build/.transforms/41cd2635778c1bb5c18af2c46eb9196e/results.bin +1 -0
  16. package/android/build/.transforms/41cd2635778c1bb5c18af2c46eb9196e/transformed/classes/classes_dex/classes.dex +0 -0
  17. package/android/build/.transforms/6b36622787f586c4b6e3df98c5efa11c/results.bin +1 -0
  18. package/android/build/.transforms/6b36622787f586c4b6e3df98c5efa11c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/BuildConfig.dex +0 -0
  19. package/android/build/.transforms/6b36622787f586c4b6e3df98c5efa11c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$1.dex +0 -0
  20. package/android/build/.transforms/6b36622787f586c4b6e3df98c5efa11c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule.dex +0 -0
  21. package/android/build/.transforms/6b36622787f586c4b6e3df98c5efa11c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkPackage.dex +0 -0
  22. package/android/build/.transforms/6b36622787f586c4b6e3df98c5efa11c/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  23. package/android/build/.transforms/7eb7ceaa43c9e8323ac65b4f785987b6/results.bin +1 -0
  24. package/android/build/.transforms/7eb7ceaa43c9e8323ac65b4f785987b6/transformed/classes/classes_dex/classes.dex +0 -0
  25. package/android/build/.transforms/a8b93af4be449a0e2cca4bd6ddb6685e/results.bin +1 -0
  26. package/android/build/.transforms/a8b93af4be449a0e2cca4bd6ddb6685e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/BuildConfig.dex +0 -0
  27. package/android/build/.transforms/a8b93af4be449a0e2cca4bd6ddb6685e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$1.dex +0 -0
  28. package/android/build/.transforms/a8b93af4be449a0e2cca4bd6ddb6685e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule.dex +0 -0
  29. package/android/build/.transforms/a8b93af4be449a0e2cca4bd6ddb6685e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkPackage.dex +0 -0
  30. package/android/build/.transforms/a8b93af4be449a0e2cca4bd6ddb6685e/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  31. package/android/build/.transforms/f1a160720415bc76d8d6c6734c5acf3e/results.bin +1 -0
  32. package/android/build/.transforms/f1a160720415bc76d8d6c6734c5acf3e/transformed/classes/classes_dex/classes.dex +0 -0
  33. package/android/build/generated/source/buildConfig/debug/com/reactlibrary/BuildConfig.java +10 -0
  34. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +7 -0
  35. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
  36. package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
  37. package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
  38. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  39. package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
  40. package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
  41. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
  42. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
  43. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
  44. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
  45. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
  46. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/BuildConfig.class +0 -0
  47. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$1.class +0 -0
  48. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule.class +0 -0
  49. package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkPackage.class +0 -0
  50. package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +2 -0
  51. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +7 -0
  52. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +7 -0
  53. package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
  54. package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
  55. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/BuildConfig.class +0 -0
  56. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule$1.class +0 -0
  57. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule.class +0 -0
  58. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkPackage.class +0 -0
  59. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  60. package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -0
  61. package/android/build/outputs/logs/manifest-merger-debug-report.txt +17 -0
  62. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule$1.class.uniqueId2 +0 -0
  63. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule.class.uniqueId1 +0 -0
  64. package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkPackage.class.uniqueId0 +0 -0
  65. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  66. package/android/build.gradle +1 -1
  67. package/android/src/main/java/com/reactlibrary/RNEasymerchantsdkModule.java +4 -5
  68. package/ios/Bundle/EasyPayBundle.swift +1 -0
  69. package/ios/Classes/EasyMerchantSdk.m +14 -16
  70. package/ios/Classes/EasyMerchantSdk.swift +30 -1
  71. package/ios/Classes/EasyPayViewController.swift +19 -15
  72. package/ios/EnvironmentConfig.swift +63 -0
  73. package/ios/Example/ViewController.swift +16 -14
  74. package/ios/Models/Request.swift +18 -37
  75. package/ios/Pods/ViewControllers/AdditionalInfoVC.swift +92 -37
  76. package/ios/Pods/ViewControllers/BillingInfoVC/BillingInfoVC.swift +1 -1
  77. package/ios/Pods/ViewControllers/EmailVerificationVC.swift +15 -6
  78. package/ios/Pods/ViewControllers/OTPVerificationVC.swift +90 -36
  79. package/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift +223 -108
  80. package/ios/easymerchantsdk.podspec +1 -1
  81. package/package.json +15 -6
  82. package/src/index.js +2 -2
@@ -12,7 +12,7 @@ struct PaymentsData {
12
12
  var image = String()
13
13
  }
14
14
 
15
- let EasyPaySdk = UIStoryboard(name: "EasyPaySdk", bundle: Bundle.easyPayBundle)
15
+ let EasyPaySdk = UIStoryboard(name: "easymerchantsdk", bundle: Bundle.easyPayBundle)
16
16
 
17
17
  class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
18
18
 
@@ -239,14 +239,6 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
239
239
  override func viewDidLoad() {
240
240
  super.viewDidLoad()
241
241
 
242
- // viewCardFields.layer.borderColor = UIColor.systemGray.cgColor
243
- // viewCardFields.layer.borderWidth = 1
244
- // viewCardFields.layer.cornerRadius = 8
245
-
246
- // viewBankFields.layer.borderColor = UIColor.systemGray.cgColor
247
- // viewBankFields.layer.borderWidth = 1
248
- // viewBankFields.layer.cornerRadius = 8
249
-
250
242
  viewCryptoTryAgain.layer.borderColor = UIColor.systemGray.cgColor
251
243
  viewCryptoTryAgain.layer.borderWidth = 1
252
244
  viewCryptoTryAgain.layer.cornerRadius = 8
@@ -1551,31 +1543,32 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
1551
1543
  func emailVerificationApi() {
1552
1544
  showLoadingIndicator()
1553
1545
 
1554
- var components = URLComponents()
1555
- components.scheme = "https"
1556
- components.host = "stage-api.stage-easymerchant.io"
1557
- components.path = "/api/v1/customer/send_otp"
1546
+ // Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
1547
+ let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.emailVerification.path()
1558
1548
 
1559
- guard let serviceURL = components.url else {
1549
+ guard let serviceURL = URL(string: fullURL) else {
1560
1550
  print("Invalid URL")
1561
1551
  hideLoadingIndicator()
1562
1552
  return
1563
1553
  }
1564
-
1554
+
1565
1555
  var request = URLRequest(url: serviceURL)
1566
1556
  request.httpMethod = "POST"
1567
1557
  request.addValue("application/json", forHTTPHeaderField: "Content-Type")
1568
1558
 
1559
+ // Use the clientToken from your singleton
1569
1560
  let token = UserStoreSingleton.shared.clientToken
1570
1561
  print("Setting clientToken header: \(token ?? "None")")
1571
1562
  request.addValue(token ?? "", forHTTPHeaderField: "Client-Token")
1572
1563
 
1564
+ // Define the parameters for the request
1573
1565
  let params: [String: Any] = [
1574
1566
  "card_search_value": txtFieldEmail.text ?? "",
1575
1567
  "card_search_key": "email"
1576
1568
  ]
1577
1569
 
1578
1570
  do {
1571
+ // Convert the dictionary to JSON
1579
1572
  let jsonData = try JSONSerialization.data(withJSONObject: params, options: .prettyPrinted)
1580
1573
  request.httpBody = jsonData
1581
1574
  if let jsonString = String(data: jsonData, encoding: .utf8) {
@@ -1608,11 +1601,9 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
1608
1601
  if let data = serviceData {
1609
1602
  do {
1610
1603
  if let responseObject = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] {
1611
-
1612
1604
  print("Response Data: \(responseObject)")
1613
-
1614
1605
  DispatchQueue.main.async {
1615
-
1606
+ // Handle successful response
1616
1607
  }
1617
1608
  } else {
1618
1609
  print("Invalid JSON format")
@@ -1633,18 +1624,16 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
1633
1624
  //MARK: - OTP Verification Api
1634
1625
  func otpVerificationApi() {
1635
1626
  showLoadingIndicator()
1627
+
1628
+ // Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
1629
+ let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.verifyOtp.path()
1636
1630
 
1637
- var components = URLComponents()
1638
- components.scheme = "https"
1639
- components.host = "stage-api.stage-easymerchant.io"
1640
- components.path = "/api/v1/customer/verify_otp"
1641
-
1642
- guard let serviceURL = components.url else {
1631
+ guard let serviceURL = URL(string: fullURL) else {
1643
1632
  print("Invalid URL")
1644
1633
  hideLoadingIndicator()
1645
1634
  return
1646
1635
  }
1647
-
1636
+
1648
1637
  var request = URLRequest(url: serviceURL)
1649
1638
  request.httpMethod = "POST"
1650
1639
  request.addValue("application/json", forHTTPHeaderField: "Content-Type")
@@ -1776,12 +1765,21 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
1776
1765
  func getShowCardsApi() {
1777
1766
  showLoadingIndicator()
1778
1767
 
1779
- var components = URLComponents()
1780
- components.scheme = "https"
1781
- components.host = "stage-api.stage-easymerchant.io"
1782
- components.path = "/api/v1/card"
1783
-
1784
- guard let serviceURL = components.url else {
1768
+ // var components = URLComponents()
1769
+ // components.scheme = "https"
1770
+ // components.host = "stage-api.stage-easymerchant.io"
1771
+ // components.path = "/api/v1/card"
1772
+ //
1773
+ // guard let serviceURL = components.url else {
1774
+ // print("Invalid URL")
1775
+ // hideLoadingIndicator()
1776
+ // return
1777
+ // }
1778
+
1779
+ // Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
1780
+ let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.getCards.path()
1781
+
1782
+ guard let serviceURL = URL(string: fullURL) else {
1785
1783
  print("Invalid URL")
1786
1784
  hideLoadingIndicator()
1787
1785
  return
@@ -1847,12 +1845,21 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
1847
1845
  func paymentIntentApi() {
1848
1846
  showLoadingIndicator()
1849
1847
 
1850
- var components = URLComponents()
1851
- components.scheme = "https"
1852
- components.host = "stage-api.stage-easymerchant.io"
1853
- components.path = "/api/v1/charges"
1854
-
1855
- guard let serviceURL = components.url else {
1848
+ // var components = URLComponents()
1849
+ // components.scheme = "https"
1850
+ // components.host = "stage-api.stage-easymerchant.io"
1851
+ // components.path = "/api/v1/charges"
1852
+ //
1853
+ // guard let serviceURL = components.url else {
1854
+ // print("Invalid URL")
1855
+ // hideLoadingIndicator()
1856
+ // return
1857
+ // }
1858
+
1859
+ // Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
1860
+ let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.creditCharges.path()
1861
+
1862
+ guard let serviceURL = URL(string: fullURL) else {
1856
1863
  print("Invalid URL")
1857
1864
  hideLoadingIndicator()
1858
1865
  return
@@ -1948,12 +1955,21 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
1948
1955
  func paymentIntentFromShowSavedCardApi() {
1949
1956
  showLoadingIndicator()
1950
1957
 
1951
- var components = URLComponents()
1952
- components.scheme = "https"
1953
- components.host = "stage-api.stage-easymerchant.io"
1954
- components.path = "/api/v1/charges"
1955
-
1956
- guard let serviceURL = components.url else {
1958
+ // var components = URLComponents()
1959
+ // components.scheme = "https"
1960
+ // components.host = "stage-api.stage-easymerchant.io"
1961
+ // components.path = "/api/v1/charges"
1962
+ //
1963
+ // guard let serviceURL = components.url else {
1964
+ // print("Invalid URL")
1965
+ // hideLoadingIndicator()
1966
+ // return
1967
+ // }
1968
+
1969
+ // Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
1970
+ let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.creditCharges.path()
1971
+
1972
+ guard let serviceURL = URL(string: fullURL) else {
1957
1973
  print("Invalid URL")
1958
1974
  hideLoadingIndicator()
1959
1975
  return
@@ -2052,12 +2068,21 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
2052
2068
  func paymentIntentFromAddNewCardApi(customerId: String?) {
2053
2069
  showLoadingIndicator()
2054
2070
 
2055
- var components = URLComponents()
2056
- components.scheme = "https"
2057
- components.host = "stage-api.stage-easymerchant.io"
2058
- components.path = "/api/v1/charges"
2059
-
2060
- guard let serviceURL = components.url else {
2071
+ // var components = URLComponents()
2072
+ // components.scheme = "https"
2073
+ // components.host = "stage-api.stage-easymerchant.io"
2074
+ // components.path = "/api/v1/charges"
2075
+ //
2076
+ // guard let serviceURL = components.url else {
2077
+ // print("Invalid URL")
2078
+ // hideLoadingIndicator()
2079
+ // return
2080
+ // }
2081
+
2082
+ // Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
2083
+ let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.creditCharges.path()
2084
+
2085
+ guard let serviceURL = URL(string: fullURL) else {
2061
2086
  print("Invalid URL")
2062
2087
  hideLoadingIndicator()
2063
2088
  return
@@ -2220,12 +2245,21 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
2220
2245
  func updateCardApi(cardID: String) {
2221
2246
  showLoadingIndicator()
2222
2247
 
2223
- var components = URLComponents()
2224
- components.scheme = "https"
2225
- components.host = "stage-api.stage-easymerchant.io"
2226
- components.path = "/api/v1/card/\(cardID)" // Append the card_id to the path
2227
-
2228
- guard let serviceURL = components.url else {
2248
+ // var components = URLComponents()
2249
+ // components.scheme = "https"
2250
+ // components.host = "stage-api.stage-easymerchant.io"
2251
+ // components.path = "/api/v1/card/\(cardID)" // Append the card_id to the path
2252
+ //
2253
+ // guard let serviceURL = components.url else {
2254
+ // print("Invalid URL")
2255
+ // hideLoadingIndicator()
2256
+ // return
2257
+ // }
2258
+
2259
+ // Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
2260
+ let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.getCards.path()+"/\(cardID)"
2261
+
2262
+ guard let serviceURL = URL(string: fullURL) else {
2229
2263
  print("Invalid URL")
2230
2264
  hideLoadingIndicator()
2231
2265
  return
@@ -2373,12 +2407,21 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
2373
2407
  func deleteCardApi(cardID: String, at index: Int) {
2374
2408
  showLoadingIndicator()
2375
2409
 
2376
- var components = URLComponents()
2377
- components.scheme = "https"
2378
- components.host = "stage-api.stage-easymerchant.io"
2379
- components.path = "/api/v1/card/\(cardID)" // Append the card_id to the path
2380
-
2381
- guard let serviceURL = components.url else {
2410
+ // var components = URLComponents()
2411
+ // components.scheme = "https"
2412
+ // components.host = "stage-api.stage-easymerchant.io"
2413
+ // components.path = "/api/v1/card/\(cardID)" // Append the card_id to the path
2414
+ //
2415
+ // guard let serviceURL = components.url else {
2416
+ // print("Invalid URL")
2417
+ // hideLoadingIndicator()
2418
+ // return
2419
+ // }
2420
+
2421
+ // Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
2422
+ let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.getCards.path()+"/\(cardID)"
2423
+
2424
+ guard let serviceURL = URL(string: fullURL) else {
2382
2425
  print("Invalid URL")
2383
2426
  hideLoadingIndicator()
2384
2427
  return
@@ -2456,12 +2499,21 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
2456
2499
  func getShowBankAccountsApi() {
2457
2500
  showLoadingIndicator()
2458
2501
 
2459
- var components = URLComponents()
2460
- components.scheme = "https"
2461
- components.host = "stage-api.stage-easymerchant.io"
2462
- components.path = "/api/v1/ach/account"
2463
-
2464
- guard let serviceURL = components.url else {
2502
+ // var components = URLComponents()
2503
+ // components.scheme = "https"
2504
+ // components.host = "stage-api.stage-easymerchant.io"
2505
+ // components.path = "/api/v1/ach/account"
2506
+ //
2507
+ // guard let serviceURL = components.url else {
2508
+ // print("Invalid URL")
2509
+ // hideLoadingIndicator()
2510
+ // return
2511
+ // }
2512
+
2513
+ // Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
2514
+ let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.account.path()
2515
+
2516
+ guard let serviceURL = URL(string: fullURL) else {
2465
2517
  print("Invalid URL")
2466
2518
  hideLoadingIndicator()
2467
2519
  return
@@ -2561,12 +2613,21 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
2561
2613
  func accountChargeApi() {
2562
2614
  showLoadingIndicator()
2563
2615
 
2564
- var components = URLComponents()
2565
- components.scheme = "https"
2566
- components.host = "stage-api.stage-easymerchant.io"
2567
- components.path = "/api/v1/ach/charge"
2568
-
2569
- guard let serviceURL = components.url else {
2616
+ // var components = URLComponents()
2617
+ // components.scheme = "https"
2618
+ // components.host = "stage-api.stage-easymerchant.io"
2619
+ // components.path = "/api/v1/ach/charge"
2620
+ //
2621
+ // guard let serviceURL = components.url else {
2622
+ // print("Invalid URL")
2623
+ // hideLoadingIndicator()
2624
+ // return
2625
+ // }
2626
+
2627
+ // Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
2628
+ let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.achCharge.path()
2629
+
2630
+ guard let serviceURL = URL(string: fullURL) else {
2570
2631
  print("Invalid URL")
2571
2632
  hideLoadingIndicator()
2572
2633
  return
@@ -2663,12 +2724,21 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
2663
2724
  func accountChargeSavedBankAccountApi() {
2664
2725
  showLoadingIndicator()
2665
2726
 
2666
- var components = URLComponents()
2667
- components.scheme = "https"
2668
- components.host = "stage-api.stage-easymerchant.io"
2669
- components.path = "/api/v1/ach/charge"
2670
-
2671
- guard let serviceURL = components.url else {
2727
+ // var components = URLComponents()
2728
+ // components.scheme = "https"
2729
+ // components.host = "stage-api.stage-easymerchant.io"
2730
+ // components.path = "/api/v1/ach/charge"
2731
+ //
2732
+ // guard let serviceURL = components.url else {
2733
+ // print("Invalid URL")
2734
+ // hideLoadingIndicator()
2735
+ // return
2736
+ // }
2737
+
2738
+ // Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
2739
+ let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.achCharge.path()
2740
+
2741
+ guard let serviceURL = URL(string: fullURL) else {
2672
2742
  print("Invalid URL")
2673
2743
  hideLoadingIndicator()
2674
2744
  return
@@ -2762,12 +2832,21 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
2762
2832
  func accountChargeAddNewAccountApi() {
2763
2833
  showLoadingIndicator()
2764
2834
 
2765
- var components = URLComponents()
2766
- components.scheme = "https"
2767
- components.host = "stage-api.stage-easymerchant.io"
2768
- components.path = "/api/v1/ach/charge"
2769
-
2770
- guard let serviceURL = components.url else {
2835
+ // var components = URLComponents()
2836
+ // components.scheme = "https"
2837
+ // components.host = "stage-api.stage-easymerchant.io"
2838
+ // components.path = "/api/v1/ach/charge"
2839
+ //
2840
+ // guard let serviceURL = components.url else {
2841
+ // print("Invalid URL")
2842
+ // hideLoadingIndicator()
2843
+ // return
2844
+ // }
2845
+
2846
+ // Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
2847
+ let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.achCharge.path()
2848
+
2849
+ guard let serviceURL = URL(string: fullURL) else {
2771
2850
  print("Invalid URL")
2772
2851
  hideLoadingIndicator()
2773
2852
  return
@@ -2871,12 +2950,21 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
2871
2950
  func accountChargeApi(customerId: String?) {
2872
2951
  showLoadingIndicator()
2873
2952
 
2874
- var components = URLComponents()
2875
- components.scheme = "https"
2876
- components.host = "stage-api.stage-easymerchant.io"
2877
- components.path = "/api/v1/ach/charge"
2878
-
2879
- guard let serviceURL = components.url else {
2953
+ // var components = URLComponents()
2954
+ // components.scheme = "https"
2955
+ // components.host = "stage-api.stage-easymerchant.io"
2956
+ // components.path = "/api/v1/ach/charge"
2957
+ //
2958
+ // guard let serviceURL = components.url else {
2959
+ // print("Invalid URL")
2960
+ // hideLoadingIndicator()
2961
+ // return
2962
+ // }
2963
+
2964
+ // Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
2965
+ let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.achCharge.path()
2966
+
2967
+ guard let serviceURL = URL(string: fullURL) else {
2880
2968
  print("Invalid URL")
2881
2969
  hideLoadingIndicator()
2882
2970
  return
@@ -2990,12 +3078,21 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
2990
3078
  func deleteAccountApi(accountID: String, at index: Int) {
2991
3079
  showLoadingIndicator()
2992
3080
 
2993
- var components = URLComponents()
2994
- components.scheme = "https"
2995
- components.host = "stage-api.stage-easymerchant.io"
2996
- components.path = "/api/v1/ach/account/\(accountID)" // Append the account_id to the path
2997
-
2998
- guard let serviceURL = components.url else {
3081
+ // var components = URLComponents()
3082
+ // components.scheme = "https"
3083
+ // components.host = "stage-api.stage-easymerchant.io"
3084
+ // components.path = "/api/v1/ach/account/\(accountID)" // Append the account_id to the path
3085
+ //
3086
+ // guard let serviceURL = components.url else {
3087
+ // print("Invalid URL")
3088
+ // hideLoadingIndicator()
3089
+ // return
3090
+ // }
3091
+
3092
+ // Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
3093
+ let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.achCharge.path()+"/\(accountID)"
3094
+
3095
+ guard let serviceURL = URL(string: fullURL) else {
2999
3096
  print("Invalid URL")
3000
3097
  hideLoadingIndicator()
3001
3098
  return
@@ -3061,12 +3158,21 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
3061
3158
  // MARK: - Crypto Charge API
3062
3159
  func cryptoChargeApi() {
3063
3160
  showLoadingIndicator()
3064
- var components = URLComponents()
3065
- components.scheme = "https"
3066
- components.host = "stage-api.stage-easymerchant.io"
3067
- components.path = "/api/v1/charges"
3068
-
3069
- guard let serviceURL = components.url else {
3161
+ // var components = URLComponents()
3162
+ // components.scheme = "https"
3163
+ // components.host = "stage-api.stage-easymerchant.io"
3164
+ // components.path = "/api/v1/charges"
3165
+ //
3166
+ // guard let serviceURL = components.url else {
3167
+ // print("Invalid URL")
3168
+ // hideLoadingIndicator()
3169
+ // return
3170
+ // }
3171
+
3172
+ // Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
3173
+ let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.charges.path()
3174
+
3175
+ guard let serviceURL = URL(string: fullURL) else {
3070
3176
  print("Invalid URL")
3071
3177
  hideLoadingIndicator()
3072
3178
  return
@@ -3199,13 +3305,22 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
3199
3305
  //MARK: - GET Crypto Payment Info API
3200
3306
  func getCryptoPaymentInfoApi(chargeId: String) {
3201
3307
 
3202
- var components = URLComponents()
3203
- components.scheme = "https"
3204
- components.host = "stage-api.stage-easymerchant.io"
3205
- components.path = "/api/v1/charges/\(chargeId)" // Append chargeId to the path
3308
+ // var components = URLComponents()
3309
+ // components.scheme = "https"
3310
+ // components.host = "stage-api.stage-easymerchant.io"
3311
+ // components.path = "/api/v1/charges/\(chargeId)" // Append chargeId to the path
3312
+ //
3313
+ // guard let serviceURL = components.url else {
3314
+ // print("Invalid URL")
3315
+ // return
3316
+ // }
3317
+
3318
+ // Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
3319
+ let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.charges.path()+"/\(chargeId)"
3206
3320
 
3207
- guard let serviceURL = components.url else {
3321
+ guard let serviceURL = URL(string: fullURL) else {
3208
3322
  print("Invalid URL")
3323
+ hideLoadingIndicator()
3209
3324
  return
3210
3325
  }
3211
3326
 
@@ -12,7 +12,7 @@ Pod::Spec.new do |s|
12
12
  s.source = { :path => '.' }
13
13
 
14
14
  # Platforms and version constraints
15
- s.platform = :ios, '13.4'
15
+ s.platform = :ios, '16.0'
16
16
 
17
17
  # Specify the source files for the SDK
18
18
  # s.source_files = 'Classes/**/*.{h,m,swift}'
package/package.json CHANGED
@@ -1,18 +1,27 @@
1
1
  {
2
2
  "name": "@jimrising/easymerchantsdk-react-native",
3
- "version": "1.0.8",
4
- "description": "",
3
+ "version": "1.1.0",
4
+ "description": "A React Native SDK for EasyMerchant",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
8
8
  },
9
9
  "keywords": [
10
- "react-native"
10
+ "react-native",
11
+ "easymerchant",
12
+ "sdk"
11
13
  ],
12
14
  "author": "",
13
- "license": "",
15
+ "license": "MIT",
14
16
  "peerDependencies": {
15
- "react-native": "^0.77.0",
16
- "react-native-windows": "^0.77.1"
17
+ "react-native": "^0.76.4",
18
+ "react-native-windows": "^0.76.2"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "https://github.com/EasyMerchant/em-MobileCheckoutSDK-ReactNative.git#dev-branch"
23
+ },
24
+ "publishConfig": {
25
+ "access": "restricted"
17
26
  }
18
27
  }
package/src/index.js CHANGED
@@ -14,7 +14,7 @@ const platformVersion = async () => {
14
14
  }
15
15
  };
16
16
 
17
- const billing = async (amount, billingInfo) => {
17
+ const billing = async (amount, billingInfo,env,apiKey,secretKey) => {
18
18
  return new Promise((resolve, reject) => {
19
19
  const successCallback = (response) => {
20
20
  resolve(response);
@@ -26,7 +26,7 @@ const billing = async (amount, billingInfo) => {
26
26
 
27
27
  try {
28
28
  if (Platform.OS === 'android') {
29
- RNEasymerchantsdk.billing(amount, billingInfo, successCallback, errorCallback);
29
+ RNEasymerchantsdk.billing(amount, billingInfo, env,apiKey,secretKey,successCallback, errorCallback);
30
30
  } else if (Platform.OS === 'ios') {
31
31
  EasyMerchantSdk.billing(amount, billingInfo)
32
32
  .then(successCallback)