authscape 1.0.327 → 1.0.330

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/index.js CHANGED
@@ -3457,31 +3457,41 @@ function StripePayment(_ref3) {
3457
3457
  marginTop: 2
3458
3458
  },
3459
3459
  onClick: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
3460
- var response;
3460
+ var response, _response3;
3461
3461
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
3462
3462
  while (1) switch (_context3.prev = _context3.next) {
3463
3463
  case 0:
3464
3464
  if (!(invoiceId != null)) {
3465
- _context3.next = 3;
3465
+ _context3.next = 9;
3466
3466
  break;
3467
3467
  }
3468
- _context3.next = 7;
3468
+ setIsLoading(true);
3469
+ _context3.next = 4;
3470
+ return apiService().post("/Invoices/PayInvoice", {
3471
+ invoiceId: invoiceId,
3472
+ walletPaymentMethodId: paymentMethod
3473
+ });
3474
+ case 4:
3475
+ response = _context3.sent;
3476
+ setIsLoading(false);
3477
+ if (response != null && response.status == 200) {
3478
+ onResponse("paid", null);
3479
+ }
3480
+ _context3.next = 13;
3469
3481
  break;
3470
- case 3:
3471
- _context3.next = 5;
3482
+ case 9:
3483
+ _context3.next = 11;
3472
3484
  return apiService().post("/Payment/Charge", {
3473
3485
  paymentMethodType: paymentMethodType,
3474
3486
  walletPaymentMethodId: paymentMethod,
3475
3487
  amount: amount
3476
3488
  });
3477
- case 5:
3478
- response = _context3.sent;
3479
- if (response != null && response.status == 200) {
3480
- onResponse("paid", response.data.stripePaymentIntentId);
3489
+ case 11:
3490
+ _response3 = _context3.sent;
3491
+ if (_response3 != null && _response3.status == 200) {
3492
+ onResponse("paid", _response3.data.stripePaymentIntentId);
3481
3493
  }
3482
-
3483
- // setIsLoading(false);
3484
- case 7:
3494
+ case 13:
3485
3495
  case "end":
3486
3496
  return _context3.stop();
3487
3497
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authscape",
3
- "version": "1.0.327",
3
+ "version": "1.0.330",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -382,25 +382,19 @@ import { Select, Grid, MenuItem, Box, Button, Tab, Tabs, TextField } from '@mui/
382
382
 
383
383
  if (invoiceId != null)
384
384
  {
385
- // setIsLoading(true);
386
- // let response = await apiService().post("/Invoices/PayInvoice", {
387
- // InvoiceId: invoiceId,
388
- // WalletId: walletId
389
- // });
390
- // setIsLoading(false);
391
-
392
- // if (response != null && response.status == 200)
393
- // {
394
- // window.location.reload();
395
- // }
396
- // else
397
- // {
398
- // alert("We had an issue with the payment method");
399
- // }
385
+ setIsLoading(true);
386
+ let response = await apiService().post("/Invoices/PayInvoice", {
387
+ invoiceId: invoiceId,
388
+ walletPaymentMethodId: paymentMethod
389
+ });
390
+ setIsLoading(false);
391
+
392
+ if (response != null && response.status == 200)
393
+ {
394
+ onResponse("paid", null);
395
+ }
400
396
  }
401
397
  else {
402
- // setIsLoading(true);
403
-
404
398
  let response = await apiService().post("/Payment/Charge", {
405
399
 
406
400
  paymentMethodType: paymentMethodType,
@@ -412,8 +406,6 @@ import { Select, Grid, MenuItem, Box, Button, Tab, Tabs, TextField } from '@mui/
412
406
  {
413
407
  onResponse("paid", response.data.stripePaymentIntentId);
414
408
  }
415
-
416
- // setIsLoading(false);
417
409
  }
418
410
 
419
411
  }}>{payButtonText != null ? payButtonText : "Pay Now"}</Button>