@jimrising/easymerchantsdk-react-native 1.2.1 → 1.2.2

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 (26) hide show
  1. package/.idea/caches/deviceStreaming.xml +209 -0
  2. package/.idea/workspace.xml +193 -0
  3. package/README.md +1 -1
  4. package/ios/Classes/EasyMerchantSdk.m +5 -5
  5. package/ios/Pods/UserDefaults/UserStoreSingleton.swift +233 -0
  6. package/ios/Pods/ViewControllers/AdditionalInfoVC.swift +1137 -0
  7. package/ios/Pods/ViewControllers/BaseVC.swift +126 -0
  8. package/ios/Pods/ViewControllers/BillingInfoVC/BillingInfoVC.swift +803 -0
  9. package/ios/Pods/ViewControllers/BillingInfoVC/Cells/CityListTVC.swift +46 -0
  10. package/ios/Pods/ViewControllers/BillingInfoVC/Cells/CountryListTVC.swift +47 -0
  11. package/ios/Pods/ViewControllers/BillingInfoVC/Cells/StateListTVC.swift +46 -0
  12. package/ios/Pods/ViewControllers/CountryListVC.swift +404 -0
  13. package/ios/Pods/ViewControllers/EmailVerificationVC.swift +239 -0
  14. package/ios/Pods/ViewControllers/OTPVerificationVC.swift +1134 -0
  15. package/ios/Pods/ViewControllers/PaymentDoneVC.swift +159 -0
  16. package/ios/Pods/ViewControllers/PaymentErrorVC.swift +90 -0
  17. package/ios/Pods/ViewControllers/PaymentInformation/AccountTypeTVC.swift +41 -0
  18. package/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift +5160 -0
  19. package/ios/Pods/ViewControllers/PaymentInformation/PaymentInformationCVC.swift +35 -0
  20. package/ios/Pods/ViewControllers/PaymentInformation/SavedAccountsTVC/SavedAccountTVC.swift +77 -0
  21. package/ios/Pods/ViewControllers/PaymentInformation/SavedAccountsTVC/SavedAccountTVC.xib +163 -0
  22. package/ios/Pods/ViewControllers/PaymentInformation/SavedCardsTVC/SavedCardsTVC.swift +76 -0
  23. package/ios/Pods/ViewControllers/PaymentInformation/SavedCardsTVC/SavedCardsTVC.xib +184 -0
  24. package/ios/Pods/ViewControllers/TermAndConditionsVC.swift +63 -0
  25. package/ios/easymerchantsdk.podspec +2 -2
  26. package/package.json +1 -1
@@ -0,0 +1,46 @@
1
+ //
2
+ // CityListTVC.swift
3
+ // EasyPay
4
+ //
5
+ // Created by Mony's Mac on 12/08/24.
6
+ //
7
+
8
+ import UIKit
9
+
10
+ class CityListTVC: UITableViewCell {
11
+
12
+ @IBOutlet weak var viewCell: UIView!
13
+ @IBOutlet weak var lblCityName: UILabel!
14
+
15
+ override func awakeFromNib() {
16
+ super.awakeFromNib()
17
+
18
+ if let primaryFontColor = UserStoreSingleton.shared.primary_font_col,
19
+ let uiColor = UIColor(hex: primaryFontColor) {
20
+ lblCityName.textColor = uiColor
21
+ }
22
+
23
+ if let fontSizeString = UserStoreSingleton.shared.fontSize,
24
+ let fontSizeDouble = Double(fontSizeString) { // Convert String to Double
25
+ let fontSize = CGFloat(fontSizeDouble) // Convert Double to CGFloat
26
+ lblCityName.font = UIFont.systemFont(ofSize: fontSize)
27
+ }
28
+
29
+ // Set background color for the main view
30
+ if let containerBGcolor = UserStoreSingleton.shared.container_bg_col,
31
+ let uiColor = UIColor(hex: containerBGcolor) {
32
+ self.contentView.backgroundColor = uiColor
33
+ }
34
+ }
35
+
36
+ override func layoutSubviews() {
37
+ super.layoutSubviews()
38
+
39
+ if let containerBGcolor = UserStoreSingleton.shared.container_bg_col,
40
+ let uiColor = UIColor(hex: containerBGcolor) {
41
+ self.contentView.backgroundColor = uiColor
42
+ viewCell?.backgroundColor = uiColor // Prevents crash if viewCell is nil
43
+ }
44
+ }
45
+
46
+ }
@@ -0,0 +1,47 @@
1
+ //
2
+ // CountryListTVC.swift
3
+ // EasyPay
4
+ //
5
+ // Created by Mony's Mac on 12/08/24.
6
+ //
7
+
8
+ import UIKit
9
+
10
+ class CountryListTVC: UITableViewCell {
11
+
12
+ @IBOutlet weak var lblCountryName: UILabel!
13
+ @IBOutlet weak var viewCell: UIView!
14
+
15
+ override func awakeFromNib() {
16
+ super.awakeFromNib()
17
+
18
+ if let primaryFontColor = UserStoreSingleton.shared.primary_font_col,
19
+ let uiColor = UIColor(hex: primaryFontColor) {
20
+ lblCountryName.textColor = uiColor
21
+ }
22
+
23
+ if let fontSizeString = UserStoreSingleton.shared.fontSize,
24
+ let fontSizeDouble = Double(fontSizeString) { // Convert String to Double
25
+ let fontSize = CGFloat(fontSizeDouble) // Convert Double to CGFloat
26
+ lblCountryName.font = UIFont.systemFont(ofSize: fontSize)
27
+ }
28
+
29
+ // Set background color for the main view
30
+ if let containerBGcolor = UserStoreSingleton.shared.container_bg_col,
31
+ let uiColor = UIColor(hex: containerBGcolor) {
32
+ self.contentView.backgroundColor = uiColor
33
+ }
34
+
35
+ }
36
+
37
+ override func layoutSubviews() {
38
+ super.layoutSubviews()
39
+
40
+ if let containerBGcolor = UserStoreSingleton.shared.container_bg_col,
41
+ let uiColor = UIColor(hex: containerBGcolor) {
42
+ self.contentView.backgroundColor = uiColor
43
+ viewCell?.backgroundColor = uiColor // Prevents crash if viewCell is nil
44
+ }
45
+ }
46
+
47
+ }
@@ -0,0 +1,46 @@
1
+ //
2
+ // StateListTVC.swift
3
+ // EasyPay
4
+ //
5
+ // Created by Mony's Mac on 12/08/24.
6
+ //
7
+
8
+ import UIKit
9
+
10
+ class StateListTVC: UITableViewCell {
11
+
12
+ @IBOutlet weak var lblStateName: UILabel!
13
+ @IBOutlet weak var viewCell: UIView!
14
+
15
+ override func awakeFromNib() {
16
+ super.awakeFromNib()
17
+
18
+ if let primaryFontColor = UserStoreSingleton.shared.primary_font_col,
19
+ let uiColor = UIColor(hex: primaryFontColor) {
20
+ lblStateName.textColor = uiColor
21
+ }
22
+
23
+ if let fontSizeString = UserStoreSingleton.shared.fontSize,
24
+ let fontSizeDouble = Double(fontSizeString) { // Convert String to Double
25
+ let fontSize = CGFloat(fontSizeDouble) // Convert Double to CGFloat
26
+ lblStateName.font = UIFont.systemFont(ofSize: fontSize)
27
+ }
28
+
29
+ // Set background color for the main view
30
+ if let containerBGcolor = UserStoreSingleton.shared.container_bg_col,
31
+ let uiColor = UIColor(hex: containerBGcolor) {
32
+ self.contentView.backgroundColor = uiColor
33
+ }
34
+ }
35
+
36
+ override func layoutSubviews() {
37
+ super.layoutSubviews()
38
+
39
+ if let containerBGcolor = UserStoreSingleton.shared.container_bg_col,
40
+ let uiColor = UIColor(hex: containerBGcolor) {
41
+ self.contentView.backgroundColor = uiColor
42
+ viewCell?.backgroundColor = uiColor // Prevents crash if viewCell is nil
43
+ }
44
+ }
45
+
46
+ }
@@ -0,0 +1,404 @@
1
+ //
2
+ // CountryListVC.swift
3
+ // EasyPay
4
+ //
5
+ // Created by Mony's Mac on 26/11/24.
6
+ //
7
+
8
+ import UIKit
9
+
10
+ protocol CountryListVCDelegate: AnyObject {
11
+ func didSelectCountry(_ country: Country)
12
+ }
13
+
14
+ class CountryListVC: UIViewController {
15
+
16
+ @IBOutlet var viewClass: UIView!
17
+ @IBOutlet weak var searchBarCountry: UISearchBar!
18
+ @IBOutlet weak var tblViewCountry: UITableView!
19
+
20
+ var list: [Country] = [Country]()
21
+ var searchList: [Country] = [Country]()
22
+
23
+ weak var delegate: CountryListVCDelegate?
24
+
25
+ override func viewDidLoad() {
26
+ super.viewDidLoad()
27
+
28
+ if let containerBGcolor = UserStoreSingleton.shared.container_bg_col,
29
+ let uiColor = UIColor(hex: containerBGcolor) {
30
+ self.view.backgroundColor = uiColor
31
+ self.searchBarCountry.backgroundColor = uiColor
32
+ self.searchBarCountry.barTintColor = uiColor
33
+ }
34
+
35
+ if let primaryFontColor = UserStoreSingleton.shared.primary_btn_bg_col,
36
+ let uiColor = UIColor(hex: primaryFontColor) {
37
+ searchBarCountry.tintColor = uiColor
38
+ }
39
+
40
+ if let primaryFontColor = UserStoreSingleton.shared.primary_font_col,
41
+ let uiColor = UIColor(hex: primaryFontColor) {
42
+ searchBarCountry.searchTextField.textColor = uiColor
43
+ }
44
+
45
+ if let fontSizeString = UserStoreSingleton.shared.fontSize,
46
+ let fontSizeDouble = Double(fontSizeString) { // Convert String to Double
47
+ let fontSize = CGFloat(fontSizeDouble) // Convert Double to CGFloat
48
+ searchBarCountry.searchTextField.font = UIFont.systemFont(ofSize: fontSize)
49
+ }
50
+
51
+ tblViewCountry.delegate = self
52
+ tblViewCountry.dataSource = self
53
+
54
+ searchBarCountry.delegate = self
55
+
56
+ self.navigationItem.title = "Select Country"
57
+ self.tblViewCountry.separatorStyle = .none
58
+ configuration()
59
+ }
60
+
61
+ func configuration() {
62
+ for code in NSLocale.isoCountryCodes {
63
+ let id = NSLocale.localeIdentifier(fromComponents: [NSLocale.Key.countryCode.rawValue: code])
64
+ let name = NSLocale(localeIdentifier: "en_US").displayName(forKey: NSLocale.Key.identifier, value: id)
65
+ let locale = NSLocale.init(localeIdentifier: id)
66
+
67
+ let countryCode = locale.object(forKey: NSLocale.Key.countryCode)
68
+ let currencyCode = locale.object(forKey: NSLocale.Key.currencyCode)
69
+ let currencySymbol = locale.object(forKey: NSLocale.Key.currencySymbol)
70
+
71
+ if name != nil {
72
+ let model = Country()
73
+ model.name = name
74
+ model.countryCode = countryCode as? String
75
+ model.currencyCode = currencyCode as? String
76
+ model.currencySymbol = currencySymbol as? String
77
+ model.flag = String.flag(for: code)
78
+ model.extensionCode = NSLocale().extensionCode(countryCode: model.countryCode)
79
+ list.append(model)
80
+ }
81
+ }
82
+ self.searchList = self.list
83
+ self.tblViewCountry.reloadData()
84
+ }
85
+
86
+ }
87
+
88
+ extension String {
89
+
90
+ static func flag(for code: String) -> String? {
91
+ func isLowercaseASCIIScalar(_ scalar: Unicode.Scalar) -> Bool {
92
+ return scalar.value >= 0x61 && scalar.value <= 0x7A
93
+ }
94
+
95
+ func regionalIndicatorSymbol(for scalar: Unicode.Scalar) -> Unicode.Scalar {
96
+ precondition(isLowercaseASCIIScalar(scalar))
97
+ return Unicode.Scalar(scalar.value + (0x1F1E6 - 0x61))!
98
+ }
99
+
100
+ let lowercaseCode = code.lowercased()
101
+ guard lowercaseCode.count == 2 else { return nil }
102
+ guard lowercaseCode.unicodeScalars.reduce(true, { accum, scalar in accum && isLowercaseASCIIScalar(scalar)}) else { return nil }
103
+ let indicatorSymbol = lowercaseCode.unicodeScalars.map({regionalIndicatorSymbol(for: $0)})
104
+ return String(indicatorSymbol.map({ Character($0)}))
105
+ }
106
+ }
107
+
108
+ extension NSLocale {
109
+ func extensionCode(countryCode: String?) -> String? {
110
+ let prefixCodes = [
111
+ "AF":"93",
112
+ "AL":"355",
113
+ "DZ":"213",
114
+ "AS":"1",
115
+ "AD":"376",
116
+ "AO":"244",
117
+ "AI":"1",
118
+ "AG":"1",
119
+ "AR":"54",
120
+ "AM":"374",
121
+ "AW":"297",
122
+ "AU":"61",
123
+ "AT":"43",
124
+ "AZ":"994",
125
+ "BS":"1",
126
+ "BH":"973",
127
+ "BD":"880",
128
+ "BB":"1",
129
+ "BY":"375",
130
+ "BE":"32",
131
+ "BZ":"501",
132
+ "BJ":"229",
133
+ "BM":"1",
134
+ "BT":"975",
135
+ "BA":"387",
136
+ "BW":"267",
137
+ "BR":"55",
138
+ "IO":"246",
139
+ "BG":"359",
140
+ "BF":"226",
141
+ "BI":"257",
142
+ "KH":"855",
143
+ "CM":"237",
144
+ "CA":"1",
145
+ "CV":"238",
146
+ "KY":"345",
147
+ "CF":"236",
148
+ "TD":"235",
149
+ "CL":"56",
150
+ "CN":"86",
151
+ "CX":"61",
152
+ "CO":"57",
153
+ "KM":"269",
154
+ "CG":"242",
155
+ "CK":"682",
156
+ "CR":"506",
157
+ "HR":"385",
158
+ "CU":"53",
159
+ "CY":"537",
160
+ "CZ":"420",
161
+ "DK":"45",
162
+ "DJ":"253",
163
+ "DM":"1",
164
+ "DO":"1",
165
+ "EC":"593",
166
+ "EG":"20",
167
+ "SV":"503",
168
+ "GQ":"240",
169
+ "ER":"291",
170
+ "EE":"372",
171
+ "ET":"251",
172
+ "FO":"298",
173
+ "FJ":"679",
174
+ "FI":"358",
175
+ "FR":"33",
176
+ "GF":"594",
177
+ "PF":"689",
178
+ "GA":"241",
179
+ "GM":"220",
180
+ "GE":"995",
181
+ "DE":"49",
182
+ "GH":"233",
183
+ "GI":"350",
184
+ "GR":"30",
185
+ "GL":"299",
186
+ "GD":"1",
187
+ "GP":"590",
188
+ "GU":"1",
189
+ "GT":"502",
190
+ "GN":"224",
191
+ "GW":"245",
192
+ "GY":"595",
193
+ "HT":"509",
194
+ "HN":"504",
195
+ "HU":"36",
196
+ "IS":"354",
197
+ "IN":"91",
198
+ "ID":"62",
199
+ "IQ":"964",
200
+ "IE":"353",
201
+ "IL":"972",
202
+ "IT":"39",
203
+ "JM":"1",
204
+ "JP":"81",
205
+ "JO":"962",
206
+ "KZ":"77",
207
+ "KE":"254",
208
+ "KI":"686",
209
+ "KW":"965",
210
+ "KG":"996",
211
+ "LV":"371",
212
+ "LB":"961",
213
+ "LS":"266",
214
+ "LR":"231",
215
+ "LI":"423",
216
+ "LT":"370",
217
+ "LU":"352",
218
+ "MG":"261",
219
+ "MW":"265",
220
+ "MY":"60",
221
+ "MV":"960",
222
+ "ML":"223",
223
+ "MT":"356",
224
+ "MH":"692",
225
+ "MQ":"596",
226
+ "MR":"222",
227
+ "MU":"230",
228
+ "YT":"262",
229
+ "MX":"52",
230
+ "MC":"377",
231
+ "MN":"976",
232
+ "ME":"382",
233
+ "MS":"1",
234
+ "MA":"212",
235
+ "MM":"95",
236
+ "NA":"264",
237
+ "NR":"674",
238
+ "NP":"977",
239
+ "NL":"31",
240
+ "AN":"599",
241
+ "NC":"687",
242
+ "NZ":"64",
243
+ "NI":"505",
244
+ "NE":"227",
245
+ "NG":"234",
246
+ "NU":"683",
247
+ "NF":"672",
248
+ "MP":"1",
249
+ "NO":"47",
250
+ "OM":"968",
251
+ "PK":"92",
252
+ "PW":"680",
253
+ "PA":"507",
254
+ "PG":"675",
255
+ "PY":"595",
256
+ "PE":"51",
257
+ "PH":"63",
258
+ "PL":"48",
259
+ "PT":"351",
260
+ "PR":"1",
261
+ "QA":"974",
262
+ "RO":"40",
263
+ "RW":"250",
264
+ "WS":"685",
265
+ "SM":"378",
266
+ "SA":"966",
267
+ "SN":"221",
268
+ "RS":"381",
269
+ "SC":"248",
270
+ "SL":"232",
271
+ "SG":"65",
272
+ "SK":"421",
273
+ "SI":"386",
274
+ "SB":"677",
275
+ "ZA":"27",
276
+ "GS":"500",
277
+ "ES":"34",
278
+ "LK":"94",
279
+ "SD":"249",
280
+ "SR":"597",
281
+ "SZ":"268",
282
+ "SE":"46",
283
+ "CH":"41",
284
+ "TJ":"992",
285
+ "TH":"66",
286
+ "TG":"228",
287
+ "TK":"690",
288
+ "TO":"676",
289
+ "TT":"1",
290
+ "TN":"216",
291
+ "TR":"90",
292
+ "TM":"993",
293
+ "TC":"1",
294
+ "TV":"688",
295
+ "UG":"256",
296
+ "UA":"380",
297
+ "AE":"971",
298
+ "GB":"44",
299
+ "US":"1",
300
+ "UY":"598",
301
+ "UZ":"998",
302
+ "VU":"678",
303
+ "WF":"681",
304
+ "YE":"967",
305
+ "ZM":"260",
306
+ "ZW":"263",
307
+ "BO":"591",
308
+ "BN":"673",
309
+ "CC":"61",
310
+ "CD":"243",
311
+ "CI":"225",
312
+ "FK":"500",
313
+ "GG":"44",
314
+ "VA":"379",
315
+ "HK":"852",
316
+ "IR":"98",
317
+ "IM":"44",
318
+ "JE":"44",
319
+ "KP":"850",
320
+ "KR":"82",
321
+ "LA":"856",
322
+ "LY":"218",
323
+ "MO":"853",
324
+ "MK":"389",
325
+ "FM":"691",
326
+ "MD":"373",
327
+ "MZ":"258",
328
+ "PS":"970",
329
+ "PN":"872",
330
+ "RE":"262",
331
+ "RU":"7",
332
+ "BL":"590",
333
+ "SH":"290",
334
+ "KN":"1",
335
+ "LC":"1",
336
+ "MF":"590",
337
+ "PM":"508",
338
+ "VC":"1",
339
+ "ST":"239",
340
+ "SO":"252",
341
+ "SJ":"47",
342
+ "SY":"963",
343
+ "TW":"886",
344
+ "TZ":"255",
345
+ "TL":"670",
346
+ "VE":"58",
347
+ "VN":"84",
348
+ "VG":"284",
349
+ "VI":"340"
350
+ ]
351
+
352
+ let countryDialingCode = prefixCodes[countryCode ?? "IN"] ?? nil
353
+ return countryDialingCode
354
+ }
355
+ }
356
+
357
+ extension CountryListVC: UITableViewDelegate, UITableViewDataSource {
358
+
359
+ func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
360
+ return self.searchList.count
361
+ }
362
+
363
+ func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
364
+ let cell = tableView.dequeueReusableCell(withIdentifier: "cell")
365
+ cell?.textLabel?.text = "\(self.searchList[indexPath.row].flag!) \(self.searchList[indexPath.row].name!)"
366
+
367
+ // Apply color from UserStoreSingleton
368
+ if let primaryFontColor = UserStoreSingleton.shared.primary_font_col,
369
+ let uiColor = UIColor(hex: primaryFontColor) {
370
+ cell?.textLabel?.textColor = uiColor
371
+ }
372
+
373
+ if let fontSizeString = UserStoreSingleton.shared.fontSize,
374
+ let fontSizeDouble = Double(fontSizeString) { // Convert String to Double
375
+ let fontSize = CGFloat(fontSizeDouble) // Convert Double to CGFloat
376
+ cell?.textLabel?.font = UIFont.systemFont(ofSize: fontSize)
377
+ }
378
+
379
+ return cell!
380
+ }
381
+
382
+ func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
383
+ let selectedCountry = self.searchList[indexPath.row]
384
+ delegate?.didSelectCountry(selectedCountry)
385
+ self.navigationController?.popViewController(animated: true)
386
+ }
387
+
388
+ }
389
+
390
+ extension CountryListVC: UISearchBarDelegate {
391
+
392
+ func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
393
+ self.searchList = self.list
394
+ self.tblViewCountry.reloadData()
395
+ }
396
+
397
+ func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {
398
+ self.searchList = searchText.isEmpty ? list: list.filter({ (model) -> Bool in
399
+ return model.name!.range(of: searchText, options: .caseInsensitive, range: nil, locale: nil) != nil
400
+ })
401
+ self.tblViewCountry.reloadData()
402
+ }
403
+ }
404
+