@jimrising/easymerchantsdk-react-native 1.7.9 → 1.8.1
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
CHANGED
|
@@ -11,30 +11,30 @@ class BaseVC: UIViewController {
|
|
|
11
11
|
|
|
12
12
|
private let activityIndicator: UIActivityIndicatorView? = nil
|
|
13
13
|
private var overlayView: UIView?
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
override func viewDidLoad() {
|
|
16
16
|
super.viewDidLoad()
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
19
|
+
func addOverlayView() {
|
|
20
|
+
guard let keyWindowScene = UIApplication.shared.connectedScenes.first(where: { $0.activationState == .foregroundActive }) as? UIWindowScene,
|
|
21
|
+
let keyWindow = keyWindowScene.windows.first(where: { $0.isKeyWindow }) else {
|
|
22
|
+
return
|
|
23
|
+
}
|
|
24
|
+
DispatchQueue.main.async {
|
|
25
|
+
let overlayView = UIView(frame: keyWindow.bounds)
|
|
26
|
+
overlayView.backgroundColor = UIColor.black.withAlphaComponent(0.3)
|
|
27
|
+
keyWindow.addSubview(overlayView)
|
|
28
|
+
self.overlayView = overlayView
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
func removeOverlayView() {
|
|
33
|
+
DispatchQueue.main.async {
|
|
34
|
+
self.overlayView?.removeFromSuperview()
|
|
35
|
+
self.overlayView = nil
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
38
|
|
|
39
39
|
func showLoadingIndicator() {
|
|
40
40
|
DispatchQueue.main.async {
|
|
@@ -42,7 +42,7 @@ class BaseVC: UIViewController {
|
|
|
42
42
|
activityIndicator.center = self.view.center
|
|
43
43
|
activityIndicator.hidesWhenStopped = true
|
|
44
44
|
activityIndicator.startAnimating()
|
|
45
|
-
|
|
45
|
+
self.addOverlayView()
|
|
46
46
|
self.view.addSubview(activityIndicator)
|
|
47
47
|
}
|
|
48
48
|
}
|
|
@@ -53,7 +53,7 @@ class BaseVC: UIViewController {
|
|
|
53
53
|
for subview in self.view.subviews {
|
|
54
54
|
if let activityIndicator = subview as? UIActivityIndicatorView {
|
|
55
55
|
activityIndicator.stopAnimating()
|
|
56
|
-
|
|
56
|
+
self.removeOverlayView()
|
|
57
57
|
activityIndicator.removeFromSuperview()
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -1845,18 +1845,34 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
|
|
|
1845
1845
|
self.dismiss(animated: true)
|
|
1846
1846
|
}
|
|
1847
1847
|
|
|
1848
|
+
private func updateShowSavedCardsVisibility() {
|
|
1849
|
+
let shouldShow = emailView.isHidden && OTPView.isHidden
|
|
1850
|
+
viewBtnShowSavedCards.isHidden = !shouldShow
|
|
1851
|
+
viewBtnShowSavedCardHeight.constant = shouldShow ? 50 : 0
|
|
1852
|
+
viewBtnShowSavedCardTopCon.constant = shouldShow ? 16 : 0
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1848
1855
|
@IBAction func actionBtnShowSavedCards(_ sender: UIButton) {
|
|
1849
1856
|
emailView.isHidden = false
|
|
1850
1857
|
OTPView.isHidden = true
|
|
1858
|
+
updateShowSavedCardsVisibility()
|
|
1851
1859
|
}
|
|
1852
1860
|
|
|
1853
1861
|
@IBAction func actionBtnCloseEmailView(_ sender: UIButton) {
|
|
1854
1862
|
emailView.isHidden = true
|
|
1863
|
+
updateShowSavedCardsVisibility()
|
|
1855
1864
|
}
|
|
1856
1865
|
|
|
1857
1866
|
@IBAction func actionBtnCloseOTPView(_ sender: UIButton) {
|
|
1858
1867
|
stopTimer()
|
|
1859
1868
|
OTPView.isHidden = true
|
|
1869
|
+
txtFieldOTPText1.text = ""
|
|
1870
|
+
txtFieldOTPText2.text = ""
|
|
1871
|
+
txtFieldOTPText3.text = ""
|
|
1872
|
+
txtFieldOTPText4.text = ""
|
|
1873
|
+
txtFieldOTPText5.text = ""
|
|
1874
|
+
txtFieldOTPText6.text = ""
|
|
1875
|
+
updateShowSavedCardsVisibility()
|
|
1860
1876
|
}
|
|
1861
1877
|
|
|
1862
1878
|
@IBAction func actionBtnResendOTP(_ sender: UIButton) {
|
|
@@ -3732,27 +3748,36 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
|
|
|
3732
3748
|
}
|
|
3733
3749
|
task.resume()
|
|
3734
3750
|
}
|
|
3735
|
-
|
|
3751
|
+
|
|
3736
3752
|
@IBAction func actionBtnNextEmailView(_ sender: UIButton) {
|
|
3737
3753
|
// Check if the email field is empty
|
|
3738
3754
|
guard let email = txtFieldEmail.text, !email.isEmpty else {
|
|
3739
|
-
// Show an alert if the email field is empty
|
|
3740
3755
|
showAlert(message: "Please enter an email address.")
|
|
3741
3756
|
return
|
|
3742
3757
|
}
|
|
3743
3758
|
|
|
3744
3759
|
// Validate email format before calling the API
|
|
3745
3760
|
if isValidEmail(email) {
|
|
3746
|
-
// Hide email view, show OTP view
|
|
3761
|
+
// Hide email view, show OTP view
|
|
3747
3762
|
emailView.isHidden = true
|
|
3748
3763
|
OTPView.isHidden = false
|
|
3764
|
+
|
|
3765
|
+
// Reset UI elements related to the timer
|
|
3766
|
+
btnResendOTP.isHidden = true
|
|
3767
|
+
lblOtpTimer.isHidden = false
|
|
3768
|
+
lblUntillResendOtp.isHidden = false
|
|
3769
|
+
imgEsclamationMark.isHidden = false
|
|
3770
|
+
|
|
3771
|
+
// Stop existing timer if any, then restart
|
|
3772
|
+
stopTimer()
|
|
3749
3773
|
startTimer()
|
|
3774
|
+
|
|
3750
3775
|
// Call the email verification API
|
|
3751
3776
|
emailVerificationApi()
|
|
3752
3777
|
} else {
|
|
3753
|
-
// Show an alert or error message if the email is not valid
|
|
3754
3778
|
showAlert(message: "Please enter a valid email address.")
|
|
3755
3779
|
}
|
|
3780
|
+
updateShowSavedCardsVisibility()
|
|
3756
3781
|
}
|
|
3757
3782
|
|
|
3758
3783
|
// MARK: - Action Button Next
|
|
@@ -5117,7 +5142,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
|
|
|
5117
5142
|
print("Saved Verification Email: \(UserStoreSingleton.shared.verificationEmail ?? "nil")")
|
|
5118
5143
|
|
|
5119
5144
|
// self.btnSettings.isHidden = false
|
|
5120
|
-
|
|
5145
|
+
|
|
5121
5146
|
if self.selectedPaymentMethod == "Card" {
|
|
5122
5147
|
if customerId.isEmpty {
|
|
5123
5148
|
self.OTPView.isHidden = true
|
|
@@ -7239,21 +7264,36 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
|
|
|
7239
7264
|
|
|
7240
7265
|
if self.bankAccounts.isEmpty {
|
|
7241
7266
|
self.showToast(message: "No saved bank accounts is available.")
|
|
7242
|
-
|
|
7243
7267
|
self.viewSingleSavedAccount.isHidden = true
|
|
7244
|
-
self.
|
|
7268
|
+
self.viewSingleSavedCard.isHidden = true
|
|
7269
|
+
self.OTPView.isHidden = true
|
|
7270
|
+
self.viewBtnShowSavedCards.isHidden = true
|
|
7271
|
+
self.viewBtnShowSavedCardHeight.constant = 0
|
|
7272
|
+
self.viewBtnShowSavedCardTopCon.constant = 8
|
|
7273
|
+
|
|
7274
|
+
if self.request.authenticatedACH == true {
|
|
7275
|
+
self.viewBankFields.isHidden = true
|
|
7276
|
+
self.btnNext.isHidden = true
|
|
7277
|
+
self.btnNextHeight.constant = 0
|
|
7278
|
+
self.btnNextTopCon.constant = 0
|
|
7279
|
+
}
|
|
7280
|
+
else {
|
|
7281
|
+
self.viewBankFields.isHidden = false
|
|
7282
|
+
self.btnNext.isHidden = false
|
|
7283
|
+
self.btnNextHeight.constant = 50
|
|
7284
|
+
self.btnNextTopCon.constant = 20
|
|
7285
|
+
}
|
|
7286
|
+
|
|
7287
|
+
//// self.viewBankFields.isHidden = false
|
|
7288
|
+
//// self.btnNext.isHidden = false
|
|
7289
|
+
//// self.btnNextHeight.constant = 50
|
|
7290
|
+
//// self.btnNextTopCon.constant = 20
|
|
7245
7291
|
|
|
7246
7292
|
// self.viewBtnShowSavedCards.isHidden = false
|
|
7247
7293
|
// self.viewBtnShowSavedCardHeight.constant = 50
|
|
7248
7294
|
// self.viewBtnShowSavedCardTopCon.constant = 20
|
|
7249
7295
|
// self.btnShowSavedCard.isHidden = false
|
|
7250
|
-
|
|
7251
|
-
self.btnNext.isHidden = false
|
|
7252
|
-
self.btnNextHeight.constant = 50
|
|
7253
|
-
self.btnNextTopCon.constant = 20
|
|
7254
|
-
|
|
7255
|
-
self.viewSingleSavedCard.isHidden = true
|
|
7256
|
-
|
|
7296
|
+
|
|
7257
7297
|
return
|
|
7258
7298
|
}
|
|
7259
7299
|
// else {
|
|
@@ -8958,7 +8998,6 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
|
|
|
8958
8998
|
|
|
8959
8999
|
// MARK: - 3DS Functionality
|
|
8960
9000
|
|
|
8961
|
-
// MARK: - Credit Card Charge Api If Billing info is nil and Without Login.
|
|
8962
9001
|
func threeDSecurePaymentApi() {
|
|
8963
9002
|
showLoadingIndicator()
|
|
8964
9003
|
|