@pelcro/react-pelcro-js 3.22.0-beta.14 → 3.22.0-beta.16

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/dist/index.cjs.js CHANGED
@@ -17461,16 +17461,18 @@ const PaymentMethodContainerWithoutStripe = _ref => {
17461
17461
  items: mappedOrderItems,
17462
17462
  addressId: selectedAddressId,
17463
17463
  couponCode
17464
- }, (err, res) => {
17465
- dispatch({
17466
- type: DISABLE_SUBMIT,
17467
- payload: false
17468
- });
17469
- dispatch({
17470
- type: LOADING,
17471
- payload: false
17472
- });
17464
+ }, (err, orderResponse) => {
17465
+ var _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro2$user$;
17473
17466
  if (err) {
17467
+ toggleAuthenticationSuccessPendingView(false);
17468
+ dispatch({
17469
+ type: DISABLE_SUBMIT,
17470
+ payload: false
17471
+ });
17472
+ dispatch({
17473
+ type: LOADING,
17474
+ payload: false
17475
+ });
17474
17476
  onFailure(err);
17475
17477
  return dispatch({
17476
17478
  type: SHOW_ALERT,
@@ -17490,7 +17492,30 @@ const PaymentMethodContainerWithoutStripe = _ref => {
17490
17492
  cartItems: []
17491
17493
  });
17492
17494
  }
17493
- onSuccess(res);
17495
+ window.Pelcro.user.refresh({
17496
+ auth_token: (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : (_window$Pelcro2$user$ = _window$Pelcro2$user.read()) === null || _window$Pelcro2$user$ === void 0 ? void 0 : _window$Pelcro2$user$.auth_token
17497
+ }, (err, res) => {
17498
+ dispatch({
17499
+ type: DISABLE_SUBMIT,
17500
+ payload: false
17501
+ });
17502
+ dispatch({
17503
+ type: LOADING,
17504
+ payload: false
17505
+ });
17506
+ toggleAuthenticationSuccessPendingView(false);
17507
+ if (err) {
17508
+ onFailure(err);
17509
+ return dispatch({
17510
+ type: SHOW_ALERT,
17511
+ payload: {
17512
+ type: "error",
17513
+ content: getErrorMessages(err)
17514
+ }
17515
+ });
17516
+ }
17517
+ onSuccess(orderResponse);
17518
+ });
17494
17519
  });
17495
17520
  };
17496
17521
  const payInvoice = (gatewayService, gatewayToken, dispatch) => {
@@ -27637,7 +27662,7 @@ const InvoicesItems = () => {
27637
27662
  setInvoice,
27638
27663
  switchView
27639
27664
  } = usePelcro();
27640
- const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
27665
+ const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.order_id || invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
27641
27666
  const showInvoiceDetails = event => {
27642
27667
  if (setInvoice(event.target.dataset.id)) {
27643
27668
  switchView("invoice-details");
@@ -28405,7 +28430,7 @@ class Dashboard extends React.Component {
28405
28430
  }
28406
28431
  function hasInvoices() {
28407
28432
  var _window$Pelcro$invoic, _window$Pelcro$invoic2;
28408
- const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
28433
+ const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.order_id || invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
28409
28434
  return invoices.length > 0;
28410
28435
  }
28411
28436
  function hasDonationSubs() {
package/dist/index.esm.js CHANGED
@@ -17431,16 +17431,18 @@ const PaymentMethodContainerWithoutStripe = _ref => {
17431
17431
  items: mappedOrderItems,
17432
17432
  addressId: selectedAddressId,
17433
17433
  couponCode
17434
- }, (err, res) => {
17435
- dispatch({
17436
- type: DISABLE_SUBMIT,
17437
- payload: false
17438
- });
17439
- dispatch({
17440
- type: LOADING,
17441
- payload: false
17442
- });
17434
+ }, (err, orderResponse) => {
17435
+ var _window$Pelcro2, _window$Pelcro2$user, _window$Pelcro2$user$;
17443
17436
  if (err) {
17437
+ toggleAuthenticationSuccessPendingView(false);
17438
+ dispatch({
17439
+ type: DISABLE_SUBMIT,
17440
+ payload: false
17441
+ });
17442
+ dispatch({
17443
+ type: LOADING,
17444
+ payload: false
17445
+ });
17444
17446
  onFailure(err);
17445
17447
  return dispatch({
17446
17448
  type: SHOW_ALERT,
@@ -17460,7 +17462,30 @@ const PaymentMethodContainerWithoutStripe = _ref => {
17460
17462
  cartItems: []
17461
17463
  });
17462
17464
  }
17463
- onSuccess(res);
17465
+ window.Pelcro.user.refresh({
17466
+ auth_token: (_window$Pelcro2 = window.Pelcro) === null || _window$Pelcro2 === void 0 ? void 0 : (_window$Pelcro2$user = _window$Pelcro2.user) === null || _window$Pelcro2$user === void 0 ? void 0 : (_window$Pelcro2$user$ = _window$Pelcro2$user.read()) === null || _window$Pelcro2$user$ === void 0 ? void 0 : _window$Pelcro2$user$.auth_token
17467
+ }, (err, res) => {
17468
+ dispatch({
17469
+ type: DISABLE_SUBMIT,
17470
+ payload: false
17471
+ });
17472
+ dispatch({
17473
+ type: LOADING,
17474
+ payload: false
17475
+ });
17476
+ toggleAuthenticationSuccessPendingView(false);
17477
+ if (err) {
17478
+ onFailure(err);
17479
+ return dispatch({
17480
+ type: SHOW_ALERT,
17481
+ payload: {
17482
+ type: "error",
17483
+ content: getErrorMessages(err)
17484
+ }
17485
+ });
17486
+ }
17487
+ onSuccess(orderResponse);
17488
+ });
17464
17489
  });
17465
17490
  };
17466
17491
  const payInvoice = (gatewayService, gatewayToken, dispatch) => {
@@ -27607,7 +27632,7 @@ const InvoicesItems = () => {
27607
27632
  setInvoice,
27608
27633
  switchView
27609
27634
  } = usePelcro();
27610
- const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
27635
+ const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.order_id || invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
27611
27636
  const showInvoiceDetails = event => {
27612
27637
  if (setInvoice(event.target.dataset.id)) {
27613
27638
  switchView("invoice-details");
@@ -28375,7 +28400,7 @@ class Dashboard extends Component {
28375
28400
  }
28376
28401
  function hasInvoices() {
28377
28402
  var _window$Pelcro$invoic, _window$Pelcro$invoic2;
28378
- const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
28403
+ const invoices = (_window$Pelcro$invoic = (_window$Pelcro$invoic2 = window.Pelcro.invoice.list()) === null || _window$Pelcro$invoic2 === void 0 ? void 0 : _window$Pelcro$invoic2.filter(invoice => invoice.order_id || invoice.total > 0)) !== null && _window$Pelcro$invoic !== void 0 ? _window$Pelcro$invoic : [];
28379
28404
  return invoices.length > 0;
28380
28405
  }
28381
28406
  function hasDonationSubs() {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pelcro/react-pelcro-js",
3
3
  "description": "Pelcro's React UI Elements",
4
- "version": "3.22.0-beta.14",
4
+ "version": "3.22.0-beta.16",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "main": "dist/index.cjs.js",