@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.
- package/.idea/caches/deviceStreaming.xml +417 -0
- package/.idea/easymerchantsdk-react-native.iml +9 -0
- package/.idea/em-MobileCheckoutSDK-ReactNative.iml +0 -0
- package/.idea/misc.xml +5 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.idea/workspace.xml +20 -725
- package/README.md +2 -2
- package/android/build/.transforms/27d3a0c22098810ca42038b1b8102417/results.bin +1 -0
- package/android/build/.transforms/27d3a0c22098810ca42038b1b8102417/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/BuildConfig.dex +0 -0
- package/android/build/.transforms/27d3a0c22098810ca42038b1b8102417/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$1.dex +0 -0
- package/android/build/.transforms/27d3a0c22098810ca42038b1b8102417/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule.dex +0 -0
- package/android/build/.transforms/27d3a0c22098810ca42038b1b8102417/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkPackage.dex +0 -0
- package/android/build/.transforms/27d3a0c22098810ca42038b1b8102417/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/41cd2635778c1bb5c18af2c46eb9196e/results.bin +1 -0
- package/android/build/.transforms/41cd2635778c1bb5c18af2c46eb9196e/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/6b36622787f586c4b6e3df98c5efa11c/results.bin +1 -0
- package/android/build/.transforms/6b36622787f586c4b6e3df98c5efa11c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/BuildConfig.dex +0 -0
- package/android/build/.transforms/6b36622787f586c4b6e3df98c5efa11c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$1.dex +0 -0
- package/android/build/.transforms/6b36622787f586c4b6e3df98c5efa11c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule.dex +0 -0
- package/android/build/.transforms/6b36622787f586c4b6e3df98c5efa11c/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkPackage.dex +0 -0
- package/android/build/.transforms/6b36622787f586c4b6e3df98c5efa11c/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/7eb7ceaa43c9e8323ac65b4f785987b6/results.bin +1 -0
- package/android/build/.transforms/7eb7ceaa43c9e8323ac65b4f785987b6/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/.transforms/a8b93af4be449a0e2cca4bd6ddb6685e/results.bin +1 -0
- package/android/build/.transforms/a8b93af4be449a0e2cca4bd6ddb6685e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/BuildConfig.dex +0 -0
- package/android/build/.transforms/a8b93af4be449a0e2cca4bd6ddb6685e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$1.dex +0 -0
- package/android/build/.transforms/a8b93af4be449a0e2cca4bd6ddb6685e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule.dex +0 -0
- package/android/build/.transforms/a8b93af4be449a0e2cca4bd6ddb6685e/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkPackage.dex +0 -0
- package/android/build/.transforms/a8b93af4be449a0e2cca4bd6ddb6685e/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
- package/android/build/.transforms/f1a160720415bc76d8d6c6734c5acf3e/results.bin +1 -0
- package/android/build/.transforms/f1a160720415bc76d8d6c6734c5acf3e/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/com/reactlibrary/BuildConfig.java +10 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +7 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +18 -0
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +6 -0
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +1 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/generateDebugRFile/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/generateDebugRFile/R.txt +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkPackage.class +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/parseDebugLocalResources/R-def.txt +2 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +7 -0
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +7 -0
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +1 -0
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +1 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/reactlibrary/RNEasymerchantsdkPackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/generateDebugRFile/package-aware-r.txt +1 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +17 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule$1.class.uniqueId2 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule.class.uniqueId1 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkPackage.class.uniqueId0 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/reactlibrary/RNEasymerchantsdkModule.java +4 -5
- package/ios/Bundle/EasyPayBundle.swift +1 -0
- package/ios/Classes/EasyMerchantSdk.m +14 -16
- package/ios/Classes/EasyMerchantSdk.swift +30 -1
- package/ios/Classes/EasyPayViewController.swift +19 -15
- package/ios/EnvironmentConfig.swift +63 -0
- package/ios/Example/ViewController.swift +16 -14
- package/ios/Models/Request.swift +18 -37
- package/ios/Pods/ViewControllers/AdditionalInfoVC.swift +92 -37
- package/ios/Pods/ViewControllers/BillingInfoVC/BillingInfoVC.swift +1 -1
- package/ios/Pods/ViewControllers/EmailVerificationVC.swift +15 -6
- package/ios/Pods/ViewControllers/OTPVerificationVC.swift +90 -36
- package/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift +223 -108
- package/ios/easymerchantsdk.podspec +1 -1
- package/package.json +15 -6
- package/src/index.js +2 -2
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
//
|
|
2
|
-
// ViewController.swift
|
|
3
|
-
// EasyPaySDKDemo
|
|
4
|
-
//
|
|
5
|
-
// Created by iftekhar on 13/07/24.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
1
|
import UIKit
|
|
9
2
|
|
|
10
3
|
class ViewController: UIViewController {
|
|
@@ -14,12 +7,24 @@ class ViewController: UIViewController {
|
|
|
14
7
|
|
|
15
8
|
override func viewDidLoad() {
|
|
16
9
|
super.viewDidLoad()
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
|
|
11
|
+
// Developer selects the environment
|
|
12
|
+
EnvironmentConfig.setEnvironment(.staging) // Or .sandbox, .production
|
|
19
13
|
}
|
|
20
14
|
|
|
21
15
|
@IBAction private func payAction() {
|
|
22
|
-
//
|
|
16
|
+
//Staging Keys
|
|
17
|
+
let apiKey = "mobilesdk1980IUuCzwWl"
|
|
18
|
+
let apiSecret = "mobilesdk1980LVHnN0Oh"
|
|
19
|
+
|
|
20
|
+
//Sandboxing Keys
|
|
21
|
+
// let apiKey = "f149cf5afc3a67c79e0aa87e7"
|
|
22
|
+
// let apiSecret = "22b9dd1e588146077ca77da82"
|
|
23
|
+
|
|
24
|
+
// Configure the SDK with custom API keys
|
|
25
|
+
EnvironmentConfig.configure(apiKey: apiKey, apiSecret: apiSecret)
|
|
26
|
+
|
|
27
|
+
// Create the payment request
|
|
23
28
|
let additionalInfoRequest = [
|
|
24
29
|
"name": "Test User",
|
|
25
30
|
"email": "test@gmail.com",
|
|
@@ -37,13 +42,12 @@ class ViewController: UIViewController {
|
|
|
37
42
|
"additional_info": additionalInfoRequest
|
|
38
43
|
]
|
|
39
44
|
|
|
40
|
-
// Convert the dictionary to JSON
|
|
41
45
|
guard let jsonData = try? JSONSerialization.data(withJSONObject: json, options: []) else {
|
|
42
46
|
print("Failed to serialize JSON")
|
|
43
47
|
return
|
|
44
48
|
}
|
|
45
49
|
|
|
46
|
-
//
|
|
50
|
+
// Send the payment request
|
|
47
51
|
let request = Request(amount: 99, billingInfoData: jsonData)
|
|
48
52
|
let controller = EasyPayViewController(request: request, delegate: self)
|
|
49
53
|
self.present(controller, animated: true)
|
|
@@ -62,7 +66,6 @@ extension ViewController: EasyPayViewControllerDelegate {
|
|
|
62
66
|
handleSuccess(with: chargeData)
|
|
63
67
|
}
|
|
64
68
|
case .error:
|
|
65
|
-
// Handle the error and display the message on lblResponseShow
|
|
66
69
|
if let chargeData = result.chargeData, let errorMessage = chargeData["errorMessage"] as? String {
|
|
67
70
|
lblResponseShow.isHidden = false
|
|
68
71
|
lblResponseShow.text = "Error: \(errorMessage)"
|
|
@@ -79,4 +82,3 @@ extension ViewController: EasyPayViewControllerDelegate {
|
|
|
79
82
|
}
|
|
80
83
|
|
|
81
84
|
}
|
|
82
|
-
|
package/ios/Models/Request.swift
CHANGED
|
@@ -11,7 +11,7 @@ import UIKit
|
|
|
11
11
|
public final class Request: NSObject {
|
|
12
12
|
public let amount: Double
|
|
13
13
|
public let billingInfoData: Data?
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
public init(amount: Double, billingInfoData: Data? = nil) {
|
|
16
16
|
self.amount = amount
|
|
17
17
|
self.billingInfoData = billingInfoData
|
|
@@ -29,15 +29,12 @@ public final class Request: NSObject {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
}
|
|
32
|
-
|
|
32
|
+
|
|
33
|
+
//MARK: - Payment Intent Api
|
|
33
34
|
func paymentIntentApi(completion: @escaping (Bool) -> Void) {
|
|
34
35
|
// Start loader when API call starts
|
|
35
|
-
var components = URLComponents()
|
|
36
|
-
components.scheme = "https"
|
|
37
|
-
components.host = "stage-api.stage-easymerchant.io"
|
|
38
|
-
components.path = "/api/v1/paymentintent"
|
|
39
36
|
|
|
40
|
-
guard let serviceURL =
|
|
37
|
+
guard let serviceURL = URL(string: EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.paymentIntent.path()) else {
|
|
41
38
|
print("Invalid URL")
|
|
42
39
|
completion(false)
|
|
43
40
|
return
|
|
@@ -46,8 +43,8 @@ public final class Request: NSObject {
|
|
|
46
43
|
var request = URLRequest(url: serviceURL)
|
|
47
44
|
request.httpMethod = "POST"
|
|
48
45
|
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
|
|
49
|
-
request.addValue("
|
|
50
|
-
request.addValue("
|
|
46
|
+
request.addValue(EnvironmentConfig.apiKey ?? "", forHTTPHeaderField: "X-Api-Key")
|
|
47
|
+
request.addValue(EnvironmentConfig.apiSecret ?? "", forHTTPHeaderField: "X-Api-Secret")
|
|
51
48
|
|
|
52
49
|
let params: [String: Any] = [
|
|
53
50
|
"amount": amount,
|
|
@@ -63,7 +60,7 @@ public final class Request: NSObject {
|
|
|
63
60
|
|
|
64
61
|
let task = URLSession.shared.dataTask(with: request) { data, response, error in
|
|
65
62
|
DispatchQueue.main.async {
|
|
66
|
-
|
|
63
|
+
// Stop loader when response is received
|
|
67
64
|
}
|
|
68
65
|
|
|
69
66
|
guard let httpResponse = response as? HTTPURLResponse, error == nil else {
|
|
@@ -111,19 +108,19 @@ public final class Request: NSObject {
|
|
|
111
108
|
task.resume()
|
|
112
109
|
}
|
|
113
110
|
|
|
111
|
+
// MARK: - Hosted Checkout API
|
|
114
112
|
func hostedCheckoutsApi(completion: @escaping (Bool) -> Void) {
|
|
115
113
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
components.path = "/api/v1/hostedcheckouts"
|
|
120
|
-
|
|
121
|
-
guard let serviceURL = components.url else {
|
|
122
|
-
print("Invalid URL")
|
|
114
|
+
// Build the URL using EnvironmentConfig
|
|
115
|
+
guard let baseURL = URL(string: EnvironmentConfig.baseURL) else {
|
|
116
|
+
print("Invalid base URL")
|
|
123
117
|
completion(false)
|
|
124
118
|
return
|
|
125
119
|
}
|
|
126
120
|
|
|
121
|
+
let endpointPath = EnvironmentConfig.Endpoints.hostedCheckouts.path()
|
|
122
|
+
let serviceURL = baseURL.appendingPathComponent(endpointPath)
|
|
123
|
+
|
|
127
124
|
var request = URLRequest(url: serviceURL)
|
|
128
125
|
request.httpMethod = "POST"
|
|
129
126
|
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
|
|
@@ -161,12 +158,12 @@ public final class Request: NSObject {
|
|
|
161
158
|
UserStoreSingleton.shared.merchantEmail = merchantEmail
|
|
162
159
|
print("Saved merchantEmail: \(merchantEmail)")
|
|
163
160
|
}
|
|
164
|
-
|
|
161
|
+
|
|
165
162
|
if let merchantName = dataObject["merchant_name"] as? String {
|
|
166
163
|
UserStoreSingleton.shared.merchantName = merchantName
|
|
167
164
|
print("Saved merchantName: \(merchantName)")
|
|
168
165
|
}
|
|
169
|
-
|
|
166
|
+
|
|
170
167
|
// Save payment methods (crypto payment account)
|
|
171
168
|
if let paymentMethods = dataObject["payment_methods"] as? [String: Any],
|
|
172
169
|
let cryptoSection = paymentMethods["crypto"] as? [String: Any],
|
|
@@ -174,7 +171,7 @@ public final class Request: NSObject {
|
|
|
174
171
|
UserStoreSingleton.shared.paymentAccount = paymentAccount
|
|
175
172
|
print("Saved paymentAccount (Crypto): \(paymentAccount)")
|
|
176
173
|
}
|
|
177
|
-
|
|
174
|
+
|
|
178
175
|
// Save appearance settings
|
|
179
176
|
if let appearanceSettings = dataObject["apperance_settings"] as? [String: Any] {
|
|
180
177
|
if let bodyBgCol = appearanceSettings["body_bg_col"] as? String {
|
|
@@ -244,21 +241,5 @@ public final class Request: NSObject {
|
|
|
244
241
|
}
|
|
245
242
|
task.resume()
|
|
246
243
|
}
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
244
|
|
|
264
|
-
|
|
245
|
+
}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import UIKit
|
|
9
9
|
|
|
10
|
+
@available(iOS 16.0, *)
|
|
10
11
|
class AdditionalInfoVC: BaseVC {
|
|
11
12
|
|
|
12
13
|
@IBOutlet weak var viewAdditionalInfo: UIView!
|
|
@@ -207,14 +208,23 @@ class AdditionalInfoVC: BaseVC {
|
|
|
207
208
|
func paymentIntentApi() {
|
|
208
209
|
showLoadingIndicator()
|
|
209
210
|
|
|
210
|
-
var components = URLComponents()
|
|
211
|
-
components.scheme = "https"
|
|
212
|
-
components.host = "stage-api.stage-easymerchant.io"
|
|
213
|
-
components.path = "/api/v1/charges"
|
|
214
|
-
|
|
215
|
-
guard let serviceURL = components.url else {
|
|
211
|
+
// var components = URLComponents()
|
|
212
|
+
// components.scheme = "https"
|
|
213
|
+
// components.host = "stage-api.stage-easymerchant.io"
|
|
214
|
+
// components.path = "/api/v1/charges"
|
|
215
|
+
//
|
|
216
|
+
// guard let serviceURL = components.url else {
|
|
217
|
+
// print("Invalid URL")
|
|
218
|
+
// self.hideLoadingIndicator()
|
|
219
|
+
// return
|
|
220
|
+
// }
|
|
221
|
+
|
|
222
|
+
// Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
|
|
223
|
+
let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.charges.path()
|
|
224
|
+
|
|
225
|
+
guard let serviceURL = URL(string: fullURL) else {
|
|
216
226
|
print("Invalid URL")
|
|
217
|
-
|
|
227
|
+
hideLoadingIndicator()
|
|
218
228
|
return
|
|
219
229
|
}
|
|
220
230
|
|
|
@@ -337,12 +347,21 @@ class AdditionalInfoVC: BaseVC {
|
|
|
337
347
|
//MARK: - Credit Card Charge Api from Saved cards
|
|
338
348
|
func paymentIntentFromShowCardApi() {
|
|
339
349
|
showLoadingIndicator()
|
|
340
|
-
var components = URLComponents()
|
|
341
|
-
components.scheme = "https"
|
|
342
|
-
components.host = "stage-api.stage-easymerchant.io"
|
|
343
|
-
components.path = "/api/v1/charges"
|
|
344
|
-
|
|
345
|
-
guard let serviceURL = components.url else {
|
|
350
|
+
// var components = URLComponents()
|
|
351
|
+
// components.scheme = "https"
|
|
352
|
+
// components.host = "stage-api.stage-easymerchant.io"
|
|
353
|
+
// components.path = "/api/v1/charges"
|
|
354
|
+
//
|
|
355
|
+
// guard let serviceURL = components.url else {
|
|
356
|
+
// print("Invalid URL")
|
|
357
|
+
// hideLoadingIndicator()
|
|
358
|
+
// return
|
|
359
|
+
// }
|
|
360
|
+
|
|
361
|
+
// Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
|
|
362
|
+
let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.charges.path()
|
|
363
|
+
|
|
364
|
+
guard let serviceURL = URL(string: fullURL) else {
|
|
346
365
|
print("Invalid URL")
|
|
347
366
|
hideLoadingIndicator()
|
|
348
367
|
return
|
|
@@ -467,12 +486,21 @@ class AdditionalInfoVC: BaseVC {
|
|
|
467
486
|
func paymentIntentAddNewCardApi(customerId: String?) {
|
|
468
487
|
showLoadingIndicator()
|
|
469
488
|
|
|
470
|
-
var components = URLComponents()
|
|
471
|
-
components.scheme = "https"
|
|
472
|
-
components.host = "stage-api.stage-easymerchant.io"
|
|
473
|
-
components.path = "/api/v1/charges"
|
|
474
|
-
|
|
475
|
-
guard let serviceURL = components.url else {
|
|
489
|
+
// var components = URLComponents()
|
|
490
|
+
// components.scheme = "https"
|
|
491
|
+
// components.host = "stage-api.stage-easymerchant.io"
|
|
492
|
+
// components.path = "/api/v1/charges"
|
|
493
|
+
//
|
|
494
|
+
// guard let serviceURL = components.url else {
|
|
495
|
+
// print("Invalid URL")
|
|
496
|
+
// hideLoadingIndicator()
|
|
497
|
+
// return
|
|
498
|
+
// }
|
|
499
|
+
|
|
500
|
+
// Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
|
|
501
|
+
let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.charges.path()
|
|
502
|
+
|
|
503
|
+
guard let serviceURL = URL(string: fullURL) else {
|
|
476
504
|
print("Invalid URL")
|
|
477
505
|
hideLoadingIndicator()
|
|
478
506
|
return
|
|
@@ -609,12 +637,21 @@ class AdditionalInfoVC: BaseVC {
|
|
|
609
637
|
func accountChargeApi() {
|
|
610
638
|
showLoadingIndicator()
|
|
611
639
|
|
|
612
|
-
var components = URLComponents()
|
|
613
|
-
components.scheme = "https"
|
|
614
|
-
components.host = "stage-api.stage-easymerchant.io"
|
|
615
|
-
components.path = "/api/v1/ach/charge"
|
|
616
|
-
|
|
617
|
-
guard let serviceURL = components.url else {
|
|
640
|
+
// var components = URLComponents()
|
|
641
|
+
// components.scheme = "https"
|
|
642
|
+
// components.host = "stage-api.stage-easymerchant.io"
|
|
643
|
+
// components.path = "/api/v1/ach/charge"
|
|
644
|
+
//
|
|
645
|
+
// guard let serviceURL = components.url else {
|
|
646
|
+
// print("Invalid URL")
|
|
647
|
+
// hideLoadingIndicator()
|
|
648
|
+
// return
|
|
649
|
+
// }
|
|
650
|
+
|
|
651
|
+
// Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
|
|
652
|
+
let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.achCharge.path()
|
|
653
|
+
|
|
654
|
+
guard let serviceURL = URL(string: fullURL) else {
|
|
618
655
|
print("Invalid URL")
|
|
619
656
|
hideLoadingIndicator()
|
|
620
657
|
return
|
|
@@ -742,12 +779,21 @@ class AdditionalInfoVC: BaseVC {
|
|
|
742
779
|
func accountChargeSavedBankAccountApi() {
|
|
743
780
|
showLoadingIndicator()
|
|
744
781
|
|
|
745
|
-
var components = URLComponents()
|
|
746
|
-
components.scheme = "https"
|
|
747
|
-
components.host = "stage-api.stage-easymerchant.io"
|
|
748
|
-
components.path = "/api/v1/ach/charge"
|
|
749
|
-
|
|
750
|
-
guard let serviceURL = components.url else {
|
|
782
|
+
// var components = URLComponents()
|
|
783
|
+
// components.scheme = "https"
|
|
784
|
+
// components.host = "stage-api.stage-easymerchant.io"
|
|
785
|
+
// components.path = "/api/v1/ach/charge"
|
|
786
|
+
//
|
|
787
|
+
// guard let serviceURL = components.url else {
|
|
788
|
+
// print("Invalid URL")
|
|
789
|
+
// hideLoadingIndicator()
|
|
790
|
+
// return
|
|
791
|
+
// }
|
|
792
|
+
|
|
793
|
+
// Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
|
|
794
|
+
let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.achCharge.path()
|
|
795
|
+
|
|
796
|
+
guard let serviceURL = URL(string: fullURL) else {
|
|
751
797
|
print("Invalid URL")
|
|
752
798
|
hideLoadingIndicator()
|
|
753
799
|
return
|
|
@@ -872,12 +918,21 @@ class AdditionalInfoVC: BaseVC {
|
|
|
872
918
|
func accountChargeApi(customerId: String?) {
|
|
873
919
|
showLoadingIndicator()
|
|
874
920
|
|
|
875
|
-
var components = URLComponents()
|
|
876
|
-
components.scheme = "https"
|
|
877
|
-
components.host = "stage-api.stage-easymerchant.io"
|
|
878
|
-
components.path = "/api/v1/ach/charge"
|
|
879
|
-
|
|
880
|
-
guard let serviceURL = components.url else {
|
|
921
|
+
// var components = URLComponents()
|
|
922
|
+
// components.scheme = "https"
|
|
923
|
+
// components.host = "stage-api.stage-easymerchant.io"
|
|
924
|
+
// components.path = "/api/v1/ach/charge"
|
|
925
|
+
//
|
|
926
|
+
// guard let serviceURL = components.url else {
|
|
927
|
+
// print("Invalid URL")
|
|
928
|
+
// hideLoadingIndicator()
|
|
929
|
+
// return
|
|
930
|
+
// }
|
|
931
|
+
|
|
932
|
+
// Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
|
|
933
|
+
let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.achCharge.path()
|
|
934
|
+
|
|
935
|
+
guard let serviceURL = URL(string: fullURL) else {
|
|
881
936
|
print("Invalid URL")
|
|
882
937
|
hideLoadingIndicator()
|
|
883
938
|
return
|
|
@@ -48,15 +48,24 @@ class EmailVerificationVC: BaseVC {
|
|
|
48
48
|
view.endEditing(true)
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
//Send OTP Email Verification Api
|
|
51
|
+
// MARK: - Send OTP Email Verification Api
|
|
52
52
|
func emailVerificationApi() {
|
|
53
53
|
showLoadingIndicator()
|
|
54
|
-
var components = URLComponents()
|
|
55
|
-
components.scheme = "https"
|
|
56
|
-
components.host = "stage-api.stage-easymerchant.io"
|
|
57
|
-
components.path = "/api/v1/customer/send_otp"
|
|
54
|
+
// var components = URLComponents()
|
|
55
|
+
// components.scheme = "https"
|
|
56
|
+
// components.host = "stage-api.stage-easymerchant.io"
|
|
57
|
+
// components.path = "/api/v1/customer/send_otp"
|
|
58
|
+
//
|
|
59
|
+
// guard let serviceURL = components.url else {
|
|
60
|
+
// print("Invalid URL")
|
|
61
|
+
// hideLoadingIndicator()
|
|
62
|
+
// return
|
|
63
|
+
// }
|
|
58
64
|
|
|
59
|
-
|
|
65
|
+
// Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
|
|
66
|
+
let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.emailVerification.path()
|
|
67
|
+
|
|
68
|
+
guard let serviceURL = URL(string: fullURL) else {
|
|
60
69
|
print("Invalid URL")
|
|
61
70
|
hideLoadingIndicator()
|
|
62
71
|
return
|
|
@@ -116,12 +116,21 @@ class OTPVerificationVC: BaseVC {
|
|
|
116
116
|
func otpVerificationApi() {
|
|
117
117
|
showLoadingIndicator()
|
|
118
118
|
|
|
119
|
-
var components = URLComponents()
|
|
120
|
-
components.scheme = "https"
|
|
121
|
-
components.host = "stage-api.stage-easymerchant.io"
|
|
122
|
-
components.path = "/api/v1/customer/verify_otp"
|
|
123
|
-
|
|
124
|
-
guard let serviceURL = components.url else {
|
|
119
|
+
// var components = URLComponents()
|
|
120
|
+
// components.scheme = "https"
|
|
121
|
+
// components.host = "stage-api.stage-easymerchant.io"
|
|
122
|
+
// components.path = "/api/v1/customer/verify_otp"
|
|
123
|
+
//
|
|
124
|
+
// guard let serviceURL = components.url else {
|
|
125
|
+
// print("Invalid URL")
|
|
126
|
+
// hideLoadingIndicator()
|
|
127
|
+
// return
|
|
128
|
+
// }
|
|
129
|
+
|
|
130
|
+
// Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
|
|
131
|
+
let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.verifyOtp.path()
|
|
132
|
+
|
|
133
|
+
guard let serviceURL = URL(string: fullURL) else {
|
|
125
134
|
print("Invalid URL")
|
|
126
135
|
hideLoadingIndicator()
|
|
127
136
|
return
|
|
@@ -233,12 +242,21 @@ class OTPVerificationVC: BaseVC {
|
|
|
233
242
|
//MARK: - Send OTP Email Verification Api
|
|
234
243
|
func emailVerificationApi() {
|
|
235
244
|
showLoadingIndicator()
|
|
236
|
-
var components = URLComponents()
|
|
237
|
-
components.scheme = "https"
|
|
238
|
-
components.host = "stage-api.stage-easymerchant.io"
|
|
239
|
-
components.path = "/api/v1/customer/send_otp"
|
|
240
|
-
|
|
241
|
-
guard let serviceURL = components.url else {
|
|
245
|
+
// var components = URLComponents()
|
|
246
|
+
// components.scheme = "https"
|
|
247
|
+
// components.host = "stage-api.stage-easymerchant.io"
|
|
248
|
+
// components.path = "/api/v1/customer/send_otp"
|
|
249
|
+
//
|
|
250
|
+
// guard let serviceURL = components.url else {
|
|
251
|
+
// print("Invalid URL")
|
|
252
|
+
// hideLoadingIndicator()
|
|
253
|
+
// return
|
|
254
|
+
// }
|
|
255
|
+
|
|
256
|
+
// Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
|
|
257
|
+
let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.emailVerification.path()
|
|
258
|
+
|
|
259
|
+
guard let serviceURL = URL(string: fullURL) else {
|
|
242
260
|
print("Invalid URL")
|
|
243
261
|
hideLoadingIndicator()
|
|
244
262
|
return
|
|
@@ -312,12 +330,21 @@ class OTPVerificationVC: BaseVC {
|
|
|
312
330
|
func paymentIntentApi(customerId: String?) {
|
|
313
331
|
showLoadingIndicator()
|
|
314
332
|
|
|
315
|
-
var components = URLComponents()
|
|
316
|
-
components.scheme = "https"
|
|
317
|
-
components.host = "stage-api.stage-easymerchant.io"
|
|
318
|
-
components.path = "/api/v1/charges"
|
|
319
|
-
|
|
320
|
-
guard let serviceURL = components.url else {
|
|
333
|
+
// var components = URLComponents()
|
|
334
|
+
// components.scheme = "https"
|
|
335
|
+
// components.host = "stage-api.stage-easymerchant.io"
|
|
336
|
+
// components.path = "/api/v1/charges"
|
|
337
|
+
//
|
|
338
|
+
// guard let serviceURL = components.url else {
|
|
339
|
+
// print("Invalid URL")
|
|
340
|
+
// hideLoadingIndicator()
|
|
341
|
+
// return
|
|
342
|
+
// }
|
|
343
|
+
|
|
344
|
+
// Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
|
|
345
|
+
let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.charges.path()
|
|
346
|
+
|
|
347
|
+
guard let serviceURL = URL(string: fullURL) else {
|
|
321
348
|
print("Invalid URL")
|
|
322
349
|
hideLoadingIndicator()
|
|
323
350
|
return
|
|
@@ -450,12 +477,21 @@ class OTPVerificationVC: BaseVC {
|
|
|
450
477
|
func paymentIntentWithSavedCardApi(customerId: String?) {
|
|
451
478
|
showLoadingIndicator()
|
|
452
479
|
|
|
453
|
-
var components = URLComponents()
|
|
454
|
-
components.scheme = "https"
|
|
455
|
-
components.host = "stage-api.stage-easymerchant.io"
|
|
456
|
-
components.path = "/api/v1/charges"
|
|
457
|
-
|
|
458
|
-
guard let serviceURL = components.url else {
|
|
480
|
+
// var components = URLComponents()
|
|
481
|
+
// components.scheme = "https"
|
|
482
|
+
// components.host = "stage-api.stage-easymerchant.io"
|
|
483
|
+
// components.path = "/api/v1/charges"
|
|
484
|
+
//
|
|
485
|
+
// guard let serviceURL = components.url else {
|
|
486
|
+
// print("Invalid URL")
|
|
487
|
+
// hideLoadingIndicator()
|
|
488
|
+
// return
|
|
489
|
+
// }
|
|
490
|
+
|
|
491
|
+
// Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
|
|
492
|
+
let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.charges.path()
|
|
493
|
+
|
|
494
|
+
guard let serviceURL = URL(string: fullURL) else {
|
|
459
495
|
print("Invalid URL")
|
|
460
496
|
hideLoadingIndicator()
|
|
461
497
|
return
|
|
@@ -574,12 +610,21 @@ class OTPVerificationVC: BaseVC {
|
|
|
574
610
|
func accountChargeApi(customerId: String?) {
|
|
575
611
|
showLoadingIndicator()
|
|
576
612
|
|
|
577
|
-
var components = URLComponents()
|
|
578
|
-
components.scheme = "https"
|
|
579
|
-
components.host = "stage-api.stage-easymerchant.io"
|
|
580
|
-
components.path = "/api/v1/ach/charge"
|
|
581
|
-
|
|
582
|
-
guard let serviceURL = components.url else {
|
|
613
|
+
// var components = URLComponents()
|
|
614
|
+
// components.scheme = "https"
|
|
615
|
+
// components.host = "stage-api.stage-easymerchant.io"
|
|
616
|
+
// components.path = "/api/v1/ach/charge"
|
|
617
|
+
//
|
|
618
|
+
// guard let serviceURL = components.url else {
|
|
619
|
+
// print("Invalid URL")
|
|
620
|
+
// hideLoadingIndicator()
|
|
621
|
+
// return
|
|
622
|
+
// }
|
|
623
|
+
|
|
624
|
+
// Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
|
|
625
|
+
let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.achCharge.path()
|
|
626
|
+
|
|
627
|
+
guard let serviceURL = URL(string: fullURL) else {
|
|
583
628
|
print("Invalid URL")
|
|
584
629
|
hideLoadingIndicator()
|
|
585
630
|
return
|
|
@@ -711,12 +756,21 @@ class OTPVerificationVC: BaseVC {
|
|
|
711
756
|
func accountChargeWithSavedAccountApi(customerId: String?) {
|
|
712
757
|
showLoadingIndicator()
|
|
713
758
|
|
|
714
|
-
var components = URLComponents()
|
|
715
|
-
components.scheme = "https"
|
|
716
|
-
components.host = "stage-api.stage-easymerchant.io"
|
|
717
|
-
components.path = "/api/v1/ach/charge"
|
|
718
|
-
|
|
719
|
-
guard let serviceURL = components.url else {
|
|
759
|
+
// var components = URLComponents()
|
|
760
|
+
// components.scheme = "https"
|
|
761
|
+
// components.host = "stage-api.stage-easymerchant.io"
|
|
762
|
+
// components.path = "/api/v1/ach/charge"
|
|
763
|
+
//
|
|
764
|
+
// guard let serviceURL = components.url else {
|
|
765
|
+
// print("Invalid URL")
|
|
766
|
+
// hideLoadingIndicator()
|
|
767
|
+
// return
|
|
768
|
+
// }
|
|
769
|
+
|
|
770
|
+
// Construct the full URL using baseURL from EnvironmentConfig and path from the endpoint
|
|
771
|
+
let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.achCharge.path()
|
|
772
|
+
|
|
773
|
+
guard let serviceURL = URL(string: fullURL) else {
|
|
720
774
|
print("Invalid URL")
|
|
721
775
|
hideLoadingIndicator()
|
|
722
776
|
return
|