@jimrising/easymerchantsdk-react-native 2.4.2 → 2.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 +42 -113
- package/android/build.gradle +1 -1
- package/ios/Classes/EasyMerchantSdk.m +2 -2
- package/ios/easymerchantsdk.podspec +1 -1
- package/package.json +1 -1
- package/.idea/caches/deviceStreaming.xml +0 -340
- package/.idea/em-MobileCheckoutSDK-ReactNative.iml +0 -9
- package/.idea/misc.xml +0 -5
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/android/build/generated/source/buildConfig/debug/com/reactlibrary/BuildConfig.java +0 -10
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +0 -7
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/writeDebugAarMetadata/aar-metadata.properties +0 -6
- package/android/build/intermediates/annotation_processor_list/debug/javaPreCompileDebug/annotationProcessors.json +0 -1
- 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 +0 -1
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- 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$1.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$2.class +0 -0
- package/android/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes/com/reactlibrary/RNEasymerchantsdkModule$3.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 +0 -2
- package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +0 -7
- package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +0 -7
- package/android/build/intermediates/navigation_json/debug/extractDeepLinksDebug/navigation.json +0 -1
- package/android/build/intermediates/nested_resources_validation_report/debug/generateDebugResources/nestedResourcesValidationReport.txt +0 -1
- 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$1.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$3.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 +0 -1
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -16
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/ios/Pods/UserDefaults/UserStoreSingleton.swift +0 -425
- package/ios/Pods/ViewControllers/AdditionalInfoVC.swift +0 -2996
- package/ios/Pods/ViewControllers/BaseVC.swift +0 -142
- package/ios/Pods/ViewControllers/BillingInfoVC/BillingInfoVC.swift +0 -3807
- package/ios/Pods/ViewControllers/BillingInfoVC/Cells/CityListTVC.swift +0 -46
- package/ios/Pods/ViewControllers/BillingInfoVC/Cells/CountryListTVC.swift +0 -47
- package/ios/Pods/ViewControllers/BillingInfoVC/Cells/StateListTVC.swift +0 -46
- package/ios/Pods/ViewControllers/Clean Runner_2025-07-23T14-58-05.txt +0 -13
- package/ios/Pods/ViewControllers/CountryListVC.swift +0 -435
- package/ios/Pods/ViewControllers/EmailVerificationVC.swift +0 -300
- package/ios/Pods/ViewControllers/GrailPayVC.swift +0 -492
- package/ios/Pods/ViewControllers/OTPVerificationVC.swift +0 -2278
- package/ios/Pods/ViewControllers/PaymentDoneVC.swift +0 -287
- package/ios/Pods/ViewControllers/PaymentErrorVC.swift +0 -85
- package/ios/Pods/ViewControllers/PaymentInformation/AccountTypeTVC.swift +0 -41
- package/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift +0 -13115
- package/ios/Pods/ViewControllers/PaymentInformation/PaymentInformationCVC.swift +0 -35
- package/ios/Pods/ViewControllers/PaymentInformation/RecurringTVC.swift +0 -40
- package/ios/Pods/ViewControllers/PaymentInformation/SavedAccountsTVC/SavedAccountTVC.swift +0 -80
- package/ios/Pods/ViewControllers/PaymentInformation/SavedAccountsTVC/SavedAccountTVC.xib +0 -163
- package/ios/Pods/ViewControllers/PaymentInformation/SavedCardsTVC/SavedCardsTVC.swift +0 -81
- package/ios/Pods/ViewControllers/PaymentInformation/SavedCardsTVC/SavedCardsTVC.xib +0 -188
- package/ios/Pods/ViewControllers/PaymentStatusWebViewVC.swift +0 -167
- package/ios/Pods/ViewControllers/TermAndConditionsVC.swift +0 -63
- package/ios/Pods/ViewControllers/ThreeDSecurePaymentDoneVC.swift +0 -1254
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// EmailVerficationVC.swift
|
|
3
|
-
// EasyPay
|
|
4
|
-
//
|
|
5
|
-
// Created by Mony's Mac on 14/08/24.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
import UIKit
|
|
9
|
-
|
|
10
|
-
class EmailVerificationVC: BaseVC {
|
|
11
|
-
|
|
12
|
-
@IBOutlet weak var lblUsedSavedInfo: UILabel!
|
|
13
|
-
@IBOutlet weak var subLblUsedSavedInfo: UILabel!
|
|
14
|
-
@IBOutlet weak var txtFieldEmail: UITextField!
|
|
15
|
-
@IBOutlet weak var btnGetOTP: UIButton!
|
|
16
|
-
|
|
17
|
-
var cardNumber: String?
|
|
18
|
-
var expiryDate: String?
|
|
19
|
-
var cvv: String?
|
|
20
|
-
var nameOnCard: String?
|
|
21
|
-
var userEmail: String?
|
|
22
|
-
var billingInfoData: Data?
|
|
23
|
-
|
|
24
|
-
var amount: Int?
|
|
25
|
-
|
|
26
|
-
var chosenPlan: String?
|
|
27
|
-
var startDate: String?
|
|
28
|
-
|
|
29
|
-
var selectedPaymentMethod: String?
|
|
30
|
-
|
|
31
|
-
//Banking Params
|
|
32
|
-
var accountName: String?
|
|
33
|
-
var routingNumber: String?
|
|
34
|
-
var accountType: String?
|
|
35
|
-
var accountNumber: String?
|
|
36
|
-
|
|
37
|
-
var easyPayDelegate: EasyPayViewControllerDelegate?
|
|
38
|
-
|
|
39
|
-
var isSavedForFuture: Bool = false
|
|
40
|
-
|
|
41
|
-
//GrailPay Params
|
|
42
|
-
var grailPayAccountID: String?
|
|
43
|
-
var selectedGrailPayAccountType: String?
|
|
44
|
-
var selectedGrailPayAccountName: String?
|
|
45
|
-
|
|
46
|
-
var request: Request!
|
|
47
|
-
|
|
48
|
-
var fieldSection: FieldSection?
|
|
49
|
-
var additionalInfo: [FieldItem]?
|
|
50
|
-
var billingInfo: [FieldItem]?
|
|
51
|
-
var visibility: FieldsVisibility?
|
|
52
|
-
|
|
53
|
-
var isSavedNewAccount: Bool?
|
|
54
|
-
var isFrom = String()
|
|
55
|
-
|
|
56
|
-
var isSavedNewCard: Bool = false
|
|
57
|
-
|
|
58
|
-
override func viewDidLoad() {
|
|
59
|
-
super.viewDidLoad()
|
|
60
|
-
|
|
61
|
-
uiFinishingTouch()
|
|
62
|
-
|
|
63
|
-
// Add tap gesture recognizer to dismiss the keyboard
|
|
64
|
-
let tapGesture = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard))
|
|
65
|
-
view.addGestureRecognizer(tapGesture)
|
|
66
|
-
|
|
67
|
-
if let email = userEmail {
|
|
68
|
-
txtFieldEmail.text = email
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
decodeBillingInfo()
|
|
72
|
-
|
|
73
|
-
/// Email field editable or not editable handling
|
|
74
|
-
DispatchQueue.main.async {
|
|
75
|
-
let isEmailEditable = self.request.isEmail ?? true
|
|
76
|
-
self.txtFieldEmail.isUserInteractionEnabled = isEmailEditable
|
|
77
|
-
|
|
78
|
-
// Get custom primary font color or fallback to .label
|
|
79
|
-
let primaryFontColorHex = UserStoreSingleton.shared.primary_font_col ?? "#000000"
|
|
80
|
-
let primaryFontColor = UIColor(hex: primaryFontColorHex) ?? .label
|
|
81
|
-
|
|
82
|
-
if let text = self.txtFieldEmail.text {
|
|
83
|
-
let attributes: [NSAttributedString.Key: Any] = [
|
|
84
|
-
.foregroundColor: isEmailEditable ? primaryFontColor : UIColor.gray
|
|
85
|
-
]
|
|
86
|
-
self.txtFieldEmail.attributedText = NSAttributedString(string: text, attributes: attributes)
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// Optional: Hide cursor if not editable
|
|
90
|
-
self.txtFieldEmail.tintColor = isEmailEditable ? primaryFontColor : .clear
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// MARK: - Decode billingInfoData
|
|
95
|
-
private func decodeBillingInfo() {
|
|
96
|
-
guard let data = billingInfoData else {
|
|
97
|
-
print("No billingInfoData found")
|
|
98
|
-
return
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
do {
|
|
102
|
-
let decodedSection = try JSONDecoder().decode(FieldSection.self, from: data)
|
|
103
|
-
self.fieldSection = decodedSection
|
|
104
|
-
self.billingInfo = decodedSection.billing
|
|
105
|
-
self.additionalInfo = decodedSection.additional
|
|
106
|
-
self.visibility = decodedSection.visibility
|
|
107
|
-
|
|
108
|
-
print("Decoded billingInfo: \(billingInfo ?? [])")
|
|
109
|
-
} catch {
|
|
110
|
-
print("Failed to decode billing info data: \(error)")
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
func uiFinishingTouch() {
|
|
115
|
-
if let containerBGcolor = UserStoreSingleton.shared.container_bg_col,
|
|
116
|
-
let uiColor = UIColor(hex: containerBGcolor) {
|
|
117
|
-
self.view.backgroundColor = uiColor
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
if let primaryFontColor = UserStoreSingleton.shared.primary_font_col,
|
|
121
|
-
let uiColor = UIColor(hex: primaryFontColor) {
|
|
122
|
-
lblUsedSavedInfo.textColor = uiColor
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if let primaryFontColor = UserStoreSingleton.shared.secondary_font_col,
|
|
126
|
-
let uiColor = UIColor(hex: primaryFontColor) {
|
|
127
|
-
subLblUsedSavedInfo.textColor = uiColor
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if let primaryFontColor = UserStoreSingleton.shared.primary_btn_bg_col,
|
|
131
|
-
let uiColor = UIColor(hex: primaryFontColor) {
|
|
132
|
-
btnGetOTP.backgroundColor = uiColor
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if let secondaryBtnBackgroundColor = UserStoreSingleton.shared.primary_btn_font_col,
|
|
136
|
-
let secondaryUIColor = UIColor(hex: secondaryBtnBackgroundColor) {
|
|
137
|
-
btnGetOTP.setTitleColor(secondaryUIColor, for: .normal)
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
if let borderRadiusString = UserStoreSingleton.shared.border_radious,
|
|
141
|
-
let borderRadius = Double(borderRadiusString) { // Convert String to Double
|
|
142
|
-
btnGetOTP.layer.cornerRadius = CGFloat(borderRadius) // Set corner radius
|
|
143
|
-
} else {
|
|
144
|
-
btnGetOTP.layer.cornerRadius = 8 // Default value
|
|
145
|
-
}
|
|
146
|
-
btnGetOTP.layer.masksToBounds = true // Ensure the corners are clipped properly
|
|
147
|
-
|
|
148
|
-
if let fontSizeString = UserStoreSingleton.shared.fontSize,
|
|
149
|
-
let fontSizeDouble = Double(fontSizeString) { // Convert String to Double
|
|
150
|
-
let fontSize = CGFloat(fontSizeDouble) // Convert Double to CGFloat
|
|
151
|
-
subLblUsedSavedInfo.font = UIFont.systemFont(ofSize: fontSize)
|
|
152
|
-
btnGetOTP.titleLabel?.font = UIFont.systemFont(ofSize: fontSize)
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// Method to dismiss the keyboard
|
|
157
|
-
@objc func dismissKeyboard() {
|
|
158
|
-
view.endEditing(true)
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// MARK: - Send OTP Email Verification Api
|
|
162
|
-
func emailVerificationApi() {
|
|
163
|
-
showLoadingIndicator()
|
|
164
|
-
|
|
165
|
-
let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.emailVerification.path()
|
|
166
|
-
|
|
167
|
-
guard let serviceURL = URL(string: fullURL) else {
|
|
168
|
-
print("Invalid URL")
|
|
169
|
-
hideLoadingIndicator()
|
|
170
|
-
return
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
var request = URLRequest(url: serviceURL)
|
|
174
|
-
request.httpMethod = "POST"
|
|
175
|
-
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
|
|
176
|
-
|
|
177
|
-
let token = UserStoreSingleton.shared.clientToken
|
|
178
|
-
print("Setting clientToken header: \(token ?? "None")")
|
|
179
|
-
request.addValue(token ?? "", forHTTPHeaderField: "Client-Token")
|
|
180
|
-
|
|
181
|
-
let params: [String: Any] = [
|
|
182
|
-
"card_search_value": txtFieldEmail.text ?? "",
|
|
183
|
-
"card_search_key": "email"
|
|
184
|
-
]
|
|
185
|
-
|
|
186
|
-
do {
|
|
187
|
-
let jsonData = try JSONSerialization.data(withJSONObject: params, options: .prettyPrinted)
|
|
188
|
-
request.httpBody = jsonData
|
|
189
|
-
if let jsonString = String(data: jsonData, encoding: .utf8) {
|
|
190
|
-
print("JSON Payload: \(jsonString)")
|
|
191
|
-
}
|
|
192
|
-
} catch let error {
|
|
193
|
-
print("Error creating JSON data: \(error)")
|
|
194
|
-
hideLoadingIndicator()
|
|
195
|
-
return
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
let session = URLSession.shared
|
|
199
|
-
let task = session.dataTask(with: request) { (serviceData, serviceResponse, error) in
|
|
200
|
-
|
|
201
|
-
DispatchQueue.main.async {
|
|
202
|
-
self.hideLoadingIndicator()
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
if let error = error {
|
|
206
|
-
print("Error: \(error.localizedDescription)")
|
|
207
|
-
return
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
guard let httpResponse = serviceResponse as? HTTPURLResponse else {
|
|
211
|
-
print("Invalid response")
|
|
212
|
-
return
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
if httpResponse.statusCode == 200 || httpResponse.statusCode == 201 {
|
|
216
|
-
if let data = serviceData {
|
|
217
|
-
do {
|
|
218
|
-
if let responseObject = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] {
|
|
219
|
-
print("Response Data: \(responseObject)")
|
|
220
|
-
|
|
221
|
-
DispatchQueue.main.async {
|
|
222
|
-
if let vc = self.storyboard?.instantiateViewController(withIdentifier: "OTPVerificationVC") as? OTPVerificationVC {
|
|
223
|
-
vc.selectedPaymentMethod = self.selectedPaymentMethod
|
|
224
|
-
vc.easyPayDelegate = self.easyPayDelegate
|
|
225
|
-
vc.email = self.txtFieldEmail.text
|
|
226
|
-
vc.chosenPlan = self.chosenPlan
|
|
227
|
-
vc.startDate = self.startDate
|
|
228
|
-
vc.request = self.request
|
|
229
|
-
vc.billingInfoData = self.billingInfoData
|
|
230
|
-
vc.userEmail = self.userEmail
|
|
231
|
-
vc.billingInfo = self.fieldSection?.billing
|
|
232
|
-
vc.additionalInfo = self.fieldSection?.additional
|
|
233
|
-
vc.visibility = self.fieldSection?.visibility
|
|
234
|
-
vc.isSavedForFuture = self.isSavedForFuture
|
|
235
|
-
|
|
236
|
-
switch self.selectedPaymentMethod {
|
|
237
|
-
case "Card":
|
|
238
|
-
vc.cardNumber = self.cardNumber
|
|
239
|
-
vc.expiryDate = self.expiryDate
|
|
240
|
-
vc.cvv = self.cvv
|
|
241
|
-
vc.nameOnCard = self.nameOnCard
|
|
242
|
-
|
|
243
|
-
case "Bank":
|
|
244
|
-
vc.accountName = self.accountName
|
|
245
|
-
vc.routingNumber = self.routingNumber
|
|
246
|
-
vc.accountType = self.accountType
|
|
247
|
-
vc.accountNumber = self.accountNumber
|
|
248
|
-
|
|
249
|
-
case "GrailPay":
|
|
250
|
-
vc.grailPayAccountID = self.grailPayAccountID
|
|
251
|
-
vc.selectedGrailPayAccountType = self.selectedGrailPayAccountType
|
|
252
|
-
vc.selectedGrailPayAccountName = self.selectedGrailPayAccountName
|
|
253
|
-
|
|
254
|
-
default:
|
|
255
|
-
break
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
self.navigationController?.pushViewController(vc, animated: true)
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
} else {
|
|
262
|
-
print("Invalid JSON format")
|
|
263
|
-
}
|
|
264
|
-
} catch let jsonError {
|
|
265
|
-
print("Error parsing JSON: \(jsonError)")
|
|
266
|
-
}
|
|
267
|
-
} else {
|
|
268
|
-
print("No data received")
|
|
269
|
-
}
|
|
270
|
-
} else {
|
|
271
|
-
print("HTTP Status Code: \(httpResponse.statusCode)")
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
task.resume()
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
@IBAction func actionBtnCancel(_ sender: UIButton) {
|
|
278
|
-
for viewController in self.navigationController?.viewControllers ?? [] {
|
|
279
|
-
if viewController is PaymentInfoVC {
|
|
280
|
-
self.navigationController?.popToViewController(viewController, animated: true)
|
|
281
|
-
break
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
@IBAction func actionBtnGetOTP(_ sender: UIButton) {
|
|
287
|
-
guard let email = txtFieldEmail.text, !email.isEmpty else {
|
|
288
|
-
// Show an alert if the email field is empty
|
|
289
|
-
showAlert(message: "Please enter an email address.")
|
|
290
|
-
return
|
|
291
|
-
}
|
|
292
|
-
// Validate email format before calling the API
|
|
293
|
-
if isValidEmail(email) {
|
|
294
|
-
emailVerificationApi()
|
|
295
|
-
} else {
|
|
296
|
-
showAlert(message: "Please enter a valid email address.")
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
}
|