@jimrising/easymerchantsdk-react-native 1.3.8 → 1.3.9

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.
@@ -369,7 +369,7 @@ class OTPVerificationVC: BaseVC {
369
369
  //MARK: - Send OTP Email Verification Api
370
370
  func emailVerificationApi() {
371
371
  showLoadingIndicator()
372
-
372
+
373
373
  let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.emailVerification.path()
374
374
 
375
375
  guard let serviceURL = URL(string: fullURL) else {
@@ -452,7 +452,7 @@ class OTPVerificationVC: BaseVC {
452
452
  //MARK: - Card Charge Api
453
453
  func paymentIntentApi(customerId: String?) {
454
454
  showLoadingIndicator()
455
-
455
+
456
456
  let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.charges.path()
457
457
 
458
458
  guard let serviceURL = URL(string: fullURL) else {
@@ -594,6 +594,9 @@ class OTPVerificationVC: BaseVC {
594
594
  paymentDoneVC.chargeData = responseObject
595
595
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
596
596
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
597
+ // Pass billing and additional info
598
+ paymentDoneVC.billingInfo = billingInfo
599
+ paymentDoneVC.additionalInfo = additionalInfo
597
600
  self.navigationController?.pushViewController(paymentDoneVC, animated: true)
598
601
  }
599
602
  }
@@ -780,7 +783,7 @@ class OTPVerificationVC: BaseVC {
780
783
  //MARK: - Account Charge Api
781
784
  func accountChargeApi(customerId: String?) {
782
785
  showLoadingIndicator()
783
-
786
+
784
787
  let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.achCharge.path()
785
788
 
786
789
  guard let serviceURL = URL(string: fullURL) else {
@@ -921,6 +924,9 @@ class OTPVerificationVC: BaseVC {
921
924
  paymentDoneVC.chargeData = responseObject
922
925
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
923
926
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
927
+ // Pass billing and additional info
928
+ paymentDoneVC.billingInfo = billingInfo
929
+ paymentDoneVC.additionalInfo = additionalInfo
924
930
  self.navigationController?.pushViewController(paymentDoneVC, animated: true)
925
931
  }
926
932
  }
@@ -950,7 +956,7 @@ class OTPVerificationVC: BaseVC {
950
956
  //MARK: - Account Charge Api if billing info is nil and saved account
951
957
  func accountChargeWithSavedAccountApi(customerId: String?) {
952
958
  showLoadingIndicator()
953
-
959
+
954
960
  let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.achCharge.path()
955
961
 
956
962
  guard let serviceURL = URL(string: fullURL) else {
@@ -1096,7 +1102,7 @@ class OTPVerificationVC: BaseVC {
1096
1102
  //MARK: - GrailPay Account Charge Api if user saved account
1097
1103
  func grailPayAccountChargeApi(customerId: String?) {
1098
1104
  showLoadingIndicator()
1099
-
1105
+
1100
1106
  let fullURL = EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.achCharge.path()
1101
1107
 
1102
1108
  guard let serviceURL = URL(string: fullURL) else {
@@ -1271,7 +1277,7 @@ class OTPVerificationVC: BaseVC {
1271
1277
 
1272
1278
  params["interval"] = chosenPlan?.lowercased()
1273
1279
  }
1274
-
1280
+
1275
1281
  do {
1276
1282
  let jsonData = try JSONSerialization.data(withJSONObject: params, options: .prettyPrinted)
1277
1283
  uRLRequest.httpBody = jsonData
@@ -1394,7 +1400,7 @@ class OTPVerificationVC: BaseVC {
1394
1400
  "city": billingInfoData["city"] as? String ?? "",
1395
1401
  "postal_code": billingInfoData["postal_code"] as? String ?? ""
1396
1402
  ]
1397
-
1403
+
1398
1404
  var params: [String: Any] = [
1399
1405
  "name": nameOnCard ?? "",
1400
1406
  "email": email ?? "",
@@ -1484,7 +1490,9 @@ class OTPVerificationVC: BaseVC {
1484
1490
  paymentDoneVC.redirectURL = urlString
1485
1491
  paymentDoneVC.chargeData = responseObject
1486
1492
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
1487
-
1493
+ // Pass billing and additional info
1494
+ paymentDoneVC.billingInfo = billingInfo
1495
+ paymentDoneVC.additionalInfo = additionalInfo
1488
1496
  self.navigationController?.pushViewController(paymentDoneVC, animated: true)
1489
1497
  }
1490
1498
  }
@@ -1510,7 +1518,7 @@ class OTPVerificationVC: BaseVC {
1510
1518
  }
1511
1519
  task.resume()
1512
1520
  }
1513
-
1521
+
1514
1522
  @IBAction func actionBtnCancel(_ sender: UIButton) {
1515
1523
  stopTimer()
1516
1524
  for viewController in self.navigationController?.viewControllers ?? [] {
@@ -9,6 +9,7 @@ import UIKit
9
9
 
10
10
  class PaymentDoneVC: UIViewController {
11
11
 
12
+ @IBOutlet weak var viewMain: UIView!
12
13
  @IBOutlet weak var lblDate: UILabel!
13
14
  @IBOutlet weak var lblTransactionId: UILabel!
14
15
  @IBOutlet weak var lblPaymentSource: UILabel!
@@ -23,6 +24,7 @@ class PaymentDoneVC: UIViewController {
23
24
  @IBOutlet weak var viewSubscriptionId: UIStackView!
24
25
  @IBOutlet weak var lblHeadingSubscriptionId: UILabel!
25
26
  @IBOutlet weak var lblSubscriptionId: UILabel!
27
+ @IBOutlet weak var lblBillingInfo: UILabel!
26
28
 
27
29
  var chargeData: [String: Any]?
28
30
  var selectedPaymentMethod: String?
@@ -34,6 +36,10 @@ class PaymentDoneVC: UIViewController {
34
36
  var transactionId: String?
35
37
  var isFrom = String()
36
38
 
39
+ // Add these two properties:
40
+ var billingInfo: [String: Any]?
41
+ var additionalInfo: [String: Any]?
42
+
37
43
  override func viewDidLoad() {
38
44
  super.viewDidLoad()
39
45
 
@@ -77,6 +83,7 @@ class PaymentDoneVC: UIViewController {
77
83
  showDateAndTime()
78
84
  }
79
85
 
86
+ showBillingInfo()
80
87
  }
81
88
 
82
89
  override func viewWillAppear(_ animated: Bool) {
@@ -88,6 +95,7 @@ class PaymentDoneVC: UIViewController {
88
95
  if let containerBGcolor = UserStoreSingleton.shared.container_bg_col,
89
96
  let uiColor = UIColor(hex: containerBGcolor) {
90
97
  self.view.backgroundColor = uiColor
98
+ self.viewMain.backgroundColor = uiColor
91
99
  }
92
100
 
93
101
  if let primaryBtnBackGroundColor = UserStoreSingleton.shared.primary_btn_bg_col,
@@ -120,26 +128,53 @@ class PaymentDoneVC: UIViewController {
120
128
  lblTotal.textColor = uiColor
121
129
  lblHeadingSubscriptionId.textColor = uiColor
122
130
  lblSubscriptionId.textColor = uiColor
131
+ lblBillingInfo.textColor = uiColor
123
132
  }
124
133
 
125
134
  if let fontSizeString = UserStoreSingleton.shared.fontSize,
126
135
  let fontSizeDouble = Double(fontSizeString) { // Convert String to Double
127
136
  let fontSize = CGFloat(fontSizeDouble) // Convert Double to CGFloat
128
- lblDate.font = UIFont.systemFont(ofSize: fontSize)
129
- lblTransactionId.font = UIFont.systemFont(ofSize: fontSize)
130
- lblPaymentSource.font = UIFont.systemFont(ofSize: fontSize)
131
- lblTotal.font = UIFont.systemFont(ofSize: fontSize)
132
- lblHeadingDate.font = UIFont.systemFont(ofSize: fontSize)
133
- lblHeadingTransactionID.font = UIFont.systemFont(ofSize: fontSize)
134
- lbHeadingPaymentMethod.font = UIFont.systemFont(ofSize: fontSize)
135
- lblHeadingTotal.font = UIFont.systemFont(ofSize: fontSize)
136
- btnDone.titleLabel?.font = UIFont.systemFont(ofSize: fontSize)
137
- lblHeadingSubscriptionId.font = UIFont.systemFont(ofSize: fontSize)
138
- lblSubscriptionId.font = UIFont.systemFont(ofSize: fontSize)
137
+ lblDate.font = UIFont.systemFont(ofSize: fontSize, weight: .medium)
138
+ lblTransactionId.font = UIFont.systemFont(ofSize: fontSize, weight: .medium)
139
+ lblPaymentSource.font = UIFont.systemFont(ofSize: fontSize, weight: .medium)
140
+ lblTotal.font = UIFont.systemFont(ofSize: fontSize, weight: .medium)
141
+ lblHeadingDate.font = UIFont.systemFont(ofSize: fontSize, weight: .medium)
142
+ lblHeadingTransactionID.font = UIFont.systemFont(ofSize: fontSize, weight: .medium)
143
+ lbHeadingPaymentMethod.font = UIFont.systemFont(ofSize: fontSize, weight: .medium)
144
+ lblHeadingTotal.font = UIFont.systemFont(ofSize: fontSize, weight: .medium)
145
+ btnDone.titleLabel?.font = UIFont.systemFont(ofSize: fontSize, weight: .medium)
146
+ lblHeadingSubscriptionId.font = UIFont.systemFont(ofSize: fontSize, weight: .medium)
147
+ lblSubscriptionId.font = UIFont.systemFont(ofSize: fontSize, weight: .medium)
148
+ lblBillingInfo.font = UIFont.systemFont(ofSize: fontSize, weight: .medium)
139
149
  }
140
150
 
141
151
  }
142
152
 
153
+ func showBillingInfo() {
154
+ var displayText = ""
155
+
156
+ if let billing = billingInfo {
157
+ displayText += "Billing Info:\n"
158
+ for (key, value) in billing {
159
+ displayText += "\(key.capitalized): \(value)\n"
160
+ }
161
+
162
+ if let additional = additionalInfo {
163
+ displayText += "\nAdditional Info:\n"
164
+ for (key, value) in additional {
165
+ displayText += "\(key.capitalized): \(value)\n"
166
+ }
167
+ }
168
+
169
+ // Set text and make label visible
170
+ lblBillingInfo.text = displayText.trimmingCharacters(in: .whitespacesAndNewlines)
171
+ lblBillingInfo.isHidden = false
172
+ } else {
173
+ // Hide label if billing info is not available
174
+ lblBillingInfo.isHidden = true
175
+ }
176
+ }
177
+
143
178
  // Helper method to check if the date string is valid
144
179
  func isValidDate(_ dateString: String) -> Bool {
145
180
  let dateFormatter = DateFormatter()
@@ -159,12 +194,15 @@ class PaymentDoneVC: UIViewController {
159
194
  }
160
195
 
161
196
  @IBAction func actionBtnDone(_ sender: UIButton) {
162
- let result = Result(type: .success, chargeData: chargeData)
197
+ let result = Result(type: .success,
198
+ chargeData: chargeData,
199
+ billingInfo: billingInfo,
200
+ additionalInfo: additionalInfo)
201
+
163
202
  easyPayDelegate?.easyPayController(self.navigationController as! EasyPayViewController, didFinishWith: result)
164
203
 
165
204
  if let easyPayVC = self.navigationController as? EasyPayViewController {
166
205
  easyPayVC.dismiss(animated: true, completion: {
167
- // Ensure the chargeData is sent back to the starting screen
168
206
  if let delegate = easyPayVC.easyPayDelegate {
169
207
  UserStoreSingleton.shared.isLoggedIn = false
170
208
  delegate.easyPayController(easyPayVC, didFinishWith: result)
@@ -541,7 +541,8 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
541
541
  self.txtFieldSelectDateGrailPayBankView.isHidden = false
542
542
  self.txtFieldSelectDateNewGrailPayBankView.isHidden = false
543
543
 
544
- self.heightViewBankFields.constant = 696
544
+ self.heightViewBankFields.constant = 710
545
+
545
546
  self.heightViewNewCardFields.constant = 624
546
547
  self.heightViewNewAccountFields.constant = 808
547
548
  self.heightSubViewNewAccountFields.constant = 738
@@ -3272,7 +3273,6 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
3272
3273
  self.showAlert(title: "Missing Information", message: "Card Expiry Date is required.")
3273
3274
  return
3274
3275
  }
3275
-
3276
3276
  else if !expiryDate.matches(expiryDateRegex) {
3277
3277
  self.showAlert(title: "Invalid Expiry Date", message: "Expiry Date must be in format MM/yyyy (e.g., 02/2026).")
3278
3278
  return
@@ -3547,6 +3547,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
3547
3547
  btnPayNowSingleAccountView.isHidden = !isSelectForPayBank
3548
3548
 
3549
3549
  if isSelectForPayBank {
3550
+ selectedBankIndex = 0
3550
3551
  // Show or hide recurring plan fields based on request.enableRecurring
3551
3552
  if request?.is_recurring == true {
3552
3553
  txtFieldSelectPlanSingleSavedBankView.isHidden = false
@@ -3560,6 +3561,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
3560
3561
  txtFieldSelectDateSingleSavedBankView.isHidden = true
3561
3562
  }
3562
3563
  } else {
3564
+ selectedBankIndex = nil
3563
3565
  // Hide all related fields if not selected
3564
3566
  btnNext.isHidden = true
3565
3567
  btnNextHeight.constant = 0
@@ -6529,6 +6531,20 @@ extension PaymentInfoVC: UICollectionViewDelegate, UICollectionViewDataSource, U
6529
6531
  }
6530
6532
  }
6531
6533
 
6534
+ // // Update border color based on selection
6535
+ // if selectedIndex == indexPath {
6536
+ // if let primaryBackGroundColor = UserStoreSingleton.shared.primary_btn_bg_col,
6537
+ // let uiColor = UIColor(hex: primaryBackGroundColor) {
6538
+ // cell.vwMain.layer.borderColor = uiColor.cgColor // Convert UIColor to CGColor
6539
+ // cell.imgVwPayments.tintColor = uiColor
6540
+ // cell.lblPayment.textColor = uiColor
6541
+ // }
6542
+ // } else {
6543
+ // cell.vwMain.layer.borderColor = UIColor.gray.cgColor
6544
+ // cell.imgVwPayments.tintColor = .systemGray
6545
+ // cell.lblPayment.textColor = .systemGray
6546
+ // }
6547
+
6532
6548
  return cell
6533
6549
  }
6534
6550
 
@@ -9,19 +9,27 @@ import UIKit
9
9
 
10
10
  class ThreeDSecurePaymentDoneVC: UIViewController {
11
11
 
12
+ @IBOutlet weak var viewMain: UIView!
12
13
  @IBOutlet weak var lblCompleteAuthentication: UILabel!
13
14
  @IBOutlet weak var btnDone: UIButton!
14
15
  @IBOutlet weak var lblPaymentLink: UILabel!
16
+ @IBOutlet weak var lblBillingInfoData: UILabel!
15
17
 
16
18
  var easyPayDelegate: EasyPayViewControllerDelegate?
17
19
  var redirectURL: String?
18
20
  var chargeData: [String: Any] = [:]
19
21
 
22
+ // Add these two properties:
23
+ var billingInfo: [String: Any]?
24
+ var additionalInfo: [String: Any]?
25
+
20
26
  override func viewDidLoad() {
21
27
  super.viewDidLoad()
22
28
  uiFinishingTouchElements()
23
29
 
24
30
  setupTapOnLabel()
31
+
32
+ showBillingInfo()
25
33
  }
26
34
 
27
35
  override func viewWillAppear(_ animated: Bool) {
@@ -48,13 +56,41 @@ class ThreeDSecurePaymentDoneVC: UIViewController {
48
56
  UIApplication.shared.open(url, options: [:], completionHandler: nil)
49
57
  }
50
58
 
59
+ func showBillingInfo() {
60
+ var displayText = ""
61
+
62
+ if let billing = billingInfo {
63
+ displayText += "Billing Info:\n"
64
+ for (key, value) in billing {
65
+ displayText += "\(key.capitalized): \(value)\n"
66
+ }
67
+
68
+ if let additional = additionalInfo {
69
+ displayText += "\nAdditional Info:\n"
70
+ for (key, value) in additional {
71
+ displayText += "\(key.capitalized): \(value)\n"
72
+ }
73
+ }
74
+
75
+ // Set text and make label visible
76
+ lblBillingInfoData.text = displayText.trimmingCharacters(in: .whitespacesAndNewlines)
77
+ lblBillingInfoData.isHidden = false
78
+ } else {
79
+ // Hide label if billing info is not available
80
+ lblBillingInfoData.isHidden = true
81
+ }
82
+ }
83
+
51
84
  @IBAction func actionBtnDone(_ sender: UIButton) {
52
- let result = Result(type: .success, chargeData: chargeData)
85
+ let result = Result(type: .success,
86
+ chargeData: chargeData,
87
+ billingInfo: billingInfo,
88
+ additionalInfo: additionalInfo)
89
+
53
90
  easyPayDelegate?.easyPayController(self.navigationController as! EasyPayViewController, didFinishWith: result)
54
91
 
55
92
  if let easyPayVC = self.navigationController as? EasyPayViewController {
56
93
  easyPayVC.dismiss(animated: true, completion: {
57
- // Ensure the chargeData is sent back to the starting screen
58
94
  if let delegate = easyPayVC.easyPayDelegate {
59
95
  UserStoreSingleton.shared.isLoggedIn = false
60
96
  delegate.easyPayController(easyPayVC, didFinishWith: result)
@@ -68,6 +104,7 @@ class ThreeDSecurePaymentDoneVC: UIViewController {
68
104
  if let containerBGcolor = UserStoreSingleton.shared.container_bg_col,
69
105
  let uiColor = UIColor(hex: containerBGcolor) {
70
106
  self.view.backgroundColor = uiColor
107
+ self.viewMain.backgroundColor = uiColor
71
108
  }
72
109
 
73
110
  if let primaryBtnBackGroundColor = UserStoreSingleton.shared.primary_btn_bg_col,
@@ -91,6 +128,7 @@ class ThreeDSecurePaymentDoneVC: UIViewController {
91
128
  if let primaryFontColor = UserStoreSingleton.shared.primary_font_col,
92
129
  let uiColor = UIColor(hex: primaryFontColor) {
93
130
  lblCompleteAuthentication.textColor = uiColor
131
+ lblBillingInfoData.textColor = uiColor
94
132
  }
95
133
 
96
134
  if let fontSizeString = UserStoreSingleton.shared.fontSize,
@@ -98,6 +136,7 @@ class ThreeDSecurePaymentDoneVC: UIViewController {
98
136
  let fontSize = CGFloat(fontSizeDouble) // Convert Double to CGFloat
99
137
  lblCompleteAuthentication.font = UIFont.systemFont(ofSize: fontSize, weight: .semibold)
100
138
  lblPaymentLink.font = UIFont.systemFont(ofSize: fontSize, weight: .medium)
139
+ lblBillingInfoData.font = UIFont.systemFont(ofSize: fontSize, weight: .medium)
101
140
  }
102
141
 
103
142
  }
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'easymerchantsdk'
3
- s.version = '1.3.8'
3
+ s.version = '1.3.9'
4
4
  s.summary = 'A React Native SDK for Easy Merchant.'
5
5
  s.description = <<-DESC
6
6
  A React Native SDK to enable Easy Merchant functionality in mobile applications.