@jimrising/easymerchantsdk-react-native 1.4.2 → 1.4.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.
- package/README.md +1 -1
- 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/Pods/ViewControllers/AdditionalInfoVC.swift +49 -52
- package/ios/Pods/ViewControllers/BillingInfoVC/BillingInfoVC.swift +74 -45
- package/ios/Pods/ViewControllers/OTPVerificationVC.swift +109 -33
- package/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift +1036 -146
- package/ios/Pods/ViewControllers/ThreeDSecurePaymentDoneVC.swift +0 -248
- package/ios/easymerchantsdk.podspec +1 -1
- package/ios/easymerchantsdk.storyboard +291 -92
- package/package.json +1 -1
|
@@ -5,254 +5,6 @@
|
|
|
5
5
|
// Created by Mony's Mac on 20/05/25.
|
|
6
6
|
//
|
|
7
7
|
|
|
8
|
-
//import UIKit
|
|
9
|
-
//
|
|
10
|
-
//class ThreeDSecurePaymentDoneVC: UIViewController {
|
|
11
|
-
//
|
|
12
|
-
// @IBOutlet weak var imgViewPaymentDone: UIImageView!
|
|
13
|
-
// @IBOutlet weak var imgViewLoading: UIImageView!
|
|
14
|
-
// @IBOutlet weak var viewMain: UIView!
|
|
15
|
-
// @IBOutlet weak var lblCompleteAuthentication: UILabel!
|
|
16
|
-
// @IBOutlet weak var btnDone: UIButton!
|
|
17
|
-
// @IBOutlet weak var lblPaymentLink: UILabel!
|
|
18
|
-
// @IBOutlet weak var lblBillingInfoData: UILabel!
|
|
19
|
-
//
|
|
20
|
-
// var easyPayDelegate: EasyPayViewControllerDelegate?
|
|
21
|
-
// var redirectURL: String?
|
|
22
|
-
// var chargeData: [String: Any] = [:]
|
|
23
|
-
//
|
|
24
|
-
// // Add these two properties:
|
|
25
|
-
// var billingInfo: [String: Any]?
|
|
26
|
-
// var additionalInfo: [String: Any]?
|
|
27
|
-
//
|
|
28
|
-
// var threeDSecureStatusResponse: [String: Any]?
|
|
29
|
-
//
|
|
30
|
-
// var statusCheckTimer: Timer?
|
|
31
|
-
//
|
|
32
|
-
// var additionalInfoData: [FieldItem]?
|
|
33
|
-
// var billingInfoData: [FieldItem]?
|
|
34
|
-
// var visibility: FieldsVisibility?
|
|
35
|
-
//
|
|
36
|
-
// override func viewDidLoad() {
|
|
37
|
-
// super.viewDidLoad()
|
|
38
|
-
// uiFinishingTouchElements()
|
|
39
|
-
//
|
|
40
|
-
// setupTapOnLabel()
|
|
41
|
-
//
|
|
42
|
-
// // showBillingInfo()
|
|
43
|
-
//
|
|
44
|
-
// checkThreeDSecureStatus()
|
|
45
|
-
// startStatusCheckTimer()
|
|
46
|
-
// }
|
|
47
|
-
//
|
|
48
|
-
// override func viewWillAppear(_ animated: Bool) {
|
|
49
|
-
// uiFinishingTouchElements()
|
|
50
|
-
// startStatusCheckTimer()
|
|
51
|
-
// }
|
|
52
|
-
//
|
|
53
|
-
// override func viewWillDisappear(_ animated: Bool) {
|
|
54
|
-
// super.viewWillDisappear(animated)
|
|
55
|
-
// statusCheckTimer?.invalidate()
|
|
56
|
-
// statusCheckTimer = nil
|
|
57
|
-
// }
|
|
58
|
-
//
|
|
59
|
-
// func startRotatingImage() {
|
|
60
|
-
// let rotationAnimation = CABasicAnimation(keyPath: "transform.rotation")
|
|
61
|
-
// rotationAnimation.toValue = CGFloat.pi * 2 // 360 degrees in radians
|
|
62
|
-
// rotationAnimation.duration = 1 // Adjust the duration as needed
|
|
63
|
-
// rotationAnimation.isCumulative = true
|
|
64
|
-
// rotationAnimation.repeatCount = .infinity // Continuous rotation
|
|
65
|
-
// imgViewLoading.layer.add(rotationAnimation, forKey: "rotationAnimation")
|
|
66
|
-
// }
|
|
67
|
-
//
|
|
68
|
-
// private func setupTapOnLabel() {
|
|
69
|
-
// if let url = redirectURL {
|
|
70
|
-
// lblPaymentLink.text = url
|
|
71
|
-
// }
|
|
72
|
-
// lblPaymentLink.textColor = .systemBlue
|
|
73
|
-
// lblPaymentLink.isUserInteractionEnabled = true
|
|
74
|
-
//
|
|
75
|
-
// let tapGesture = UITapGestureRecognizer(target: self, action: #selector(linkTapped))
|
|
76
|
-
// lblPaymentLink.addGestureRecognizer(tapGesture)
|
|
77
|
-
// }
|
|
78
|
-
//
|
|
79
|
-
// @objc private func linkTapped() {
|
|
80
|
-
// guard let text = lblPaymentLink.text,
|
|
81
|
-
// let url = URL(string: text),
|
|
82
|
-
// UIApplication.shared.canOpenURL(url) else {
|
|
83
|
-
// return
|
|
84
|
-
// }
|
|
85
|
-
// UIApplication.shared.open(url, options: [:], completionHandler: nil)
|
|
86
|
-
// }
|
|
87
|
-
//
|
|
88
|
-
//// func showBillingInfo() {
|
|
89
|
-
//// var displayText = ""
|
|
90
|
-
////
|
|
91
|
-
//// if let visibility = visibility {
|
|
92
|
-
//// if visibility.billing, let billing = billingInfo {
|
|
93
|
-
//// displayText += "Billing Info:-\n"
|
|
94
|
-
//// for (key, value) in billing {
|
|
95
|
-
//// displayText += "\(key.capitalized): \(value)\n"
|
|
96
|
-
//// }
|
|
97
|
-
//// }
|
|
98
|
-
////
|
|
99
|
-
//// if visibility.additional, let additional = additionalInfo {
|
|
100
|
-
//// if !displayText.isEmpty {
|
|
101
|
-
//// displayText += "\n"
|
|
102
|
-
//// }
|
|
103
|
-
//// displayText += "Additional Info:-\n"
|
|
104
|
-
//// for (key, value) in additional {
|
|
105
|
-
//// displayText += "\(key.capitalized): \(value)\n"
|
|
106
|
-
//// }
|
|
107
|
-
//// }
|
|
108
|
-
//// }
|
|
109
|
-
////
|
|
110
|
-
//// if displayText.isEmpty {
|
|
111
|
-
//// lblBillingInfoData.isHidden = true
|
|
112
|
-
//// } else {
|
|
113
|
-
//// lblBillingInfoData.text = displayText.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
114
|
-
//// lblBillingInfoData.isHidden = false
|
|
115
|
-
//// }
|
|
116
|
-
//// }
|
|
117
|
-
//
|
|
118
|
-
// private func startStatusCheckTimer() {
|
|
119
|
-
// statusCheckTimer?.invalidate() // Invalidate any existing timer
|
|
120
|
-
// statusCheckTimer = Timer.scheduledTimer(withTimeInterval: 10.0, repeats: true) { [weak self] _ in
|
|
121
|
-
// self?.checkThreeDSecureStatus()
|
|
122
|
-
// }
|
|
123
|
-
// }
|
|
124
|
-
//
|
|
125
|
-
// @IBAction func actionBtnDone(_ sender: UIButton) {
|
|
126
|
-
// // ✅ Combine 3DS status into additionalInfo
|
|
127
|
-
// var combinedAdditionalInfo = additionalInfo ?? [:]
|
|
128
|
-
// if let threeDS = threeDSecureStatusResponse {
|
|
129
|
-
// combinedAdditionalInfo["threeDSecureStatus"] = threeDS
|
|
130
|
-
// }
|
|
131
|
-
//
|
|
132
|
-
// let result = Result(type: .success,
|
|
133
|
-
// chargeData: chargeData,
|
|
134
|
-
// billingInfo: billingInfo,
|
|
135
|
-
// additionalInfo: combinedAdditionalInfo)
|
|
136
|
-
//
|
|
137
|
-
// easyPayDelegate?.easyPayController(self.navigationController as! EasyPayViewController, didFinishWith: result)
|
|
138
|
-
//
|
|
139
|
-
// if let easyPayVC = self.navigationController as? EasyPayViewController {
|
|
140
|
-
// easyPayVC.dismiss(animated: true, completion: {
|
|
141
|
-
// if let delegate = easyPayVC.easyPayDelegate {
|
|
142
|
-
// UserStoreSingleton.shared.isLoggedIn = false
|
|
143
|
-
// delegate.easyPayController(easyPayVC, didFinishWith: result)
|
|
144
|
-
// }
|
|
145
|
-
// })
|
|
146
|
-
// }
|
|
147
|
-
// }
|
|
148
|
-
//
|
|
149
|
-
// func uiFinishingTouchElements() {
|
|
150
|
-
// // Set background color for the main view
|
|
151
|
-
// if let containerBGcolor = UserStoreSingleton.shared.container_bg_col,
|
|
152
|
-
// let uiColor = UIColor(hex: containerBGcolor) {
|
|
153
|
-
// self.view.backgroundColor = uiColor
|
|
154
|
-
// self.viewMain.backgroundColor = uiColor
|
|
155
|
-
// }
|
|
156
|
-
//
|
|
157
|
-
// if let primaryBtnBackGroundColor = UserStoreSingleton.shared.primary_btn_bg_col,
|
|
158
|
-
// let uiColor = UIColor(hex: primaryBtnBackGroundColor) {
|
|
159
|
-
// btnDone.backgroundColor = uiColor
|
|
160
|
-
// }
|
|
161
|
-
//
|
|
162
|
-
// if let primaryBtnFontColor = UserStoreSingleton.shared.primary_btn_font_col,
|
|
163
|
-
// let secondaryUIColor = UIColor(hex: primaryBtnFontColor) {
|
|
164
|
-
// btnDone.setTitleColor(secondaryUIColor, for: .normal)
|
|
165
|
-
// }
|
|
166
|
-
//
|
|
167
|
-
// if let borderRadiusString = UserStoreSingleton.shared.border_radious,
|
|
168
|
-
// let borderRadius = Double(borderRadiusString) { // Convert String to Double
|
|
169
|
-
// btnDone.layer.cornerRadius = CGFloat(borderRadius) // Set corner radius
|
|
170
|
-
// } else {
|
|
171
|
-
// btnDone.layer.cornerRadius = 8 // Default value
|
|
172
|
-
// }
|
|
173
|
-
// btnDone.layer.masksToBounds = true // Ensure the corners are clipped properly
|
|
174
|
-
//
|
|
175
|
-
// if let primaryFontColor = UserStoreSingleton.shared.primary_font_col,
|
|
176
|
-
// let uiColor = UIColor(hex: primaryFontColor) {
|
|
177
|
-
// lblCompleteAuthentication.textColor = uiColor
|
|
178
|
-
// lblBillingInfoData.textColor = uiColor
|
|
179
|
-
// }
|
|
180
|
-
//
|
|
181
|
-
// if let fontSizeString = UserStoreSingleton.shared.fontSize,
|
|
182
|
-
// let fontSizeDouble = Double(fontSizeString) { // Convert String to Double
|
|
183
|
-
// let fontSize = CGFloat(fontSizeDouble) // Convert Double to CGFloat
|
|
184
|
-
// lblCompleteAuthentication.font = UIFont.systemFont(ofSize: fontSize, weight: .semibold)
|
|
185
|
-
// lblPaymentLink.font = UIFont.systemFont(ofSize: fontSize, weight: .medium)
|
|
186
|
-
// lblBillingInfoData.font = UIFont.systemFont(ofSize: fontSize, weight: .medium)
|
|
187
|
-
// }
|
|
188
|
-
//
|
|
189
|
-
// }
|
|
190
|
-
//
|
|
191
|
-
// // MARK: - GET Transaction Status API
|
|
192
|
-
// private func checkThreeDSecureStatus() {
|
|
193
|
-
// guard let secureToken = chargeData["secure_token"] as? String else {
|
|
194
|
-
// print("Secure token not found in chargeData")
|
|
195
|
-
// return
|
|
196
|
-
// }
|
|
197
|
-
//
|
|
198
|
-
// let urlString = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.threeDSecureStatus(secureToken).path()
|
|
199
|
-
// print("Final 3DS status URL: \(urlString)")
|
|
200
|
-
//
|
|
201
|
-
// guard let url = URL(string: urlString) else {
|
|
202
|
-
// print("Invalid URL")
|
|
203
|
-
// return
|
|
204
|
-
// }
|
|
205
|
-
//
|
|
206
|
-
// var uRLRequest = URLRequest(url: url)
|
|
207
|
-
// uRLRequest.httpMethod = "GET"
|
|
208
|
-
// uRLRequest.addValue("application/json", forHTTPHeaderField: "Content-Type")
|
|
209
|
-
//
|
|
210
|
-
// let token = UserStoreSingleton.shared.customerToken
|
|
211
|
-
// print("Setting customerToken header: \(token ?? "None")")
|
|
212
|
-
// uRLRequest.addValue(token ?? "", forHTTPHeaderField: "Customer-Token")
|
|
213
|
-
//
|
|
214
|
-
// // Add API key/secret headers
|
|
215
|
-
// if let apiKey = EnvironmentConfig.apiKey,
|
|
216
|
-
// let apiSecret = EnvironmentConfig.apiSecret {
|
|
217
|
-
// uRLRequest.addValue(apiKey, forHTTPHeaderField: "x-api-key")
|
|
218
|
-
// uRLRequest.addValue(apiSecret, forHTTPHeaderField: "x-api-secret")
|
|
219
|
-
// }
|
|
220
|
-
//
|
|
221
|
-
// let task = URLSession.shared.dataTask(with: uRLRequest) { [weak self] data, response, error in
|
|
222
|
-
// guard let self = self else { return }
|
|
223
|
-
//
|
|
224
|
-
// if let error = error {
|
|
225
|
-
// print("3DS status check error:", error.localizedDescription)
|
|
226
|
-
// return
|
|
227
|
-
// }
|
|
228
|
-
//
|
|
229
|
-
// guard let data = data else {
|
|
230
|
-
// print("No data in response")
|
|
231
|
-
// return
|
|
232
|
-
// }
|
|
233
|
-
//
|
|
234
|
-
// do {
|
|
235
|
-
// if let json = try JSONSerialization.jsonObject(with: data) as? [String: Any] {
|
|
236
|
-
// print("3DS status response:", json)
|
|
237
|
-
// self.threeDSecureStatusResponse = json
|
|
238
|
-
// }
|
|
239
|
-
// } catch {
|
|
240
|
-
// print("Error parsing JSON:", error.localizedDescription)
|
|
241
|
-
// }
|
|
242
|
-
// }
|
|
243
|
-
//
|
|
244
|
-
// task.resume()
|
|
245
|
-
// }
|
|
246
|
-
//
|
|
247
|
-
//}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
8
|
import UIKit
|
|
257
9
|
|
|
258
10
|
class ThreeDSecurePaymentDoneVC: BaseVC {
|