authscape 1.0.328 → 1.0.332
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 +20 -12
- package/package.json +1 -1
- package/src/components/stripe/StripePayment.js +8 -19
package/index.js
CHANGED
|
@@ -3457,31 +3457,39 @@ 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 =
|
|
3465
|
+
_context3.next = 7;
|
|
3466
3466
|
break;
|
|
3467
3467
|
}
|
|
3468
|
-
_context3.next =
|
|
3469
|
-
|
|
3468
|
+
_context3.next = 3;
|
|
3469
|
+
return apiService().post("/Invoices/PayInvoice", {
|
|
3470
|
+
invoiceId: invoiceId,
|
|
3471
|
+
walletPaymentMethodId: paymentMethod
|
|
3472
|
+
});
|
|
3470
3473
|
case 3:
|
|
3471
|
-
|
|
3474
|
+
response = _context3.sent;
|
|
3475
|
+
if (response != null && response.status == 200) {
|
|
3476
|
+
onResponse("paid", null);
|
|
3477
|
+
}
|
|
3478
|
+
_context3.next = 11;
|
|
3479
|
+
break;
|
|
3480
|
+
case 7:
|
|
3481
|
+
_context3.next = 9;
|
|
3472
3482
|
return apiService().post("/Payment/Charge", {
|
|
3473
3483
|
paymentMethodType: paymentMethodType,
|
|
3474
3484
|
walletPaymentMethodId: paymentMethod,
|
|
3475
3485
|
amount: amount
|
|
3476
3486
|
});
|
|
3477
|
-
case
|
|
3478
|
-
|
|
3479
|
-
if (
|
|
3480
|
-
onResponse("paid",
|
|
3487
|
+
case 9:
|
|
3488
|
+
_response3 = _context3.sent;
|
|
3489
|
+
if (_response3 != null && _response3.status == 200) {
|
|
3490
|
+
onResponse("paid", _response3.data.stripePaymentIntentId);
|
|
3481
3491
|
}
|
|
3482
|
-
|
|
3483
|
-
// setIsLoading(false);
|
|
3484
|
-
case 7:
|
|
3492
|
+
case 11:
|
|
3485
3493
|
case "end":
|
|
3486
3494
|
return _context3.stop();
|
|
3487
3495
|
}
|
package/package.json
CHANGED
|
@@ -382,25 +382,16 @@ import { Select, Grid, MenuItem, Box, Button, Tab, Tabs, TextField } from '@mui/
|
|
|
382
382
|
|
|
383
383
|
if (invoiceId != null)
|
|
384
384
|
{
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
// {
|
|
394
|
-
// window.location.reload();
|
|
395
|
-
// }
|
|
396
|
-
// else
|
|
397
|
-
// {
|
|
398
|
-
// alert("We had an issue with the payment method");
|
|
399
|
-
// }
|
|
385
|
+
let response = await apiService().post("/Invoices/PayInvoice", {
|
|
386
|
+
invoiceId: invoiceId,
|
|
387
|
+
walletPaymentMethodId: paymentMethod
|
|
388
|
+
});
|
|
389
|
+
if (response != null && response.status == 200)
|
|
390
|
+
{
|
|
391
|
+
onResponse("paid", null);
|
|
392
|
+
}
|
|
400
393
|
}
|
|
401
394
|
else {
|
|
402
|
-
// setIsLoading(true);
|
|
403
|
-
|
|
404
395
|
let response = await apiService().post("/Payment/Charge", {
|
|
405
396
|
|
|
406
397
|
paymentMethodType: paymentMethodType,
|
|
@@ -412,8 +403,6 @@ import { Select, Grid, MenuItem, Box, Button, Tab, Tabs, TextField } from '@mui/
|
|
|
412
403
|
{
|
|
413
404
|
onResponse("paid", response.data.stripePaymentIntentId);
|
|
414
405
|
}
|
|
415
|
-
|
|
416
|
-
// setIsLoading(false);
|
|
417
406
|
}
|
|
418
407
|
|
|
419
408
|
}}>{payButtonText != null ? payButtonText : "Pay Now"}</Button>
|