@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,233 @@
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
+ //apperance_settings
114
+ var body_bg_col : String? {
115
+ get {
116
+ return (UserDefaults().object(forKey: "body_bg_col") as? String)
117
+ } set {
118
+ UserDefaults.standard.setValue(newValue, forKey: "body_bg_col")
119
+ }
120
+ }
121
+
122
+ var border_radious : String? {
123
+ get {
124
+ return (UserDefaults().object(forKey: "border_radious") as? String)
125
+ } set {
126
+ UserDefaults.standard.setValue(newValue, forKey: "border_radious")
127
+ }
128
+ }
129
+
130
+ var container_bg_col : String? {
131
+ get {
132
+ return (UserDefaults().object(forKey: "container_bg_col") as? String)
133
+ } set {
134
+ UserDefaults.standard.setValue(newValue, forKey: "container_bg_col")
135
+ }
136
+ }
137
+
138
+ var primary_btn_bg_col : String? {
139
+ get {
140
+ return (UserDefaults().object(forKey: "primary_btn_bg_col") as? String)
141
+ } set {
142
+ UserDefaults.standard.setValue(newValue, forKey: "primary_btn_bg_col")
143
+ }
144
+ }
145
+
146
+ var primary_btn_font_col : String? {
147
+ get {
148
+ return (UserDefaults().object(forKey: "primary_btn_font_col") as? String)
149
+ } set {
150
+ UserDefaults.standard.setValue(newValue, forKey: "primary_btn_font_col")
151
+ }
152
+ }
153
+
154
+ var primary_btn_hover_col : String? {
155
+ get {
156
+ return (UserDefaults().object(forKey: "primary_btn_hover_col") as? String)
157
+ } set {
158
+ UserDefaults.standard.setValue(newValue, forKey: "primary_btn_hover_col")
159
+ }
160
+ }
161
+
162
+ var primary_font_col : String? {
163
+ get {
164
+ return (UserDefaults().object(forKey: "primary_font_col") as? String)
165
+ } set {
166
+ UserDefaults.standard.setValue(newValue, forKey: "primary_font_col")
167
+ }
168
+ }
169
+
170
+ var secondary_btn_bg_col : String? {
171
+ get {
172
+ return (UserDefaults().object(forKey: "secondary_btn_bg_col") as? String)
173
+ } set {
174
+ UserDefaults.standard.setValue(newValue, forKey: "secondary_btn_bg_col")
175
+ }
176
+ }
177
+
178
+ var secondary_btn_font_col : String? {
179
+ get {
180
+ return (UserDefaults().object(forKey: "secondary_btn_font_col") as? String)
181
+ } set {
182
+ UserDefaults.standard.setValue(newValue, forKey: "secondary_btn_font_col")
183
+ }
184
+ }
185
+
186
+ var secondary_btn_hover_col : String? {
187
+ get {
188
+ return (UserDefaults().object(forKey: "secondary_btn_hover_col") as? String)
189
+ } set {
190
+ UserDefaults.standard.setValue(newValue, forKey: "secondary_btn_hover_col")
191
+ }
192
+ }
193
+
194
+ var secondary_font_col : String? {
195
+ get {
196
+ return (UserDefaults().object(forKey: "secondary_font_col") as? String)
197
+ } set {
198
+ UserDefaults.standard.setValue(newValue, forKey: "secondary_font_col")
199
+ }
200
+ }
201
+
202
+ var fontSize : String? {
203
+ get {
204
+ return (UserDefaults().object(forKey: "fontSize") as? String)
205
+ } set {
206
+ UserDefaults.standard.setValue(newValue, forKey: "fontSize")
207
+ }
208
+ }
209
+
210
+ func updateThemeConfiguration(with json: [String: Any]) {
211
+ json.forEach { key, value in
212
+ UserDefaults.standard.set(value, forKey: key)
213
+ }
214
+ }
215
+
216
+ // Method to clear user data from UserDefaults
217
+ func clearUserData() {
218
+ UserDefaults.standard.removeObject(forKey: "customer_id")
219
+ UserDefaults.standard.removeObject(forKey: "verificationEmail")
220
+ UserDefaults.standard.removeObject(forKey: "customer_token")
221
+ UserDefaults.standard.synchronize() // Optional, but can help ensure the changes are applied immediately
222
+ }
223
+
224
+ @objc private func handleAppTermination() {
225
+ print("App is terminating. Clearing user data...")
226
+ clearUserData()
227
+ }
228
+
229
+ deinit {
230
+ NotificationCenter.default.removeObserver(self)
231
+ }
232
+
233
+ }