@odus/checkout 0.1.0 → 0.1.2

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.
@@ -1,4 +1,4 @@
1
- const L = (n) => n === "test" ? "https://sandbox-api.odus.com" : n === "live" ? "https://api.odus.com" : "http://localhost:3000", D = ({ name: n }) => {
1
+ const M = (n) => n === "test" ? "https://sandbox-api.odus.com" : n === "live" ? "https://api.odus.com" : "http://localhost:3000", D = ({ name: n }) => {
2
2
  const [e, ...t] = n?.split(" ") || [], [i] = t.reverse();
3
3
  return { firstName: e, lastName: i };
4
4
  };
@@ -7,7 +7,7 @@ class V {
7
7
  baseUrl;
8
8
  browserInfo;
9
9
  constructor(e, t, i) {
10
- this.apiKey = e, this.baseUrl = L(t), this.browserInfo = i || { userAgent: navigator.userAgent };
10
+ this.apiKey = e, this.baseUrl = M(t), this.browserInfo = i || { userAgent: navigator.userAgent };
11
11
  }
12
12
  async fetchApi({
13
13
  endpoint: e,
@@ -105,7 +105,7 @@ const A = async ({
105
105
  apiKey: e,
106
106
  environment: t
107
107
  }) => {
108
- const i = L(t), a = await fetch(`${i}/checkout-profiles/${n}`, {
108
+ const i = M(t), a = await fetch(`${i}/checkout-profiles/${n}`, {
109
109
  method: "GET",
110
110
  headers: {
111
111
  "Content-Type": "application/json",
@@ -358,7 +358,7 @@ const T = {
358
358
  }
359
359
  return t;
360
360
  }, U = () => {
361
- const { t: n } = M();
361
+ const { t: n } = L();
362
362
  return {
363
363
  validateEmail: (t) => {
364
364
  const i = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
@@ -419,7 +419,7 @@ const T = {
419
419
  }
420
420
  };
421
421
  }, q = () => {
422
- const { t: n } = M(), { validateEmail: e } = U();
422
+ const { t: n } = L(), { validateEmail: e } = U();
423
423
  return {
424
424
  email: (t) => {
425
425
  const i = e(t);
@@ -515,7 +515,7 @@ const T = {
515
515
  apiKey: e,
516
516
  environment: t
517
517
  }) => {
518
- const i = L(t), a = await fetch(
518
+ const i = M(t), a = await fetch(
519
519
  `${i}/tokenization/generate-iframe-configuration`,
520
520
  {
521
521
  method: "POST",
@@ -669,13 +669,13 @@ const Y = "E-Mail", J = "Name des/der Karteninhaber/in", W = "Kartendaten", X =
669
669
  loading: ve,
670
670
  buttonTexts: Ee,
671
671
  validation: be
672
- }, Se = "E-mail", xe = "Nom du titulaire de la carte", Fe = "Informations de la carte", we = "Nom complet figurant sur la carte", Le = "MM / AA", Me = "Veuillez ne pas fermer cette fenêtre", ke = { pay: "PAYER", submit: "ENVOYER", getPlan: "OBTENIR MON PLAN", donate: "FAIRE UN DON", book: "RÉSERVER MAINTENANT", order: "COMMANDER MAINTENANT" }, Te = { emailSuggestion: "Vouliez-vous dire {{email}}?", emailInvalid: "Votre adresse e-mail n’est pas valide", cardExpiryInvalid: "La date d'expiration de votre carte est dans le passé", cardExpiryFormat: "La date d’expiration de votre carte est incomplète", cardSecurityFormat: "Le code de sécurité de votre carte est incomplet", nameRequired: "Veuillez saisir le nom tel qu’il figure sur votre carte", cardNumberInvalid: "Votre numéro de carte est invalide" }, Ie = {
672
+ }, Se = "E-mail", xe = "Nom du titulaire de la carte", Fe = "Informations de la carte", we = "Nom complet figurant sur la carte", Me = "MM / AA", Le = "Veuillez ne pas fermer cette fenêtre", ke = { pay: "PAYER", submit: "ENVOYER", getPlan: "OBTENIR MON PLAN", donate: "FAIRE UN DON", book: "RÉSERVER MAINTENANT", order: "COMMANDER MAINTENANT" }, Te = { emailSuggestion: "Vouliez-vous dire {{email}}?", emailInvalid: "Votre adresse e-mail n’est pas valide", cardExpiryInvalid: "La date d'expiration de votre carte est dans le passé", cardExpiryFormat: "La date d’expiration de votre carte est incomplète", cardSecurityFormat: "Le code de sécurité de votre carte est incomplet", nameRequired: "Veuillez saisir le nom tel qu’il figure sur votre carte", cardNumberInvalid: "Votre numéro de carte est invalide" }, Ie = {
673
673
  email: Se,
674
674
  cardholderNameLabel: xe,
675
675
  cardInformation: Fe,
676
676
  cardholderNamePlaceholder: we,
677
- cardExpiry: Le,
678
- loading: Me,
677
+ cardExpiry: Me,
678
+ loading: Le,
679
679
  buttonTexts: ke,
680
680
  validation: Te
681
681
  }, ze = "Adres e-mail", Ne = "Imię i nazwisko posiadacza karty", Pe = "Informacje o karcie", De = "Imię i nazwisko na karcie", Ve = "MM / RR", Ae = "Proszę nie zamykać tego okna", $e = { pay: "ZAPŁAĆ", submit: "WYŚLIJ", getPlan: "POBIERZ MÓJ PLAN", donate: "PRZEKAŻ DAROWIZNĘ", book: "ZAREZERWUJ TERAZ", order: "ZAMÓW TERAZ" }, Re = { emailSuggestion: "Czy chodziło Ci o {{email}}?", emailInvalid: "Państwa adres e-mail jest nieprawidłowy", cardExpiryInvalid: "Data ważności Państwa karty jest w przeszłości", cardExpiryFormat: "Data ważności Państwa karty jest niekompletna", cardSecurityFormat: "Kod zabezpieczający Państwa karty jest niekompletny", nameRequired: "Proszę wpisać imię i nazwisko tak, jak widnieje na karcie", cardNumberInvalid: "Numer Państwa karty jest nieprawidłowy" }, Be = {
@@ -764,7 +764,7 @@ function We(n) {
764
764
  subscribe: a.subscribe.bind(a)
765
765
  };
766
766
  }
767
- const Xe = We(), M = () => {
767
+ const Xe = We(), L = () => {
768
768
  const { translate: n, getLocale: e, setLocale: t, subscribe: i } = Xe;
769
769
  return {
770
770
  t: n,
@@ -1525,21 +1525,21 @@ class ft extends d {
1525
1525
  }
1526
1526
  }
1527
1527
  class gt extends d {
1528
- paymentMethods = /* @__PURE__ */ new Map();
1528
+ paymentMethods;
1529
1529
  constructor(e) {
1530
1530
  const { checkoutProfile: t, formData: i, onPaypalSubmit: a } = e;
1531
1531
  if (!t?.additionalPaymentMethods) {
1532
- super("div", ["payment-methods"]), this.getElement().style.display = "none";
1532
+ super("div", ["payment-methods"]), this.paymentMethods = /* @__PURE__ */ new Map(), this.getElement().style.display = "none";
1533
1533
  return;
1534
1534
  }
1535
1535
  const s = Object.entries(
1536
1536
  t.additionalPaymentMethods
1537
1537
  ).filter(([, r]) => r.enabled).sort((r, o) => r[1].order - o[1].order);
1538
1538
  if (s.length === 0) {
1539
- super("div", ["payment-methods"]), this.getElement().style.display = "none";
1539
+ super("div", ["payment-methods"]), this.paymentMethods = /* @__PURE__ */ new Map(), this.getElement().style.display = "none";
1540
1540
  return;
1541
1541
  }
1542
- super("div", ["payment-methods"]);
1542
+ super("div", ["payment-methods"]), this.paymentMethods = /* @__PURE__ */ new Map();
1543
1543
  for (const [r] of s)
1544
1544
  switch (r) {
1545
1545
  case "paypal": {
@@ -1635,7 +1635,7 @@ class St extends d {
1635
1635
  // factories
1636
1636
  formManager = _();
1637
1637
  checkoutProfile;
1638
- translation = M();
1638
+ translation = L();
1639
1639
  iframeHook;
1640
1640
  constructor(e) {
1641
1641
  super("form", ["form-container"]), this.options = e, this.checkoutProfile = O({
@@ -2071,4 +2071,4 @@ export {
2071
2071
  Be as plLocale,
2072
2072
  Ze as ptLocale
2073
2073
  };
2074
- //# sourceMappingURL=index.mjs.map
2074
+ //# sourceMappingURL=checkout.es.js.map