@jimrising/easymerchantsdk-react-native 1.4.2 → 1.4.4
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/README.md +15 -4
- package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$1.dex +0 -0
- package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule$2.dex +0 -0
- package/android/build/.transforms/20e1216b87bd06eaab3c9e5c68d4267a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/com/reactlibrary/RNEasymerchantsdkModule.dex +0 -0
- package/android/build/.transforms/e9a664a11ce12edf79cd87b1e07aa243/transformed/classes/classes_dex/classes.dex +0 -0
- package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +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$2.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule.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$2.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_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule$1.class.uniqueId2 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule$2.class.uniqueId0 +0 -0
- package/android/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir/RNEasymerchantsdkModule.class.uniqueId3 +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 +0 -1
- package/ios/Classes/EasyMerchantSdk.m +4 -2
- package/ios/Classes/EasyMerchantSdk.swift +2 -0
- package/ios/Models/Request.swift +45 -54
- package/ios/Models/Result.swift +1 -0
- package/ios/Pods/ViewControllers/AdditionalInfoVC.swift +310 -88
- package/ios/Pods/ViewControllers/BillingInfoVC/BillingInfoVC.swift +289 -59
- package/ios/Pods/ViewControllers/EmailVerificationVC.swift +41 -86
- package/ios/Pods/ViewControllers/OTPVerificationVC.swift +208 -129
- package/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift +1304 -158
- package/ios/Pods/ViewControllers/ThreeDSecurePaymentDoneVC.swift +24 -258
- package/ios/easymerchantsdk.podspec +1 -1
- package/ios/easymerchantsdk.storyboard +93 -12
- package/package.json +1 -1
|
@@ -53,6 +53,8 @@ class EmailVerificationVC: BaseVC {
|
|
|
53
53
|
var isSavedNewAccount: Bool?
|
|
54
54
|
var isFrom = String()
|
|
55
55
|
|
|
56
|
+
var isSavedNewCard: Bool = false
|
|
57
|
+
|
|
56
58
|
override func viewDidLoad() {
|
|
57
59
|
super.viewDidLoad()
|
|
58
60
|
|
|
@@ -139,35 +141,35 @@ class EmailVerificationVC: BaseVC {
|
|
|
139
141
|
// MARK: - Send OTP Email Verification Api
|
|
140
142
|
func emailVerificationApi() {
|
|
141
143
|
showLoadingIndicator()
|
|
142
|
-
|
|
144
|
+
|
|
143
145
|
let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.emailVerification.path()
|
|
144
|
-
|
|
146
|
+
|
|
145
147
|
guard let serviceURL = URL(string: fullURL) else {
|
|
146
148
|
print("Invalid URL")
|
|
147
149
|
hideLoadingIndicator()
|
|
148
150
|
return
|
|
149
151
|
}
|
|
150
|
-
|
|
152
|
+
|
|
151
153
|
var request = URLRequest(url: serviceURL)
|
|
152
154
|
request.httpMethod = "POST"
|
|
153
155
|
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
|
|
154
|
-
|
|
156
|
+
|
|
155
157
|
let token = UserStoreSingleton.shared.clientToken
|
|
156
158
|
print("Setting clientToken header: \(token ?? "None")")
|
|
157
159
|
request.addValue(token ?? "", forHTTPHeaderField: "Client-Token")
|
|
158
|
-
|
|
160
|
+
|
|
159
161
|
// Add API headers
|
|
160
162
|
if let apiKey = EnvironmentConfig.apiKey,
|
|
161
163
|
let apiSecret = EnvironmentConfig.apiSecret {
|
|
162
164
|
request.addValue(apiKey, forHTTPHeaderField: "x-api-key")
|
|
163
165
|
request.addValue(apiSecret, forHTTPHeaderField: "x-api-secret")
|
|
164
166
|
}
|
|
165
|
-
|
|
167
|
+
|
|
166
168
|
let params: [String: Any] = [
|
|
167
169
|
"card_search_value": txtFieldEmail.text ?? "",
|
|
168
170
|
"card_search_key": "email"
|
|
169
171
|
]
|
|
170
|
-
|
|
172
|
+
|
|
171
173
|
do {
|
|
172
174
|
let jsonData = try JSONSerialization.data(withJSONObject: params, options: .prettyPrinted)
|
|
173
175
|
request.httpBody = jsonData
|
|
@@ -179,115 +181,68 @@ class EmailVerificationVC: BaseVC {
|
|
|
179
181
|
hideLoadingIndicator()
|
|
180
182
|
return
|
|
181
183
|
}
|
|
182
|
-
|
|
184
|
+
|
|
183
185
|
let session = URLSession.shared
|
|
184
186
|
let task = session.dataTask(with: request) { (serviceData, serviceResponse, error) in
|
|
185
|
-
|
|
187
|
+
|
|
186
188
|
DispatchQueue.main.async {
|
|
187
|
-
self.hideLoadingIndicator()
|
|
189
|
+
self.hideLoadingIndicator()
|
|
188
190
|
}
|
|
189
|
-
|
|
191
|
+
|
|
190
192
|
if let error = error {
|
|
191
193
|
print("Error: \(error.localizedDescription)")
|
|
192
194
|
return
|
|
193
195
|
}
|
|
194
|
-
|
|
196
|
+
|
|
195
197
|
guard let httpResponse = serviceResponse as? HTTPURLResponse else {
|
|
196
198
|
print("Invalid response")
|
|
197
199
|
return
|
|
198
200
|
}
|
|
199
|
-
|
|
201
|
+
|
|
200
202
|
if httpResponse.statusCode == 200 || httpResponse.statusCode == 201 {
|
|
201
203
|
if let data = serviceData {
|
|
202
204
|
do {
|
|
203
205
|
if let responseObject = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] {
|
|
204
206
|
print("Response Data: \(responseObject)")
|
|
205
|
-
|
|
206
|
-
// Navigate to PaymentDoneVC and pass the response data
|
|
207
|
+
|
|
207
208
|
DispatchQueue.main.async {
|
|
208
|
-
if self.
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
if let vc = self.storyboard?.instantiateViewController(withIdentifier: "OTPVerificationVC") as? OTPVerificationVC {
|
|
210
|
+
vc.selectedPaymentMethod = self.selectedPaymentMethod
|
|
211
|
+
vc.easyPayDelegate = self.easyPayDelegate
|
|
212
|
+
vc.email = self.txtFieldEmail.text
|
|
213
|
+
vc.chosenPlan = self.chosenPlan
|
|
214
|
+
vc.startDate = self.startDate
|
|
215
|
+
vc.request = self.request
|
|
216
|
+
vc.billingInfoData = self.billingInfoData
|
|
217
|
+
vc.userEmail = self.userEmail
|
|
218
|
+
vc.billingInfo = self.fieldSection?.billing
|
|
219
|
+
vc.additionalInfo = self.fieldSection?.additional
|
|
220
|
+
vc.visibility = self.fieldSection?.visibility
|
|
221
|
+
vc.isSavedForFuture = self.isSavedForFuture
|
|
222
|
+
|
|
223
|
+
switch self.selectedPaymentMethod {
|
|
224
|
+
case "Card":
|
|
211
225
|
vc.cardNumber = self.cardNumber
|
|
212
226
|
vc.expiryDate = self.expiryDate
|
|
213
227
|
vc.cvv = self.cvv
|
|
214
228
|
vc.nameOnCard = self.nameOnCard
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
vc.selectedPaymentMethod = self.selectedPaymentMethod
|
|
218
|
-
vc.easyPayDelegate = self.easyPayDelegate
|
|
219
|
-
vc.email = self.txtFieldEmail.text
|
|
220
|
-
vc.isSavedForFuture = self.isSavedForFuture
|
|
221
|
-
vc.request = self.request
|
|
222
|
-
vc.chosenPlan = self.chosenPlan
|
|
223
|
-
vc.startDate = self.startDate
|
|
224
|
-
vc.userEmail = self.userEmail
|
|
225
|
-
vc.billingInfo = self.billingInfo
|
|
226
|
-
vc.additionalInfo = self.additionalInfo
|
|
227
|
-
vc.visibility = self.visibility
|
|
228
|
-
self.navigationController?.pushViewController(vc, animated: true)
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
else if self.selectedPaymentMethod == "Bank" {
|
|
232
|
-
if let vc = self.storyboard?.instantiateViewController(withIdentifier: "OTPVerificationVC") as? OTPVerificationVC {
|
|
229
|
+
|
|
230
|
+
case "Bank":
|
|
233
231
|
vc.accountName = self.accountName
|
|
234
232
|
vc.routingNumber = self.routingNumber
|
|
235
233
|
vc.accountType = self.accountType
|
|
236
234
|
vc.accountNumber = self.accountNumber
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
vc.selectedPaymentMethod = self.selectedPaymentMethod
|
|
240
|
-
vc.easyPayDelegate = self.easyPayDelegate
|
|
241
|
-
vc.email = self.txtFieldEmail.text
|
|
242
|
-
vc.chosenPlan = self.chosenPlan
|
|
243
|
-
vc.startDate = self.startDate
|
|
244
|
-
vc.request = self.request
|
|
245
|
-
vc.userEmail = self.userEmail
|
|
246
|
-
vc.billingInfo = self.fieldSection?.billing
|
|
247
|
-
vc.additionalInfo = self.fieldSection?.additional
|
|
248
|
-
vc.visibility = self.fieldSection?.visibility
|
|
249
|
-
self.navigationController?.pushViewController(vc, animated: true)
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
else if self.selectedPaymentMethod == "GrailPay" {
|
|
253
|
-
if let vc = self.storyboard?.instantiateViewController(withIdentifier: "OTPVerificationVC") as? OTPVerificationVC {
|
|
254
|
-
vc.selectedPaymentMethod = self.selectedPaymentMethod
|
|
255
|
-
vc.easyPayDelegate = self.easyPayDelegate
|
|
256
|
-
vc.grailPayAccountID = self.grailPayAccountID
|
|
257
|
-
vc.selectedGrailPayAccountType = self.selectedGrailPayAccountType
|
|
258
|
-
vc.selectedGrailPayAccountName = self.selectedGrailPayAccountName
|
|
259
|
-
vc.email = self.txtFieldEmail.text
|
|
260
|
-
vc.chosenPlan = self.chosenPlan
|
|
261
|
-
vc.startDate = self.startDate
|
|
262
|
-
vc.request = self.request
|
|
263
|
-
vc.billingInfoData = self.billingInfoData
|
|
264
|
-
vc.billingInfo = self.billingInfo
|
|
265
|
-
vc.userEmail = self.userEmail
|
|
266
|
-
vc.billingInfo = self.fieldSection?.billing
|
|
267
|
-
vc.additionalInfo = self.fieldSection?.additional
|
|
268
|
-
vc.visibility = self.fieldSection?.visibility
|
|
269
|
-
self.navigationController?.pushViewController(vc, animated: true)
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
else if self.selectedPaymentMethod == "NewGrailPayAccount" {
|
|
273
|
-
if let vc = self.storyboard?.instantiateViewController(withIdentifier: "OTPVerificationVC") as? OTPVerificationVC {
|
|
274
|
-
vc.selectedPaymentMethod = self.selectedPaymentMethod
|
|
275
|
-
vc.easyPayDelegate = self.easyPayDelegate
|
|
235
|
+
|
|
236
|
+
case "GrailPay":
|
|
276
237
|
vc.grailPayAccountID = self.grailPayAccountID
|
|
277
238
|
vc.selectedGrailPayAccountType = self.selectedGrailPayAccountType
|
|
278
239
|
vc.selectedGrailPayAccountName = self.selectedGrailPayAccountName
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
vc.request = self.request
|
|
283
|
-
vc.billingInfoData = self.billingInfoData
|
|
284
|
-
vc.billingInfo = self.billingInfo
|
|
285
|
-
vc.userEmail = self.userEmail
|
|
286
|
-
vc.billingInfo = self.fieldSection?.billing
|
|
287
|
-
vc.additionalInfo = self.fieldSection?.additional
|
|
288
|
-
vc.visibility = self.fieldSection?.visibility
|
|
289
|
-
self.navigationController?.pushViewController(vc, animated: true)
|
|
240
|
+
|
|
241
|
+
default:
|
|
242
|
+
break
|
|
290
243
|
}
|
|
244
|
+
|
|
245
|
+
self.navigationController?.pushViewController(vc, animated: true)
|
|
291
246
|
}
|
|
292
247
|
}
|
|
293
248
|
} else {
|