@jimrising/easymerchantsdk-react-native 1.8.5 → 1.8.6

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
@@ -7,7 +7,7 @@ To add the path of sdk in your project. Open your `package.json` file and inside
7
7
 
8
8
  ```json
9
9
  "dependencies": {
10
- "@jimrising/easymerchantsdk-react-native": "^1.8.5"
10
+ "@jimrising/easymerchantsdk-react-native": "^1.8.6"
11
11
  },
12
12
  ```
13
13
 
@@ -273,10 +273,18 @@ const App = () => {
273
273
  const [apiSecret, setApiSecret] = useState('apiSecret');
274
274
  const [isEnvironmentLoading, setIsEnvironmentLoading] = useState(false);
275
275
 
276
+ useEffect(() => {
277
+ if (Platform.OS !== 'android') {
278
+ console.log('Event listeners skipped: not Android');
279
+ return;
280
+ }
276
281
 
277
- const easyMerchantEvents = new NativeEventEmitter(RNEasymerchantsdk);
282
+ if (!RNEasymerchantsdk) {
283
+ console.warn('RNEasymerchantsdk native module is not available.');
284
+ return;
285
+ }
278
286
 
279
- useEffect(() => {
287
+ const easyMerchantEvents = new NativeEventEmitter(RNEasymerchantsdk);
280
288
  const successSub = easyMerchantEvents.addListener('PaymentSuccess', (data) => {
281
289
  console.log('Payment success event:', data);
282
290
  const parsed = JSON.parse(data.response);
@@ -39,7 +39,7 @@ repositories {
39
39
  }
40
40
 
41
41
  dependencies {
42
- implementation 'com.app:paysdk:1.4.0'
42
+ implementation 'com.app:paysdk:1.4.1'
43
43
  implementation 'com.hbb20:ccp:2.7.3'
44
44
  implementation 'com.github.bumptech.glide:glide:4.16.0'
45
45
  implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.1"
@@ -213,12 +213,10 @@ public class RNEasymerchantsdkModule extends ReactContextBaseJavaModule {
213
213
  WritableMap result = Arguments.createMap();
214
214
  result.putString("response", jsonResponse.toString());
215
215
 
216
- // ✅ Emit payment success event immediately
217
216
  reactContext
218
217
  .getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
219
218
  .emit("PaymentSuccess", result);
220
219
 
221
- // ✅ Prepare final holders for optional data
222
220
  final String[] billingInfo = new String[1];
223
221
  final String[] additionalInfo = new String[1];
224
222
  final String[] lastFour = new String[1];
@@ -244,7 +242,6 @@ public class RNEasymerchantsdkModule extends ReactContextBaseJavaModule {
244
242
  @Override
245
243
  public void onSuccess(JSONObject statusResponse) {
246
244
  try {
247
- // ✅ Merge billingInfo, additionalInfo, lastFour from original payment
248
245
  if (billingInfo[0] != null) {
249
246
  statusResponse.put("billingInfo", new JSONObject(billingInfo[0]));
250
247
  }
@@ -342,7 +342,8 @@ public final class Request: NSObject {
342
342
  }
343
343
 
344
344
  let params: [String: Any] = [
345
- "amount": amount ?? 0,
345
+ // "amount": amount ?? 0,
346
+ "amount": ((amount ?? 0) * 100).rounded() / 100,
346
347
  // "allowed_cycles": String(recurringIntervals?.count ?? 0),
347
348
  "allowed_cycles": numOfCycle ?? 0,
348
349
  "intervals": recurringIntervals?.map { $0.rawValue } ?? [],
@@ -406,150 +407,7 @@ public final class Request: NSObject {
406
407
 
407
408
  task.resume()
408
409
  }
409
-
410
- // MARK: - Payment Intent Api
411
- // func paymentIntentApi(completion: @escaping (Bool) -> Void) {
412
- // // ✅ Show Loader
413
- // DispatchQueue.main.async {
414
- // UIApplication.topViewController()?.ep_showLoadingIndicator()
415
- // }
416
- //
417
- // guard let serviceURL = URL(string: EnvironmentConfig.baseURL + EnvironmentConfig.Endpoints.paymentIntent.path()) else {
418
- // DispatchQueue.main.async {
419
- // UIApplication.topViewController()?.ep_hideLoadingIndicator()
420
- // self.showErrorAndDismiss(message: "Invalid payment URL.")
421
- // }
422
- // completion(false)
423
- // return
424
- // }
425
- //
426
- // var request = URLRequest(url: serviceURL)
427
- // request.httpMethod = "POST"
428
- // request.addValue("application/json", forHTTPHeaderField: "Content-Type")
429
- // request.addValue(EnvironmentConfig.apiKey ?? "", forHTTPHeaderField: "X-Api-Key")
430
- // request.addValue(EnvironmentConfig.apiSecret ?? "", forHTTPHeaderField: "X-Api-Secret")
431
- //
432
- // // Validate recurring start date
433
- // if let startDateString = recurringStartDate,
434
- // let startDate = DateFormatter.recurringDateFormatter.date(from: startDateString) {
435
- // let today = Calendar.current.startOfDay(for: Date())
436
- // let startDay = Calendar.current.startOfDay(for: startDate)
437
- //
438
- // if startDay < today {
439
- // DispatchQueue.main.async {
440
- // UIApplication.topViewController()?.ep_hideLoadingIndicator()
441
- // self.showErrorAndDismiss(message: "The recurring start date cannot be in the past. Please select today or a future date.")
442
- // }
443
- // completion(false)
444
- // return
445
- // }
446
- // }
447
- //
448
- // let params: [String: Any] = [
449
- // "amount": amount ?? 0,
450
- // "allowed_cycles": numOfCycle ?? 0,
451
- // "intervals": recurringIntervals?.map { $0.rawValue } ?? [],
452
- // "is_recurring": self.is_recurring ?? false,
453
- // "recurring_start_date": recurringStartDate ?? "",
454
- // "recurring_start_date_type": recurringStartDateType?.rawValue ?? ""
455
- // ]
456
- //
457
- // do {
458
- // request.httpBody = try JSONSerialization.data(withJSONObject: params, options: .prettyPrinted)
459
- // } catch {
460
- // DispatchQueue.main.async {
461
- // UIApplication.topViewController()?.ep_hideLoadingIndicator()
462
- // self.showErrorAndDismiss(message: "Failed to encode payment data.")
463
- // }
464
- // completion(false)
465
- // return
466
- // }
467
- //
468
- // URLSession.shared.dataTask(with: request) { data, response, error in
469
- // defer {
470
- // DispatchQueue.main.async {
471
- // UIApplication.topViewController()?.ep_hideLoadingIndicator()
472
- // }
473
- // }
474
- //
475
- // if let error = error {
476
- // DispatchQueue.main.async {
477
- // self.showErrorAndDismiss(message: error.localizedDescription)
478
- // }
479
- // completion(false)
480
- // return
481
- // }
482
- //
483
- // guard let httpResponse = response as? HTTPURLResponse else {
484
- // DispatchQueue.main.async {
485
- // self.showErrorAndDismiss(message: "Invalid response.")
486
- // }
487
- // completion(false)
488
- // return
489
- // }
490
- //
491
- // if httpResponse.statusCode == 200 || httpResponse.statusCode == 201 {
492
- // guard let data = data else {
493
- // DispatchQueue.main.async {
494
- // self.showErrorAndDismiss(message: "No response data received.")
495
- // }
496
- // completion(false)
497
- // return
498
- // }
499
- //
500
- // do {
501
- // guard let responseObject = try JSONSerialization.jsonObject(with: data) as? [String: Any] else {
502
- // DispatchQueue.main.async {
503
- // self.showErrorAndDismiss(message: "Invalid response format.")
504
- // }
505
- // completion(false)
506
- // return
507
- // }
508
- //
509
- // // ✅ Save values into UserStoreSingleton
510
- // if let clientToken = responseObject["client_token"] as? String {
511
- // UserStoreSingleton.shared.clientToken = clientToken
512
- // print("✅ Saved Client Token: \(clientToken)")
513
- // }
514
- // if let paymentIntent = responseObject["payment_intent"] as? String {
515
- // UserStoreSingleton.shared.paymentIntent = paymentIntent
516
- // print("✅ Saved Payment Intent: \(paymentIntent)")
517
- // }
518
- //
519
- // // ✅ Proceed to next step only after saving
520
- // self.hostedCheckoutsApi { success in
521
- // DispatchQueue.main.async {
522
- // UIApplication.topViewController()?.ep_hideLoadingIndicator()
523
- // }
524
- // completion(success)
525
- // }
526
- // return
527
- //
528
- // } catch {
529
- // DispatchQueue.main.async {
530
- // self.showErrorAndDismiss(message: "Failed to parse response.")
531
- // }
532
- // completion(false)
533
- // return
534
- // }
535
- //
536
- // } else {
537
- // var message = "Payment request failed with status code: \(httpResponse.statusCode)"
538
- // if let data = data,
539
- // let responseObj = try? JSONSerialization.jsonObject(with: data) as? [String: Any],
540
- // let msg = responseObj["message"] as? String {
541
- // message = msg
542
- // }
543
- // DispatchQueue.main.async {
544
- // self.showErrorAndDismiss(message: message)
545
- // }
546
- // }
547
- //
548
- // completion(false)
549
- //
550
- // }.resume()
551
- // }
552
-
410
+
553
411
  private func showErrorAndDismiss(message: String) {
554
412
  DispatchQueue.main.async {
555
413
  if let topVC = UIApplication.topViewController() {
@@ -586,7 +444,8 @@ public final class Request: NSObject {
586
444
  request.addValue(UserStoreSingleton.shared.clientToken ?? "", forHTTPHeaderField: "clientToken")
587
445
 
588
446
  let params: [String: Any] = [
589
- "amount": amount ?? 0,
447
+ // "amount": amount ?? 0,
448
+ "amount": ((amount ?? 0) * 100).rounded() / 100,
590
449
  ]
591
450
 
592
451
  print(params)
@@ -556,6 +556,7 @@ class AdditionalInfoVC: BaseVC {
556
556
  // Pass billing and additional info
557
557
  // Conditionally pass raw FieldItem array
558
558
  paymentDoneVC.visibility = self.visibility
559
+ paymentDoneVC.request = self.request
559
560
 
560
561
  // if self.visibility?.billing == true {
561
562
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -765,6 +766,7 @@ class AdditionalInfoVC: BaseVC {
765
766
  // Pass billing and additional info
766
767
  // Conditionally pass raw FieldItem array
767
768
  paymentDoneVC.visibility = self.visibility
769
+ paymentDoneVC.request = self.request
768
770
 
769
771
  // if self.visibility?.billing == true {
770
772
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -961,6 +963,7 @@ class AdditionalInfoVC: BaseVC {
961
963
  // Pass billing and additional info
962
964
  // Conditionally pass raw FieldItem array
963
965
  paymentDoneVC.visibility = self.visibility
966
+ paymentDoneVC.request = self.request
964
967
 
965
968
  // if self.visibility?.billing == true {
966
969
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -1144,6 +1147,7 @@ class AdditionalInfoVC: BaseVC {
1144
1147
  // Pass billing and additional info
1145
1148
  // Conditionally pass raw FieldItem array
1146
1149
  paymentDoneVC.visibility = self.visibility
1150
+ paymentDoneVC.request = self.request
1147
1151
 
1148
1152
  // if self.visibility?.billing == true {
1149
1153
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -1323,6 +1327,7 @@ class AdditionalInfoVC: BaseVC {
1323
1327
  // Pass billing and additional info
1324
1328
  // Conditionally pass raw FieldItem array
1325
1329
  paymentDoneVC.visibility = self.visibility
1330
+ paymentDoneVC.request = self.request
1326
1331
 
1327
1332
  // if self.visibility?.billing == true {
1328
1333
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -1520,6 +1525,7 @@ class AdditionalInfoVC: BaseVC {
1520
1525
  // Pass billing and additional info
1521
1526
  // Conditionally pass raw FieldItem array
1522
1527
  paymentDoneVC.visibility = self.visibility
1528
+ paymentDoneVC.request = self.request
1523
1529
 
1524
1530
  // if self.visibility?.billing == true {
1525
1531
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -1713,6 +1719,7 @@ class AdditionalInfoVC: BaseVC {
1713
1719
  paymentDoneVC.visibility = self.visibility
1714
1720
  paymentDoneVC.amount = self.amount
1715
1721
  paymentDoneVC.cardApiParams = params
1722
+ paymentDoneVC.request = self.request
1716
1723
 
1717
1724
  // if self.visibility?.billing == true {
1718
1725
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -1911,6 +1918,7 @@ class AdditionalInfoVC: BaseVC {
1911
1918
  paymentDoneVC.visibility = self.visibility
1912
1919
  paymentDoneVC.amount = self.amount
1913
1920
  paymentDoneVC.cardApiParams = params
1921
+ paymentDoneVC.request = self.request
1914
1922
 
1915
1923
  // if self.visibility?.billing == true {
1916
1924
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -2106,6 +2114,7 @@ class AdditionalInfoVC: BaseVC {
2106
2114
  // Pass billing and additional info
2107
2115
  // Conditionally pass raw FieldItem array
2108
2116
  paymentDoneVC.visibility = self.visibility
2117
+ paymentDoneVC.request = self.request
2109
2118
 
2110
2119
  // if self.visibility?.billing == true {
2111
2120
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -2334,6 +2343,7 @@ class AdditionalInfoVC: BaseVC {
2334
2343
  // Pass billing and additional info
2335
2344
  // Conditionally pass raw FieldItem array
2336
2345
  paymentDoneVC.visibility = self.visibility
2346
+ paymentDoneVC.request = self.request
2337
2347
 
2338
2348
  // if self.visibility?.billing == true {
2339
2349
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -1002,6 +1002,7 @@ class BillingInfoVC: BaseVC {
1002
1002
  // Pass billing and additional info
1003
1003
  // Conditionally pass raw FieldItem array
1004
1004
  paymentDoneVC.visibility = self.visibility
1005
+ paymentDoneVC.request = self.request
1005
1006
 
1006
1007
  // if self.visibility?.billing == true {
1007
1008
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -1190,6 +1191,7 @@ class BillingInfoVC: BaseVC {
1190
1191
  paymentDoneVC.visibility = self.visibility
1191
1192
  paymentDoneVC.amount = self.amount
1192
1193
  paymentDoneVC.cardApiParams = params
1194
+ paymentDoneVC.request = self.request
1193
1195
 
1194
1196
  // if self.visibility?.billing == true {
1195
1197
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -1368,6 +1370,7 @@ class BillingInfoVC: BaseVC {
1368
1370
  paymentDoneVC.visibility = self.visibility
1369
1371
  paymentDoneVC.amount = self.amount
1370
1372
  paymentDoneVC.cardApiParams = params
1373
+ paymentDoneVC.request = self.request
1371
1374
 
1372
1375
  // if self.visibility?.billing == true {
1373
1376
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -1550,6 +1553,7 @@ class BillingInfoVC: BaseVC {
1550
1553
  // Pass billing and additional info
1551
1554
  // Conditionally pass raw FieldItem array
1552
1555
  paymentDoneVC.visibility = self.visibility
1556
+ paymentDoneVC.request = self.request
1553
1557
 
1554
1558
  // if self.visibility?.billing == true {
1555
1559
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -1732,6 +1736,7 @@ class BillingInfoVC: BaseVC {
1732
1736
  // Pass billing and additional info
1733
1737
  // Conditionally pass raw FieldItem array
1734
1738
  paymentDoneVC.visibility = self.visibility
1739
+ paymentDoneVC.request = self.request
1735
1740
 
1736
1741
  // if self.visibility?.billing == true {
1737
1742
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -1897,6 +1902,7 @@ class BillingInfoVC: BaseVC {
1897
1902
  // Pass billing and additional info
1898
1903
  // Conditionally pass raw FieldItem array
1899
1904
  paymentDoneVC.visibility = self.visibility
1905
+ paymentDoneVC.request = self.request
1900
1906
 
1901
1907
  // if self.visibility?.billing == true {
1902
1908
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -2065,6 +2071,7 @@ class BillingInfoVC: BaseVC {
2065
2071
  // Pass billing and additional info
2066
2072
  // Conditionally pass raw FieldItem array
2067
2073
  paymentDoneVC.visibility = self.visibility
2074
+ paymentDoneVC.request = self.request
2068
2075
 
2069
2076
  // if self.visibility?.billing == true {
2070
2077
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -2242,6 +2249,7 @@ class BillingInfoVC: BaseVC {
2242
2249
  // Pass billing and additional info
2243
2250
  // Conditionally pass raw FieldItem array
2244
2251
  paymentDoneVC.visibility = self.visibility
2252
+ paymentDoneVC.request = self.request
2245
2253
 
2246
2254
  // if self.visibility?.billing == true {
2247
2255
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -2412,6 +2420,7 @@ class BillingInfoVC: BaseVC {
2412
2420
  // Pass billing and additional info
2413
2421
  // Conditionally pass raw FieldItem array
2414
2422
  paymentDoneVC.visibility = self.visibility
2423
+ paymentDoneVC.request = self.request
2415
2424
 
2416
2425
  // if self.visibility?.billing == true {
2417
2426
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -2631,6 +2640,7 @@ class BillingInfoVC: BaseVC {
2631
2640
  // Pass billing and additional info
2632
2641
  // Conditionally pass raw FieldItem array
2633
2642
  paymentDoneVC.visibility = self.visibility
2643
+ paymentDoneVC.request = self.request
2634
2644
 
2635
2645
  // if self.visibility?.billing == true {
2636
2646
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -710,6 +710,8 @@ class OTPVerificationVC: BaseVC {
710
710
  paymentDoneVC.chargeData = responseObject
711
711
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
712
712
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
713
+ paymentDoneVC.request = self.request
714
+
713
715
  // Pass billing info and additional info if available
714
716
  if let billingInfoData = self.request.billingInfoData,
715
717
  let fieldSection = try? JSONDecoder().decode(FieldSection.self, from: billingInfoData) {
@@ -879,6 +881,7 @@ class OTPVerificationVC: BaseVC {
879
881
  paymentDoneVC.chargeData = responseObject
880
882
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
881
883
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
884
+ paymentDoneVC.request = self.request
882
885
  self.navigationController?.pushViewController(paymentDoneVC, animated: true)
883
886
  }
884
887
  }
@@ -1101,6 +1104,7 @@ class OTPVerificationVC: BaseVC {
1101
1104
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
1102
1105
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
1103
1106
  paymentDoneVC.bankPaymentParams = params
1107
+ paymentDoneVC.request = self.request
1104
1108
  // Pass billing info and additional info if available
1105
1109
  if let billingInfoData = self.request.billingInfoData,
1106
1110
  let fieldSection = try? JSONDecoder().decode(FieldSection.self, from: billingInfoData) {
@@ -1270,6 +1274,7 @@ class OTPVerificationVC: BaseVC {
1270
1274
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
1271
1275
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
1272
1276
  paymentDoneVC.bankPaymentParams = params
1277
+ paymentDoneVC.request = self.request
1273
1278
  self.navigationController?.pushViewController(paymentDoneVC, animated: true)
1274
1279
  }
1275
1280
  }
@@ -1479,6 +1484,7 @@ class OTPVerificationVC: BaseVC {
1479
1484
  // Pass billing and additional info
1480
1485
  // Conditionally pass raw FieldItem array
1481
1486
  paymentDoneVC.visibility = self.visibility
1487
+ paymentDoneVC.request = self.request
1482
1488
 
1483
1489
  // if self.visibility?.billing == true {
1484
1490
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -1640,6 +1646,7 @@ class OTPVerificationVC: BaseVC {
1640
1646
  paymentDoneVC.chargeData = responseObject
1641
1647
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
1642
1648
  paymentDoneVC.cardApiParams = params
1649
+ paymentDoneVC.request = self.request
1643
1650
  self.navigationController?.pushViewController(paymentDoneVC, animated: true)
1644
1651
  }
1645
1652
  }
@@ -1818,6 +1825,7 @@ class OTPVerificationVC: BaseVC {
1818
1825
  paymentDoneVC.visibility = self.visibility
1819
1826
  paymentDoneVC.amount = self.amount
1820
1827
  paymentDoneVC.cardApiParams = params
1828
+ paymentDoneVC.request = self.request
1821
1829
 
1822
1830
  // if self.visibility?.billing == true {
1823
1831
  paymentDoneVC.billingInfoData = self.billingInfo
@@ -46,6 +46,8 @@ class PaymentDoneVC: UIViewController {
46
46
 
47
47
  var bankPaymentParams: [String: Any]?
48
48
 
49
+ var request: Request!
50
+
49
51
  override func viewDidLoad() {
50
52
  super.viewDidLoad()
51
53
 
@@ -85,7 +87,9 @@ class PaymentDoneVC: UIViewController {
85
87
  }
86
88
 
87
89
  lblPaymentSource.text = selectedPaymentMethod
88
- lblTotal.text = "$\(UserStoreSingleton.shared.price ?? "0.00")"
90
+ let rawAmount = Double(request?.amount ?? 0)
91
+ let amountText = String(format: "$%.2f", rawAmount)
92
+ lblTotal.text = "\(amountText)"
89
93
  showDateAndTime()
90
94
  }
91
95
 
@@ -3307,6 +3307,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
3307
3307
  // Pass the selected payment method
3308
3308
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
3309
3309
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
3310
+ paymentDoneVC.request = self.request
3310
3311
  // Pass billing info and additional info if available
3311
3312
  if let billingInfoData = self.request.billingInfoData,
3312
3313
  let fieldSection = try? JSONDecoder().decode(FieldSection.self, from: billingInfoData) {
@@ -3521,6 +3522,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
3521
3522
  // Pass the selected payment method
3522
3523
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
3523
3524
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
3525
+ paymentDoneVC.request = self.request
3524
3526
 
3525
3527
  // Pass billing info and additional info if available
3526
3528
  if let billingInfoData = self.request.billingInfoData,
@@ -3730,6 +3732,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
3730
3732
  // Pass the selected payment method
3731
3733
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
3732
3734
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate // Pass the delegate
3735
+ paymentDoneVC.request = self.request
3733
3736
 
3734
3737
  // Pass billing info and additional info if available
3735
3738
  if let billingInfoData = self.request.billingInfoData,
@@ -5608,6 +5611,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
5608
5611
  paymentDoneVC.chargeData = json
5609
5612
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
5610
5613
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
5614
+ paymentDoneVC.request = self.request
5611
5615
 
5612
5616
  if let billingData = self.request.billingInfoData,
5613
5617
  let billingInfoDict = try? JSONSerialization.jsonObject(with: billingData, options: []) as? [String: Any] {
@@ -5981,6 +5985,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
5981
5985
  paymentDoneVC.chargeData = json
5982
5986
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
5983
5987
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
5988
+ paymentDoneVC.request = self.request
5984
5989
  // Pass billing info and additional info if available
5985
5990
  if let billingInfoData = self.request.billingInfoData,
5986
5991
  let fieldSection = try? JSONDecoder().decode(FieldSection.self, from: billingInfoData) {
@@ -6239,7 +6244,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
6239
6244
  paymentDoneVC.chargeData = json
6240
6245
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
6241
6246
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
6242
-
6247
+ paymentDoneVC.request = self.request
6243
6248
  // Pass billingInfo and additionalInfo
6244
6249
  if let billingData = self.request.billingInfoData,
6245
6250
  let billingInfoDict = try? JSONSerialization.jsonObject(with: billingData, options: []) as? [String: Any] {
@@ -6446,6 +6451,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
6446
6451
  paymentDoneVC.chargeData = responseObject
6447
6452
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
6448
6453
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
6454
+ paymentDoneVC.request = self.request
6449
6455
  // Pass billing info and additional info if available
6450
6456
  if let billingInfoData = self.request.billingInfoData,
6451
6457
  let fieldSection = try? JSONDecoder().decode(FieldSection.self, from: billingInfoData) {
@@ -6682,6 +6688,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
6682
6688
  paymentDoneVC.chargeData = responseObject
6683
6689
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
6684
6690
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
6691
+ paymentDoneVC.request = self.request
6685
6692
  // Pass billingInfo and additionalInfo
6686
6693
  if let billingData = self.request.billingInfoData,
6687
6694
  let billingInfoDict = try? JSONSerialization.jsonObject(with: billingData, options: []) as? [String: Any] {
@@ -6920,6 +6927,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
6920
6927
  paymentDoneVC.chargeData = responseObject
6921
6928
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
6922
6929
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
6930
+ paymentDoneVC.request = self.request
6923
6931
  // Pass billing info and additional info if available
6924
6932
  if let billingInfoData = self.request.billingInfoData,
6925
6933
  let fieldSection = try? JSONDecoder().decode(FieldSection.self, from: billingInfoData) {
@@ -7513,6 +7521,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
7513
7521
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
7514
7522
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
7515
7523
  paymentDoneVC.bankPaymentParams = params
7524
+ paymentDoneVC.request = self.request
7516
7525
  // Pass billingInfo and additionalInfo
7517
7526
  if let billingData = self.request.billingInfoData,
7518
7527
  let billingInfoDict = try? JSONSerialization.jsonObject(with: billingData, options: []) as? [String: Any] {
@@ -7737,6 +7746,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
7737
7746
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
7738
7747
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
7739
7748
  paymentDoneVC.bankPaymentParams = params
7749
+ paymentDoneVC.request = self.request
7740
7750
  // Pass billing info and additional info if available
7741
7751
  if let billingInfoData = self.request.billingInfoData,
7742
7752
  let fieldSection = try? JSONDecoder().decode(FieldSection.self, from: billingInfoData) {
@@ -7889,6 +7899,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
7889
7899
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
7890
7900
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
7891
7901
  paymentDoneVC.bankPaymentParams = params
7902
+ paymentDoneVC.request = self.request
7892
7903
  // Pass billingInfo and additionalInfo
7893
7904
  if let billingData = self.request.billingInfoData,
7894
7905
  let billingInfoDict = try? JSONSerialization.jsonObject(with: billingData, options: []) as? [String: Any] {
@@ -8110,6 +8121,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
8110
8121
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
8111
8122
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
8112
8123
  paymentDoneVC.bankPaymentParams = params
8124
+ paymentDoneVC.request = self.request
8113
8125
  // Pass billing info and additional info if available
8114
8126
  if let billingInfoData = self.request.billingInfoData,
8115
8127
  let fieldSection = try? JSONDecoder().decode(FieldSection.self, from: billingInfoData) {
@@ -8271,6 +8283,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
8271
8283
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
8272
8284
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
8273
8285
  paymentDoneVC.bankPaymentParams = params
8286
+ paymentDoneVC.request = self.request
8274
8287
  // Pass billingInfo and additionalInfo
8275
8288
  if let billingData = self.request.billingInfoData,
8276
8289
  let billingInfoDict = try? JSONSerialization.jsonObject(with: billingData, options: []) as? [String: Any] {
@@ -8501,6 +8514,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
8501
8514
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
8502
8515
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
8503
8516
  paymentDoneVC.bankPaymentParams = params
8517
+ paymentDoneVC.request = self.request
8504
8518
  // Pass billing info and additional info if available
8505
8519
  if let billingInfoData = self.request.billingInfoData,
8506
8520
  let fieldSection = try? JSONDecoder().decode(FieldSection.self, from: billingInfoData) {
@@ -8672,6 +8686,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
8672
8686
  paymentDoneVC.selectedPaymentMethod = self.selectedPaymentMethod
8673
8687
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
8674
8688
  paymentDoneVC.bankPaymentParams = params
8689
+ paymentDoneVC.request = self.request
8675
8690
  // Pass billingInfo and additionalInfo
8676
8691
  if let billingData = self.request.billingInfoData,
8677
8692
  let billingInfoDict = try? JSONSerialization.jsonObject(with: billingData, options: []) as? [String: Any] {
@@ -9196,6 +9211,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
9196
9211
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
9197
9212
  paymentDoneVC.amount = self.amount
9198
9213
  paymentDoneVC.cardApiParams = params
9214
+ paymentDoneVC.request = self.request
9199
9215
  // Pass billing info and additional info if available
9200
9216
  if let billingInfoData = self.request.billingInfoData,
9201
9217
  let fieldSection = try? JSONDecoder().decode(FieldSection.self, from: billingInfoData) {
@@ -9487,6 +9503,7 @@ class PaymentInfoVC: BaseVC, BillingInfoVCDelegate {
9487
9503
  paymentDoneVC.easyPayDelegate = self.easyPayDelegate
9488
9504
  paymentDoneVC.amount = self.amount
9489
9505
  paymentDoneVC.cardApiParams = params
9506
+ paymentDoneVC.request = self.request
9490
9507
  // Pass billing info and additional info if available
9491
9508
  if let billingInfoData = self.request.billingInfoData,
9492
9509
  let fieldSection = try? JSONDecoder().decode(FieldSection.self, from: billingInfoData) {
@@ -63,6 +63,8 @@ class ThreeDSecurePaymentDoneVC: BaseVC {
63
63
 
64
64
  var cardApiParams: [String: Any]?
65
65
 
66
+ var request: Request!
67
+
66
68
  override func viewDidLoad() {
67
69
  super.viewDidLoad()
68
70
  uiFinishingTouchElements()
@@ -285,7 +287,10 @@ class ThreeDSecurePaymentDoneVC: BaseVC {
285
287
  self.lblTransactionId.text = "\(transactionId)"
286
288
  self.lblSubscriptionId.text = "\(subscriptionId)"
287
289
  self.lblDate.text = "\(formattedDate)"
288
- self.lblTotal.text = "$\(self.amount ?? 0)"
290
+ // self.lblTotal.text = "$\(self.amount ?? 0)"
291
+ let rawAmount = Double(self.request?.amount ?? 0)
292
+ let amountText = String(format: "$%.2f", rawAmount)
293
+ self.lblTotal.text = "\(amountText)"
289
294
  self.lblRefferenceId.text = "\(refToken)"
290
295
  self.lblStatus.text = "\(status)"
291
296
  }
@@ -499,7 +504,11 @@ class ThreeDSecurePaymentDoneVC: BaseVC {
499
504
  self.lblTransactionId.text = transactionId
500
505
  self.lblSubscriptionId.text = subscriptionId
501
506
  self.lblDate.text = formattedDate
502
- self.lblTotal.text = "$\(self.amount ?? 0)"
507
+ // self.lblTotal.text = "$\(self.amount ?? 0)"
508
+ let rawAmount = Double(self.request?.amount ?? 0)
509
+ let amountText = String(format: "$%.2f", rawAmount)
510
+ self.lblTotal.text = "\(amountText)"
511
+
503
512
  self.lblRefferenceId.text = referenceId
504
513
  self.lblStatus.text = status
505
514
 
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |s|
2
2
  s.name = 'easymerchantsdk'
3
- s.version = '1.8.5'
3
+ s.version = '1.8.6'
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jimrising/easymerchantsdk-react-native",
3
- "version": "1.8.5",
3
+ "version": "1.8.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {