@jimrising/easymerchantsdk-react-native 2.5.1 → 2.5.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 (29) hide show
  1. package/.yarn/install-state.gz +0 -0
  2. package/ios/Pods/Storyboard/EasyPaySdk.storyboard +9089 -0
  3. package/ios/Pods/UserDefaults/UserStoreSingleton.swift +424 -0
  4. package/ios/Pods/ViewControllers/AdditionalInfoVC.swift +2894 -0
  5. package/ios/Pods/ViewControllers/BaseVC.swift +142 -0
  6. package/ios/Pods/ViewControllers/BillingInfoVC/BillingInfoVC.swift +3686 -0
  7. package/ios/Pods/ViewControllers/BillingInfoVC/Cells/CityListTVC.swift +46 -0
  8. package/ios/Pods/ViewControllers/BillingInfoVC/Cells/CountryListTVC.swift +47 -0
  9. package/ios/Pods/ViewControllers/BillingInfoVC/Cells/StateListTVC.swift +46 -0
  10. package/ios/Pods/ViewControllers/Clean Runner_2025-07-23T14-58-05.txt +13 -0
  11. package/ios/Pods/ViewControllers/CountryListVC.swift +435 -0
  12. package/ios/Pods/ViewControllers/EmailVerificationVC.swift +286 -0
  13. package/ios/Pods/ViewControllers/GrailPayVC.swift +483 -0
  14. package/ios/Pods/ViewControllers/OTPVerificationVC.swift +2193 -0
  15. package/ios/Pods/ViewControllers/PaymentDoneVC.swift +284 -0
  16. package/ios/Pods/ViewControllers/PaymentErrorVC.swift +85 -0
  17. package/ios/Pods/ViewControllers/PaymentInformation/AccountTypeTVC.swift +41 -0
  18. package/ios/Pods/ViewControllers/PaymentInformation/PaymentInfoVC.swift +12875 -0
  19. package/ios/Pods/ViewControllers/PaymentInformation/PaymentInformationCVC.swift +35 -0
  20. package/ios/Pods/ViewControllers/PaymentInformation/RecurringTVC.swift +40 -0
  21. package/ios/Pods/ViewControllers/PaymentInformation/SavedAccountsTVC/SavedAccountTVC.swift +80 -0
  22. package/ios/Pods/ViewControllers/PaymentInformation/SavedAccountsTVC/SavedAccountTVC.xib +163 -0
  23. package/ios/Pods/ViewControllers/PaymentInformation/SavedCardsTVC/SavedCardsTVC.swift +81 -0
  24. package/ios/Pods/ViewControllers/PaymentInformation/SavedCardsTVC/SavedCardsTVC.xib +188 -0
  25. package/ios/Pods/ViewControllers/PaymentStatusWebViewVC.swift +158 -0
  26. package/ios/Pods/ViewControllers/TermAndConditionsVC.swift +63 -0
  27. package/ios/Pods/ViewControllers/ThreeDSecurePaymentDoneVC.swift +1216 -0
  28. package/ios/easymerchantsdk.podspec +1 -1
  29. package/package.json +1 -1
@@ -0,0 +1,158 @@
1
+ //
2
+ // PaymentStatusWebViewVC.swift
3
+ // EasyPay
4
+ //
5
+ // Created by Mony's Mac on 17/07/25.
6
+ //
7
+
8
+ //import UIKit
9
+ //import WebKit
10
+ //
11
+ //class PaymentStatusWebViewVC: UIViewController {
12
+ //
13
+ // var urlString: String?
14
+ // private var webView: WKWebView!
15
+ //
16
+ // override func viewDidLoad() {
17
+ // super.viewDidLoad()
18
+ // setupWebView()
19
+ // loadRequestedURL()
20
+ // }
21
+ //
22
+ // private func setupWebView() {
23
+ // webView = WKWebView(frame: self.view.bounds)
24
+ // webView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
25
+ // self.view.addSubview(webView)
26
+ // }
27
+ //
28
+ // private func loadRequestedURL() {
29
+ // guard let urlString = urlString, let url = URL(string: urlString) else {
30
+ // return
31
+ // }
32
+ // let request = URLRequest(url: url)
33
+ // webView.load(request)
34
+ // }
35
+ //
36
+ //}
37
+
38
+
39
+ import UIKit
40
+ import WebKit
41
+
42
+ class PaymentStatusWebViewVC: UIViewController, WKNavigationDelegate {
43
+
44
+ var urlString: String?
45
+ private var webView: WKWebView!
46
+ private var closeButton: UIButton!
47
+ private var activityIndicator: UIActivityIndicatorView!
48
+ private var didShowCloseButton = false // 👈 Flag
49
+
50
+ override func viewDidLoad() {
51
+ super.viewDidLoad()
52
+ setupWebView()
53
+ setupCloseButton()
54
+ setupActivityIndicator()
55
+ loadRequestedURL()
56
+ }
57
+
58
+ private func setupWebView() {
59
+ webView = WKWebView(frame: self.view.bounds)
60
+ webView.navigationDelegate = self
61
+ webView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
62
+ self.view.addSubview(webView)
63
+ }
64
+
65
+ private func setupCloseButton() {
66
+ closeButton = UIButton(type: .system)
67
+ if let closeImage = UIImage(systemName: "xmark.circle.fill") {
68
+ closeButton.setImage(closeImage, for: .normal)
69
+ closeButton.tintColor = .systemGray
70
+ } else {
71
+ closeButton.setTitle("X", for: .normal)
72
+ closeButton.setTitleColor(.systemGray, for: .normal)
73
+ closeButton.titleLabel?.font = UIFont.systemFont(ofSize: 24, weight: .bold)
74
+ }
75
+ closeButton.frame = CGRect(x: self.view.bounds.width - 50, y: 50, width: 40, height: 40)
76
+ closeButton.autoresizingMask = [.flexibleLeftMargin, .flexibleBottomMargin]
77
+ closeButton.addTarget(self, action: #selector(closeButtonTapped), for: .touchUpInside)
78
+ closeButton.isHidden = true
79
+ self.view.addSubview(closeButton)
80
+ }
81
+
82
+ private func setupActivityIndicator() {
83
+ activityIndicator = UIActivityIndicatorView(style: .large)
84
+ activityIndicator.center = self.view.center
85
+ activityIndicator.hidesWhenStopped = true
86
+ self.view.addSubview(activityIndicator)
87
+ }
88
+
89
+ private func loadRequestedURL() {
90
+ guard let urlString = urlString, let url = URL(string: urlString) else {
91
+ return
92
+ }
93
+ let request = URLRequest(url: url)
94
+ webView.load(request)
95
+ }
96
+
97
+ @objc private func closeButtonTapped() {
98
+ self.navigationController?.popViewController(animated: true)
99
+ }
100
+
101
+ // MARK: - WKNavigationDelegate
102
+ func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
103
+ activityIndicator.startAnimating()
104
+ closeButton.isHidden = true
105
+ didShowCloseButton = false // 👈 Reset the flag
106
+ }
107
+
108
+ func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
109
+ if !didShowCloseButton {
110
+ waitForPageToBeReady()
111
+ } else {
112
+ }
113
+ }
114
+
115
+ func webView(_ webView: WKWebView, didFail navigation: WKNavigation!, withError error: Error) {
116
+ activityIndicator.stopAnimating()
117
+ closeButton.isHidden = false
118
+ }
119
+
120
+ func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
121
+ activityIndicator.stopAnimating()
122
+ closeButton.isHidden = false
123
+ }
124
+
125
+ private func waitForPageToBeReady() {
126
+ webView.evaluateJavaScript("document.readyState") { [weak self] result, error in
127
+ guard let self = self else { return }
128
+ if let state = result as? String {
129
+ if state == "complete" {
130
+ self.checkIfPaymentUILoaded()
131
+ } else {
132
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
133
+ self.waitForPageToBeReady()
134
+ }
135
+ }
136
+ }
137
+ }
138
+ }
139
+
140
+ private func checkIfPaymentUILoaded() {
141
+ guard !didShowCloseButton else { return }
142
+
143
+ // Replace '.loader' with your actual loader class or ID
144
+ let js = "document.querySelector('.loader') == null"
145
+ webView.evaluateJavaScript(js) { [weak self] result, error in
146
+ guard let self = self else { return }
147
+ if let loaded = result as? Bool, loaded == true {
148
+ self.activityIndicator.stopAnimating()
149
+ self.closeButton.isHidden = false
150
+ self.didShowCloseButton = true // 👈 Mark as shown
151
+ } else {
152
+ DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
153
+ self.checkIfPaymentUILoaded()
154
+ }
155
+ }
156
+ }
157
+ }
158
+ }
@@ -0,0 +1,63 @@
1
+ //
2
+ // TermAndConditionsVC.swift
3
+ // EasyPay
4
+ //
5
+ // Created by Mony's Mac on 02/09/24.
6
+ //
7
+
8
+ import UIKit
9
+
10
+ class TermAndConditionsVC: UIViewController {
11
+
12
+ @IBOutlet weak var lblTermAndConditions: UILabel!
13
+ @IBOutlet weak var lblSubHead1: UILabel!
14
+ @IBOutlet weak var lblInfo1: UILabel!
15
+ @IBOutlet weak var lblSubHead2: UILabel!
16
+ @IBOutlet weak var lblInfo2: UILabel!
17
+ @IBOutlet weak var lblSubHead3: UILabel!
18
+ @IBOutlet weak var lblInfo3: UILabel!
19
+ @IBOutlet weak var lblInfo4: UILabel!
20
+
21
+ override func viewDidLoad() {
22
+ super.viewDidLoad()
23
+
24
+ uiFinishingTouchElements()
25
+ }
26
+
27
+ func uiFinishingTouchElements() {
28
+ if let primaryFontColor = UserStoreSingleton.shared.primary_font_col,
29
+ let uiColor = UIColor(hex: primaryFontColor) {
30
+ lblTermAndConditions.textColor = uiColor
31
+ lblInfo1.textColor = uiColor
32
+ lblInfo2.textColor = uiColor
33
+ lblInfo3.textColor = uiColor
34
+ lblInfo4.textColor = uiColor
35
+ }
36
+
37
+ if let primaryFontColor = UserStoreSingleton.shared.secondary_font_col,
38
+ let uiColor = UIColor(hex: primaryFontColor) {
39
+ lblSubHead1.textColor = uiColor
40
+ lblSubHead2.textColor = uiColor
41
+ lblSubHead3.textColor = uiColor
42
+ }
43
+
44
+ if let containerBGcolor = UserStoreSingleton.shared.container_bg_col,
45
+ let uiColor = UIColor(hex: containerBGcolor) {
46
+ self.view.backgroundColor = uiColor
47
+ }
48
+
49
+ if let fontSizeString = UserStoreSingleton.shared.fontSize,
50
+ let fontSizeDouble = Double(fontSizeString) { // Convert String to Double
51
+ let fontSize = CGFloat(fontSizeDouble) // Convert Double to CGFloat
52
+ lblInfo1.font = UIFont.systemFont(ofSize: fontSize)
53
+ lblInfo2.font = UIFont.systemFont(ofSize: fontSize)
54
+ lblInfo3.font = UIFont.systemFont(ofSize: fontSize)
55
+ lblInfo4.font = UIFont.systemFont(ofSize: fontSize)
56
+ }
57
+ }
58
+
59
+ @IBAction func actionBtnClose(_ sender: UIButton) {
60
+ self.dismiss(animated: true)
61
+ }
62
+
63
+ }