@jimrising/easymerchantsdk-react-native 2.2.1 → 2.2.3

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 (28) hide show
  1. package/README.md +1 -1
  2. package/ios/Pods/UserDefaults/UserStoreSingleton.swift +304 -0
  3. package/ios/Pods/ViewControllers/AdditionalInfoVC.swift +2636 -0
  4. package/ios/Pods/ViewControllers/BaseVC.swift +141 -0
  5. package/ios/Pods/ViewControllers/BillingInfoVC/BillingInfoVC.swift +3347 -0
  6. package/ios/Pods/ViewControllers/BillingInfoVC/Cells/CityListTVC.swift +46 -0
  7. package/ios/Pods/ViewControllers/BillingInfoVC/Cells/CountryListTVC.swift +47 -0
  8. package/ios/Pods/ViewControllers/BillingInfoVC/Cells/StateListTVC.swift +46 -0
  9. package/ios/Pods/ViewControllers/CountryListVC.swift +435 -0
  10. package/ios/Pods/ViewControllers/CustomOverlay.swift +199 -0
  11. package/ios/Pods/ViewControllers/EmailVerificationVC.swift +307 -0
  12. package/ios/Pods/ViewControllers/GrailPayVC.swift +244 -0
  13. package/ios/Pods/ViewControllers/OTPVerificationVC.swift +2066 -0
  14. package/ios/Pods/ViewControllers/PaymentDoneVC.swift +272 -0
  15. package/ios/Pods/ViewControllers/PaymentErrorVC.swift +85 -0
  16. package/ios/Pods/ViewControllers/PaymentInformation/AccountTypeTVC.swift +41 -0
  17. package/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift +11025 -0
  18. package/ios/Pods/ViewControllers/PaymentInformation/PaymentInformationCVC.swift +35 -0
  19. package/ios/Pods/ViewControllers/PaymentInformation/RecurringTVC.swift +40 -0
  20. package/ios/Pods/ViewControllers/PaymentInformation/SavedAccountsTVC/SavedAccountTVC.swift +81 -0
  21. package/ios/Pods/ViewControllers/PaymentInformation/SavedAccountsTVC/SavedAccountTVC.xib +163 -0
  22. package/ios/Pods/ViewControllers/PaymentInformation/SavedCardsTVC/SavedCardsTVC.swift +81 -0
  23. package/ios/Pods/ViewControllers/PaymentInformation/SavedCardsTVC/SavedCardsTVC.xib +188 -0
  24. package/ios/Pods/ViewControllers/PaymentStatusWebViewVC.swift +167 -0
  25. package/ios/Pods/ViewControllers/TermAndConditionsVC.swift +63 -0
  26. package/ios/Pods/ViewControllers/ThreeDSecurePaymentDoneVC.swift +629 -0
  27. package/ios/easymerchantsdk.podspec +1 -1
  28. package/package.json +1 -1
package/README.md CHANGED
@@ -19,7 +19,7 @@ Add the EasyMerchant SDK to your `package.json` under `dependencies`:
19
19
 
20
20
  ```json
21
21
  "dependencies": {
22
- "@jimrising/easymerchantsdk-react-native": "^2.2.1"
22
+ "@jimrising/easymerchantsdk-react-native": "^2.2.3"
23
23
  }
24
24
  ```
25
25
 
@@ -0,0 +1,304 @@
1
+ //
2
+ // UserStoreSingleton.swift
3
+ // EasyPay
4
+ //
5
+ // Created by Mony's Mac on 13/08/24.
6
+ //
7
+
8
+ import Foundation
9
+ import UIKit
10
+
11
+ class UserStoreSingleton: NSObject {
12
+
13
+ static let shared = UserStoreSingleton()
14
+
15
+ private override init() {
16
+ super.init()
17
+ NotificationCenter.default.addObserver(self, selector: #selector(handleAppTermination), name: UIApplication.willTerminateNotification, object: nil)
18
+ }
19
+
20
+ var clientToken : String? {
21
+ get {
22
+ return (UserDefaults().object(forKey: "client_token") as? String)
23
+ } set {
24
+ UserDefaults.standard.setValue(newValue, forKey: "client_token")
25
+ }
26
+ }
27
+
28
+ var paymentIntent : String? {
29
+ get {
30
+ return (UserDefaults().object(forKey: "payment_intent") as? String)
31
+ } set {
32
+ UserDefaults.standard.setValue(newValue, forKey: "payment_intent")
33
+ }
34
+ }
35
+
36
+ var merchantEmail : String? {
37
+ get {
38
+ return (UserDefaults().object(forKey: "merchant_email") as? String)
39
+ } set {
40
+ UserDefaults.standard.setValue(newValue, forKey: "merchant_email")
41
+ }
42
+ }
43
+
44
+ var merchantName : String? {
45
+ get {
46
+ return (UserDefaults().object(forKey: "merchant_name") as? String)
47
+ } set {
48
+ UserDefaults.standard.setValue(newValue, forKey: "merchant_name")
49
+ }
50
+ }
51
+
52
+ var paymentAccount : String? {
53
+ get {
54
+ return (UserDefaults().object(forKey: "payment_account") as? String)
55
+ } set {
56
+ UserDefaults.standard.setValue(newValue, forKey: "payment_account")
57
+ }
58
+ }
59
+
60
+ var price : String? {
61
+ get {
62
+ return (UserDefaults().object(forKey: "price") as? String)
63
+ } set {
64
+ UserDefaults.standard.setValue(newValue, forKey: "price")
65
+ }
66
+ }
67
+
68
+ var isLoggedIn : Bool? {
69
+ get {
70
+ return (UserDefaults().object(forKey: "isLoggedIn") as? Bool)
71
+ } set {
72
+ UserDefaults.standard.setValue(newValue, forKey: "isLoggedIn")
73
+ }
74
+ }
75
+
76
+ var customerId: String? {
77
+ get {
78
+ return UserDefaults.standard.string(forKey: "customer_id")
79
+ }
80
+ set {
81
+ UserDefaults.standard.set(newValue, forKey: "customer_id")
82
+ }
83
+ }
84
+
85
+ var customerToken: String? {
86
+ get {
87
+ return UserDefaults.standard.string(forKey: "customer_token")
88
+ }
89
+ set {
90
+ UserDefaults.standard.set(newValue, forKey: "customer_token")
91
+ }
92
+ }
93
+
94
+ var verificationEmail: String? {
95
+ get {
96
+ return UserDefaults.standard.string(forKey: "verificationEmail")
97
+ }
98
+ set {
99
+ UserDefaults.standard.set(newValue, forKey: "verificationEmail")
100
+ }
101
+ }
102
+
103
+ //Payment Methods
104
+ var paymentMethods: [String]? {
105
+ get {
106
+ return UserDefaults.standard.stringArray(forKey: "payment_methods")
107
+ }
108
+ set {
109
+ UserDefaults.standard.setValue(newValue, forKey: "payment_methods")
110
+ }
111
+ }
112
+
113
+ var companyName: String? {
114
+ get {
115
+ return UserDefaults.standard.string(forKey: "companyName")
116
+ }
117
+ set {
118
+ UserDefaults.standard.set(newValue, forKey: "companyName")
119
+ }
120
+ }
121
+
122
+ var bankWidgetKey: String? {
123
+ get {
124
+ return UserDefaults.standard.string(forKey: "bank_widget_key")
125
+ }
126
+ set {
127
+ UserDefaults.standard.set(newValue, forKey: "bank_widget_key")
128
+ }
129
+ }
130
+
131
+ var vendorID: String? {
132
+ get {
133
+ return UserDefaults.standard.string(forKey: "vendor_id")
134
+ }
135
+ set {
136
+ UserDefaults.standard.set(newValue, forKey: "vendor_id")
137
+ }
138
+ }
139
+
140
+ //apperance_settings
141
+ var body_bg_col : String? {
142
+ get {
143
+ return (UserDefaults().object(forKey: "body_bg_col") as? String)
144
+ } set {
145
+ UserDefaults.standard.setValue(newValue, forKey: "body_bg_col")
146
+ }
147
+ }
148
+
149
+ var border_radious : String? {
150
+ get {
151
+ return (UserDefaults().object(forKey: "border_radious") as? String)
152
+ } set {
153
+ UserDefaults.standard.setValue(newValue, forKey: "border_radious")
154
+ }
155
+ }
156
+
157
+ var container_bg_col : String? {
158
+ get {
159
+ return (UserDefaults().object(forKey: "container_bg_col") as? String)
160
+ } set {
161
+ UserDefaults.standard.setValue(newValue, forKey: "container_bg_col")
162
+ }
163
+ }
164
+
165
+ var primary_btn_bg_col : String? {
166
+ get {
167
+ return (UserDefaults().object(forKey: "primary_btn_bg_col") as? String)
168
+ } set {
169
+ UserDefaults.standard.setValue(newValue, forKey: "primary_btn_bg_col")
170
+ }
171
+ }
172
+
173
+ var primary_btn_font_col : String? {
174
+ get {
175
+ return (UserDefaults().object(forKey: "primary_btn_font_col") as? String)
176
+ } set {
177
+ UserDefaults.standard.setValue(newValue, forKey: "primary_btn_font_col")
178
+ }
179
+ }
180
+
181
+ var primary_btn_hover_col : String? {
182
+ get {
183
+ return (UserDefaults().object(forKey: "primary_btn_hover_col") as? String)
184
+ } set {
185
+ UserDefaults.standard.setValue(newValue, forKey: "primary_btn_hover_col")
186
+ }
187
+ }
188
+
189
+ var primary_font_col : String? {
190
+ get {
191
+ return (UserDefaults().object(forKey: "primary_font_col") as? String)
192
+ } set {
193
+ UserDefaults.standard.setValue(newValue, forKey: "primary_font_col")
194
+ }
195
+ }
196
+
197
+ var secondary_btn_bg_col : String? {
198
+ get {
199
+ return (UserDefaults().object(forKey: "secondary_btn_bg_col") as? String)
200
+ } set {
201
+ UserDefaults.standard.setValue(newValue, forKey: "secondary_btn_bg_col")
202
+ }
203
+ }
204
+
205
+ var secondary_btn_font_col : String? {
206
+ get {
207
+ return (UserDefaults().object(forKey: "secondary_btn_font_col") as? String)
208
+ } set {
209
+ UserDefaults.standard.setValue(newValue, forKey: "secondary_btn_font_col")
210
+ }
211
+ }
212
+
213
+ var secondary_btn_hover_col : String? {
214
+ get {
215
+ return (UserDefaults().object(forKey: "secondary_btn_hover_col") as? String)
216
+ } set {
217
+ UserDefaults.standard.setValue(newValue, forKey: "secondary_btn_hover_col")
218
+ }
219
+ }
220
+
221
+ var secondary_font_col : String? {
222
+ get {
223
+ return (UserDefaults().object(forKey: "secondary_font_col") as? String)
224
+ } set {
225
+ UserDefaults.standard.setValue(newValue, forKey: "secondary_font_col")
226
+ }
227
+ }
228
+
229
+ var fontSize : String? {
230
+ get {
231
+ return (UserDefaults().object(forKey: "fontSize") as? String)
232
+ } set {
233
+ UserDefaults.standard.setValue(newValue, forKey: "fontSize")
234
+ }
235
+ }
236
+
237
+ func updateThemeConfiguration(with themeConfiguration: ThemeConfiguration) {
238
+ self.body_bg_col = themeConfiguration.bodyBackgroundColor
239
+ self.container_bg_col = themeConfiguration.containerBackgroundColor
240
+ self.primary_font_col = themeConfiguration.primaryFontColor
241
+ self.secondary_font_col = themeConfiguration.secondaryFontColor
242
+ self.primary_btn_bg_col = themeConfiguration.primaryButtonBackgroundColor
243
+ self.primary_btn_hover_col = themeConfiguration.primaryButtonHoverColor
244
+ self.primary_btn_font_col = themeConfiguration.primaryButtonFontColor
245
+ self.secondary_btn_bg_col = themeConfiguration.secondaryButtonBackgroundColor
246
+ self.secondary_btn_hover_col = themeConfiguration.secondaryButtonHoverColor
247
+ self.secondary_btn_font_col = themeConfiguration.secondaryFontColor
248
+ self.border_radious = themeConfiguration.borderRadius
249
+ self.fontSize = themeConfiguration.fontSize
250
+ }
251
+
252
+ // Method to clear user data from UserDefaults
253
+ // func clearUserData() {
254
+ // UserDefaults.standard.removeObject(forKey: "customer_id")
255
+ // UserDefaults.standard.removeObject(forKey: "verificationEmail")
256
+ // UserDefaults.standard.removeObject(forKey: "customer_token")
257
+ // UserDefaults.standard.removeObject(forKey: "client_token")
258
+ // UserDefaults.standard.synchronize() // Optional, but can help ensure the changes are applied immediately
259
+ // }
260
+
261
+ func clearUserData() {
262
+ let keysToRemove = [
263
+ "client_token",
264
+ "payment_intent",
265
+ "merchant_email",
266
+ "merchant_name",
267
+ "payment_account",
268
+ "price",
269
+ "isLoggedIn",
270
+ "customer_id",
271
+ "customer_token",
272
+ "verificationEmail",
273
+ "payment_methods",
274
+ "bank_widget_key",
275
+ "vendor_id",
276
+ ]
277
+
278
+ for key in keysToRemove {
279
+ UserDefaults.standard.removeObject(forKey: key)
280
+ }
281
+
282
+ UserDefaults.standard.synchronize()
283
+ }
284
+
285
+ @objc private func handleAppTermination() {
286
+ print("App is terminating. Clearing user data...")
287
+ clearUserData()
288
+ }
289
+
290
+ deinit {
291
+ NotificationCenter.default.removeObserver(self)
292
+ }
293
+
294
+ }
295
+
296
+
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+