htech-pay 1.0.3 → 1.0.4
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/README.md +1 -1
- package/dist/htechPay.mjs +9 -11
- package/dist/htechPay.umd.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/htechPay.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/*! HtechPay | MIT License */
|
|
2
|
-
async function
|
|
2
|
+
async function f(c, h = {}) {
|
|
3
3
|
const {
|
|
4
|
-
environment:
|
|
5
|
-
isPaymentWithToken:
|
|
4
|
+
environment: d = "qa",
|
|
5
|
+
isPaymentWithToken: i = !1,
|
|
6
6
|
onViewForm: n,
|
|
7
7
|
onPaymentResult: a,
|
|
8
|
-
theme:
|
|
9
|
-
} = h,
|
|
8
|
+
theme: u = ""
|
|
9
|
+
} = h, l = `${{
|
|
10
10
|
qa: "https://sp-checkout-qa.pagoshtechstage.com/index.html",
|
|
11
11
|
stage: "https://sp-checkout-stage.pagoshtechstage.com/index.html",
|
|
12
12
|
prod: ""
|
|
13
|
-
}[
|
|
14
|
-
e.src =
|
|
13
|
+
}[d]}?orderId=${c}&theme=${u}${i ? "#/paymentToken" : ""}`, e = document.createElement("iframe");
|
|
14
|
+
e.src = l, e.width = "100%", e.height = "635", e.frameBorder = "0", e.allowFullscreen = !0, e.title = "Payment form";
|
|
15
15
|
const r = {
|
|
16
16
|
onViewForm: () => n == null ? void 0 : n(!0),
|
|
17
17
|
onPaymentResult: (t) => a == null ? void 0 : a(t.data.payload || {})
|
|
@@ -24,9 +24,7 @@ async function g(c, h = {}) {
|
|
|
24
24
|
mount: (t) => {
|
|
25
25
|
const o = typeof t == "string" ? document.querySelector(t) : t;
|
|
26
26
|
if (!o)
|
|
27
|
-
throw new Error(
|
|
28
|
-
"No se encontró el contenedor para montar el formulario"
|
|
29
|
-
);
|
|
27
|
+
throw new Error("The container to mount the form could not be found");
|
|
30
28
|
o.appendChild(e);
|
|
31
29
|
},
|
|
32
30
|
destroy: () => {
|
|
@@ -35,5 +33,5 @@ async function g(c, h = {}) {
|
|
|
35
33
|
};
|
|
36
34
|
}
|
|
37
35
|
export {
|
|
38
|
-
|
|
36
|
+
f as htechPay
|
|
39
37
|
};
|
package/dist/htechPay.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n,s){typeof exports=="object"&&typeof module<"u"?s(exports):typeof define=="function"&&define.amd?define(["exports"],s):(n=typeof globalThis<"u"?globalThis:n||self,s(n.HtechPay={}))})(this,function(n){"use strict";/*! HtechPay | MIT License */async function s(h,m={}){const{environment:u="qa",isPaymentWithToken:f=!1,onViewForm:a,onPaymentResult:r,theme:l=""}=m,p=`${{qa:"https://sp-checkout-qa.pagoshtechstage.com/index.html",stage:"https://sp-checkout-stage.pagoshtechstage.com/index.html",prod:""}[u]}?orderId=${h}&theme=${l}${f?"#/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:()=>a==null?void 0:a(!0),onPaymentResult:t=>r==null?void 0:r(t.data.payload||{})},d=t=>{var c;const o=(c=t.data)==null?void 0:c.hook;!o||!i[o]||i[o](t.data)};return window.addEventListener("message",d),{mount:t=>{const o=typeof t=="string"?document.querySelector(t):t;if(!o)throw new Error("
|
|
1
|
+
(function(n,s){typeof exports=="object"&&typeof module<"u"?s(exports):typeof define=="function"&&define.amd?define(["exports"],s):(n=typeof globalThis<"u"?globalThis:n||self,s(n.HtechPay={}))})(this,function(n){"use strict";/*! HtechPay | MIT License */async function s(h,m={}){const{environment:u="qa",isPaymentWithToken:f=!1,onViewForm:a,onPaymentResult:r,theme:l=""}=m,p=`${{qa:"https://sp-checkout-qa.pagoshtechstage.com/index.html",stage:"https://sp-checkout-stage.pagoshtechstage.com/index.html",prod:""}[u]}?orderId=${h}&theme=${l}${f?"#/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:()=>a==null?void 0:a(!0),onPaymentResult:t=>r==null?void 0:r(t.data.payload||{})},d=t=>{var c;const o=(c=t.data)==null?void 0:c.hook;!o||!i[o]||i[o](t.data)};return window.addEventListener("message",d),{mount:t=>{const o=typeof t=="string"?document.querySelector(t):t;if(!o)throw new Error("The container to mount the form could not be found");o.appendChild(e)},destroy:()=>{window.removeEventListener("message",d),e.remove()}}}n.htechPay=s,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})});
|