htech-pay 0.0.16-alpha → 0.0.18-alpha

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/htechPay.mjs CHANGED
@@ -1,24 +1,24 @@
1
1
  /*! HtechPay SDK v0.0.12 | MIT License */
2
- async function p(i, m = {}) {
2
+ async function g(c, d = {}) {
3
3
  const {
4
- environment: l = "qa",
5
- isPaymentWithToken: c = !1,
4
+ environment: i = "qa",
5
+ isPaymentWithToken: h = !1,
6
6
  onViewForm: n,
7
- onPaymentResult: r,
8
- theme: u
9
- } = m, h = `${{
10
- qa: "https://d2zrptqqy5dqev.cloudfront.net/index.html",
11
- stage: "",
7
+ onPaymentResult: a,
8
+ theme: l = ""
9
+ } = d, u = `${{
10
+ qa: "https://sp-checkout-qa.pagoshtechstage.com/index.html",
11
+ stage: "https://sp-checkout-stage.pagoshtechstage.com/index.html",
12
12
  prod: ""
13
- }[l]}?orderId=${i}&theme=${u}${c ? "#/paymentToken" : ""}`, e = document.createElement("iframe");
14
- e.src = h, e.width = "100%", e.height = "800", e.frameBorder = "0", e.allowFullscreen = !0, e.title = "Carta de pago";
15
- const a = {
13
+ }[i]}?orderId=${c}&theme=${l}${h ? "#/paymentToken" : ""}`, e = document.createElement("iframe");
14
+ e.src = u, e.width = "100%", e.height = "635", e.frameBorder = "0", e.allowFullscreen = !0, e.title = "Payment form";
15
+ const r = {
16
16
  onViewForm: () => n == null ? void 0 : n(!0),
17
- onPaymentResult: (t) => r == null ? void 0 : r(t.data.payload || {})
17
+ onPaymentResult: (t) => a == null ? void 0 : a(t.data.payload || {})
18
18
  }, s = (t) => {
19
- var d;
20
- const o = (d = t.data) == null ? void 0 : d.hook;
21
- !o || !a[o] || a[o](t.data);
19
+ var m;
20
+ const o = (m = t.data) == null ? void 0 : m.hook;
21
+ !o || !r[o] || r[o](t.data);
22
22
  };
23
23
  return window.addEventListener("message", s), {
24
24
  mount: (t) => {
@@ -35,5 +35,5 @@ async function p(i, m = {}) {
35
35
  };
36
36
  }
37
37
  export {
38
- p as loadForm
38
+ g as loadHtechPay
39
39
  };
@@ -1 +1 @@
1
- (function(n,r){typeof exports=="object"&&typeof module<"u"?r(exports):typeof define=="function"&&define.amd?define(["exports"],r):(n=typeof globalThis<"u"?globalThis:n||self,r(n.HtechPay={}))})(this,function(n){"use strict";/*! HtechPay SDK v0.0.12 | MIT License */async function r(u,l={}){const{environment:f="qa",isPaymentWithToken:c=!1,onViewForm:a,onPaymentResult:d,theme:h}=l,p=`${{qa:"https://d2zrptqqy5dqev.cloudfront.net/index.html",stage:"",prod:""}[f]}?orderId=${u}&theme=${h}${c?"#/paymentToken":""}`,e=document.createElement("iframe");e.src=p,e.width="100%",e.height="800",e.frameBorder="0",e.allowFullscreen=!0,e.title="Carta de pago";const i={onViewForm:()=>a==null?void 0:a(!0),onPaymentResult:t=>d==null?void 0:d(t.data.payload||{})},s=t=>{var m;const o=(m=t.data)==null?void 0:m.hook;!o||!i[o]||i[o](t.data)};return window.addEventListener("message",s),{mount:t=>{const o=typeof t=="string"?document.querySelector(t):t;if(!o)throw new Error("No se encontró el contenedor para montar el formulario");o.appendChild(e)},destroy:()=>{window.removeEventListener("message",s),e.remove()}}}n.loadForm=r,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
1
+ (function(o,a){typeof exports=="object"&&typeof module<"u"?a(exports):typeof define=="function"&&define.amd?define(["exports"],a):(o=typeof globalThis<"u"?globalThis:o||self,a(o.HtechPay={}))})(this,function(o){"use strict";/*! HtechPay SDK v0.0.12 | MIT License */async function a(m,h={}){const{environment:u="qa",isPaymentWithToken:l=!1,onViewForm:s,onPaymentResult:r,theme:f=""}=h,p=`${{qa:"https://sp-checkout-qa.pagoshtechstage.com/index.html",stage:"https://sp-checkout-stage.pagoshtechstage.com/index.html",prod:""}[u]}?orderId=${m}&theme=${f}${l?"#/paymentToken":""}`,e=document.createElement("iframe");e.src=p,e.width="100%",e.height="635",e.frameBorder="0",e.allowFullscreen=!0,e.title="Payment form";const i={onViewForm:()=>s==null?void 0:s(!0),onPaymentResult:t=>r==null?void 0:r(t.data.payload||{})},d=t=>{var c;const n=(c=t.data)==null?void 0:c.hook;!n||!i[n]||i[n](t.data)};return window.addEventListener("message",d),{mount:t=>{const n=typeof t=="string"?document.querySelector(t):t;if(!n)throw new Error("No se encontró el contenedor para montar el formulario");n.appendChild(e)},destroy:()=>{window.removeEventListener("message",d),e.remove()}}}o.loadHtechPay=a,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "htech-pay",
3
3
  "private": false,
4
- "version": "0.0.16-alpha",
4
+ "version": "0.0.18-alpha",
5
5
  "description": "Payment SDK for HtechPay",
6
6
  "main": "dist/htechPay.umd.js",
7
7
  "module": "dist/htechPay.mjs",
@@ -37,6 +37,7 @@
37
37
  "@vitejs/plugin-react": "^4.3.1",
38
38
  "react": "^18.3.1",
39
39
  "react-dom": "^18.3.1",
40
- "vite": "^5.4.1"
40
+ "vite": "^5.4.1",
41
+ "htech-pay": "^0.0.16-alpha"
41
42
  }
42
43
  }