@paynext/sdk 0.0.132 → 0.0.134

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.es.js CHANGED
@@ -5792,7 +5792,7 @@ class G1 {
5792
5792
  status_reason: {
5793
5793
  advice_code: null,
5794
5794
  decline_code: null,
5795
- message: `${c}: ${a.message || a}}`
5795
+ message: `${c}: ${this.stringifyError(a)}`
5796
5796
  }
5797
5797
  });
5798
5798
  }
@@ -5840,6 +5840,17 @@ class G1 {
5840
5840
  setLoading(e) {
5841
5841
  this.isLoading = e, this.form.setLoading(e), this.loader.setClassName(!e || this.isFormOpen ? Qe.hidden : "");
5842
5842
  }
5843
+ // stringifies any kind of error into a readable message
5844
+ stringifyError(e) {
5845
+ if (!e) return "Unknown error";
5846
+ if (typeof e == "string") return e;
5847
+ if (e instanceof Error) return e.message || e.name;
5848
+ try {
5849
+ return JSON.stringify(e);
5850
+ } catch (n) {
5851
+ return String(e);
5852
+ }
5853
+ }
5843
5854
  // render
5844
5855
  render() {
5845
5856
  return this.checkout;
@@ -25498,7 +25509,7 @@ class Q5 {
25498
25509
  const C = new Error("Client token is required");
25499
25510
  throw C.name = "INVALID_SESSION", C;
25500
25511
  }
25501
- this.config.service.ev.preloadEvervault({ teamId: f, appId: p });
25512
+ this.config.service.ev.preloadEvervault({ teamId: f, appId: p }).finally();
25502
25513
  const v = yield n.updateTransaction(o, a, s);
25503
25514
  if (v != null && v.error) {
25504
25515
  const C = new Error("INVALID_SESSION");