@rebilly/instruments 8.42.0 → 8.42.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [8.42.1](https://github.com/Rebilly/rebilly/compare/instruments/core-v8.42.0...instruments/core-v8.42.1) (2024-02-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **instrument:** Prevent payment for completed transaction ([#3310](https://github.com/Rebilly/rebilly/issues/3310)) ([cd331c5](https://github.com/Rebilly/rebilly/commit/cd331c53199a06a4182ecbd31865e0d7ef8e4afe))
7
+
1
8
  ## [8.42.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v8.41.1...instruments/core-v8.42.0) (2024-02-05)
2
9
 
3
10
 
package/dist/index.js CHANGED
@@ -1481,7 +1481,8 @@ const en = {
1481
1481
  invoiceIsPaid: "The invoice has been fully paid.",
1482
1482
  invoiceIsVoid: "The invoice has been voided.",
1483
1483
  invoiceIsAbandoned: "The invoice has been abandoned.",
1484
- invoiceIsRefunded: "The invoice has been refunded."
1484
+ invoiceIsRefunded: "The invoice has been refunded.",
1485
+ transactionIsCompleted: "This transaction cannot be updated."
1485
1486
  },
1486
1487
  loaderMessages: {
1487
1488
  processingPayment: "Processing payment instrument."
@@ -1520,7 +1521,8 @@ const es = {
1520
1521
  invoiceIsPaid: "La factura ha sido completamente pagada.",
1521
1522
  invoiceIsVoid: "La factura ha sido anulada.",
1522
1523
  invoiceIsAbandoned: "La factura ha sido abandonada.",
1523
- invoiceIsRefunded: "La factura ha reembolsada."
1524
+ invoiceIsRefunded: "La factura ha reembolsada.",
1525
+ transactionIsCompleted: "La transacción no pudo ser actualizada."
1524
1526
  },
1525
1527
  loaderMessages: {
1526
1528
  processingPayment: "Procesamiento de instrumento de pago."
@@ -5994,7 +5996,7 @@ function cloneArrayDeep(val, instanceClone) {
5994
5996
  return res;
5995
5997
  }
5996
5998
  var cloneDeep_1 = cloneDeep;
5997
- const version = "55.16.0";
5999
+ const version = "55.17.0";
5998
6000
  let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
5999
6001
  let nanoid = (size2 = 21) => {
6000
6002
  let id2 = "";
@@ -14234,7 +14236,7 @@ async function fetchInvoiceAndProducts({
14234
14236
  };
14235
14237
  });
14236
14238
  }
14237
- class TransactionModel extends BaseModel {
14239
+ const _TransactionModel = class _TransactionModel2 extends BaseModel {
14238
14240
  constructor({ invoiceIds = [], ...fields }) {
14239
14241
  super(fields);
14240
14242
  this.invoiceIds = invoiceIds || [];
@@ -14245,7 +14247,14 @@ class TransactionModel extends BaseModel {
14245
14247
  get hasInvoice() {
14246
14248
  return Boolean(this.invoiceId);
14247
14249
  }
14248
- }
14250
+ get transactionIsCompleted() {
14251
+ return this.status === _TransactionModel2.Status.completed;
14252
+ }
14253
+ };
14254
+ _TransactionModel.Status = {
14255
+ completed: "completed"
14256
+ };
14257
+ let TransactionModel = _TransactionModel;
14249
14258
  async function fetchTransaction({
14250
14259
  data = null
14251
14260
  }) {
@@ -23435,7 +23444,7 @@ function handleComputedProperty(options) {
23435
23444
  var _a;
23436
23445
  return Object.assign({}, options, {
23437
23446
  _computed: {
23438
- version: "8.41.1",
23447
+ version: "8.42.0",
23439
23448
  paymentMethodsUrl: ((_a = options._dev) == null ? void 0 : _a.paymentMethodsUrl) ?? "https://forms.secure-payments.app"
23440
23449
  }
23441
23450
  });
@@ -26635,7 +26644,7 @@ async function mount({
26635
26644
  setupFramepay: setupFramepay$1 = setupFramepay,
26636
26645
  ...options
26637
26646
  } = {}) {
26638
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
26647
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
26639
26648
  try {
26640
26649
  state.data = {};
26641
26650
  state.options = {};
@@ -26696,11 +26705,15 @@ async function mount({
26696
26705
  } else if (invoiceId && ((_j = state.data.invoice) == null ? void 0 : _j.isRefunded)) {
26697
26706
  clearFormOnError("form.error.invoiceIsRefunded");
26698
26707
  }
26708
+ const transactionId = ((_k = state.options) == null ? void 0 : _k.transactionId) || ((_m = (_l = state.data) == null ? void 0 : _l.transaction) == null ? void 0 : _m.id);
26709
+ if (transactionId && ((_o = (_n = state.data) == null ? void 0 : _n.transaction) == null ? void 0 : _o.transactionIsCompleted)) {
26710
+ clearFormOnError("form.error.transactionIsCompleted");
26711
+ }
26699
26712
  let hasNoPaymentMethods = false;
26700
26713
  if (data.payout) {
26701
- hasNoPaymentMethods = !((_k = data.readyToPayout) == null ? void 0 : _k.length);
26714
+ hasNoPaymentMethods = !((_p = data.readyToPayout) == null ? void 0 : _p.length);
26702
26715
  } else {
26703
- hasNoPaymentMethods = !((_l = data.readyToPay) == null ? void 0 : _l.length);
26716
+ hasNoPaymentMethods = !((_q = data.readyToPay) == null ? void 0 : _q.length);
26704
26717
  }
26705
26718
  if (hasNoPaymentMethods) {
26706
26719
  state.loader.stopLoading({ id: "rebilly-instruments-form" });
@@ -26771,7 +26784,7 @@ class RebillyInstrumentsInstance {
26771
26784
  await show({ componentName, payload });
26772
26785
  }
26773
26786
  get version() {
26774
- return `RebillyInstruments Ver.${"8.41.1"}`;
26787
+ return `RebillyInstruments Ver.${"8.42.0"}`;
26775
26788
  }
26776
26789
  on(eventName, callback) {
26777
26790
  on({ eventName, callback });