@one-payments/web-components 1.1.30 → 1.1.31
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.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var OnePayments=function(e){"use strict";
|
|
2
2
|
/*!
|
|
3
|
-
* @one-payments/web-components v1.1.
|
|
3
|
+
* @one-payments/web-components v1.1.30
|
|
4
4
|
* Browser CDN Bundle (IIFE)
|
|
5
5
|
*
|
|
6
6
|
* This bundle is designed for direct browser usage via <script> tag.
|
|
@@ -1597,5 +1597,5 @@ var OnePayments=function(e){"use strict";
|
|
|
1597
1597
|
transform: translateX(-50%) translateY(0);
|
|
1598
1598
|
}
|
|
1599
1599
|
}
|
|
1600
|
-
`,gr([ce({type:Object})],yr.prototype,"config",2),gr([ce({type:Object})],yr.prototype,"adapters",2),gr([ce({type:Number})],yr.prototype,"amount",2),gr([ce({type:String})],yr.prototype,"currency",2),gr([ce({type:String})],yr.prototype,"orderId",2),gr([ce({type:String})],yr.prototype,"firstName",2),gr([ce({type:String})],yr.prototype,"lastName",2),gr([ce({type:String})],yr.prototype,"email",2),gr([ce({type:Array})],yr.prototype,"excludePaymentMethods",2),gr([ce({type:String})],yr.prototype,"width",2),gr([ce({type:String})],yr.prototype,"maxWidth",2),gr([he()],yr.prototype,"currentState",2),gr([he()],yr.prototype,"selectedMethod",2),gr([he()],yr.prototype,"cardFormData",2),gr([he()],yr.prototype,"formErrors",2),gr([he()],yr.prototype,"paymentData",2),gr([he()],yr.prototype,"feesExpanded",2),gr([he()],yr.prototype,"isInitializing",2),gr([he()],yr.prototype,"cardBrand",2),gr([he()],yr.prototype,"paymentLocked",2),gr([he()],yr.prototype,"show3DSModal",2),gr([he()],yr.prototype,"showQRModal",2),gr([he()],yr.prototype,"nextActionUrl",2),gr([he()],yr.prototype,"qrCode",2),gr([he()],yr.prototype,"qrCodeDataUrl",2),gr([he()],yr.prototype,"qrAutoResumeTimer",2),gr([he()],yr.prototype,"qrPollingInProgress",2),yr=gr([(e=>(t,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)})("one-payment")],yr);class br{async get(e,t){const r=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json",...t}});if(!r.ok){const e=await vr(r);throw new Error(e)}return await r.json()}async post(e,t,r){const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(t)});if(!n.ok){const e=await vr(n);throw new Error(e)}return await n.json()}async put(e,t,r){const n=await fetch(e,{method:"PUT",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(t)});if(!n.ok){const e=await vr(n);throw new Error(e)}return await n.json()}async patch(e,t,r){const n=await fetch(e,{method:"PATCH",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(t)});if(!n.ok){const e=await vr(n);throw new Error(e)}return await n.json()}async delete(e,t){const r=await fetch(e,{method:"DELETE",headers:{"Content-Type":"application/json",...t}});if(!r.ok){const e=await vr(r);throw new Error(e)}return await r.json()}}class wr{constructor(e="one-payments:"){this.prefix=e}async get(e){return localStorage.getItem(this.prefix+e)}async set(e,t){localStorage.setItem(this.prefix+e,t)}async remove(e){localStorage.removeItem(this.prefix+e)}async clear(){Object.keys(localStorage).forEach(e=>{e.startsWith(this.prefix)&&localStorage.removeItem(e)})}}class xr{async sha256(e){const t="string"==typeof e?(new TextEncoder).encode(e):e,r=await crypto.subtle.digest("SHA-256",t);return this.bufferToHex(r)}async hmacSHA256(e,t){const r=new TextEncoder,n=r.encode(e),i=r.encode(t),o=await crypto.subtle.importKey("raw",n,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),s=await crypto.subtle.sign("HMAC",o,i);return this.bufferToHex(s)}uuid(){return crypto.randomUUID()}randomBytes(e){return crypto.getRandomValues(new Uint8Array(e))}bufferToHex(e){return Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,"0")).join("")}}class kr{now(){return Date.now()}async delay(e){return new Promise(t=>{setTimeout(t,e)})}}function Sr(){return{http:new br,storage:new wr,crypto:new xr,timer:new kr}}const Er="one-payment",Pr="1.1.
|
|
1600
|
+
`,gr([ce({type:Object})],yr.prototype,"config",2),gr([ce({type:Object})],yr.prototype,"adapters",2),gr([ce({type:Number})],yr.prototype,"amount",2),gr([ce({type:String})],yr.prototype,"currency",2),gr([ce({type:String})],yr.prototype,"orderId",2),gr([ce({type:String})],yr.prototype,"firstName",2),gr([ce({type:String})],yr.prototype,"lastName",2),gr([ce({type:String})],yr.prototype,"email",2),gr([ce({type:Array})],yr.prototype,"excludePaymentMethods",2),gr([ce({type:String})],yr.prototype,"width",2),gr([ce({type:String})],yr.prototype,"maxWidth",2),gr([he()],yr.prototype,"currentState",2),gr([he()],yr.prototype,"selectedMethod",2),gr([he()],yr.prototype,"cardFormData",2),gr([he()],yr.prototype,"formErrors",2),gr([he()],yr.prototype,"paymentData",2),gr([he()],yr.prototype,"feesExpanded",2),gr([he()],yr.prototype,"isInitializing",2),gr([he()],yr.prototype,"cardBrand",2),gr([he()],yr.prototype,"paymentLocked",2),gr([he()],yr.prototype,"show3DSModal",2),gr([he()],yr.prototype,"showQRModal",2),gr([he()],yr.prototype,"nextActionUrl",2),gr([he()],yr.prototype,"qrCode",2),gr([he()],yr.prototype,"qrCodeDataUrl",2),gr([he()],yr.prototype,"qrAutoResumeTimer",2),gr([he()],yr.prototype,"qrPollingInProgress",2),yr=gr([(e=>(t,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)})("one-payment")],yr);class br{async get(e,t){const r=await fetch(e,{method:"GET",headers:{"Content-Type":"application/json",...t}});if(!r.ok){const e=await vr(r);throw new Error(e)}return await r.json()}async post(e,t,r){const n=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(t)});if(!n.ok){const e=await vr(n);throw new Error(e)}return await n.json()}async put(e,t,r){const n=await fetch(e,{method:"PUT",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(t)});if(!n.ok){const e=await vr(n);throw new Error(e)}return await n.json()}async patch(e,t,r){const n=await fetch(e,{method:"PATCH",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(t)});if(!n.ok){const e=await vr(n);throw new Error(e)}return await n.json()}async delete(e,t){const r=await fetch(e,{method:"DELETE",headers:{"Content-Type":"application/json",...t}});if(!r.ok){const e=await vr(r);throw new Error(e)}return await r.json()}}class wr{constructor(e="one-payments:"){this.prefix=e}async get(e){return localStorage.getItem(this.prefix+e)}async set(e,t){localStorage.setItem(this.prefix+e,t)}async remove(e){localStorage.removeItem(this.prefix+e)}async clear(){Object.keys(localStorage).forEach(e=>{e.startsWith(this.prefix)&&localStorage.removeItem(e)})}}class xr{async sha256(e){const t="string"==typeof e?(new TextEncoder).encode(e):e,r=await crypto.subtle.digest("SHA-256",t);return this.bufferToHex(r)}async hmacSHA256(e,t){const r=new TextEncoder,n=r.encode(e),i=r.encode(t),o=await crypto.subtle.importKey("raw",n,{name:"HMAC",hash:"SHA-256"},!1,["sign"]),s=await crypto.subtle.sign("HMAC",o,i);return this.bufferToHex(s)}uuid(){return crypto.randomUUID()}randomBytes(e){return crypto.getRandomValues(new Uint8Array(e))}bufferToHex(e){return Array.from(new Uint8Array(e)).map(e=>e.toString(16).padStart(2,"0")).join("")}}class kr{now(){return Date.now()}async delay(e){return new Promise(t=>{setTimeout(t,e)})}}function Sr(){return{http:new br,storage:new wr,crypto:new xr,timer:new kr}}const Er="one-payment",Pr="1.1.30";!function(){if("undefined"==typeof customElements)return console.error("[OnePayments] customElements API is not available in this environment. This bundle is designed for browser environments only."),!1;if(customElements.get(Er))return console.info(`[OnePayments] <${Er}> is already registered. Skipping re-registration.`),!0;try{return customElements.define(Er,yr),console.info(`[OnePayments] Registered <${Er}> custom element (v${Pr})`),!0}catch(e){return console.error(`[OnePayments] Failed to register <${Er}>:`,e),!1}}();const Cr={createWebAdapters:Sr,TAG_NAME:Er,VERSION:Pr,isRegistered:()=>"undefined"!=typeof customElements&&void 0!==customElements.get(Er),whenDefined:()=>"undefined"==typeof customElements?Promise.reject(new Error("customElements API is not available")):customElements.whenDefined(Er)};return"undefined"!=typeof window&&(window.OnePayments?console.warn("[OnePayments] window.OnePayments already exists. The bundle may have been loaded multiple times. Using existing reference."):window.OnePayments=Cr),e.OnePayments=Cr,e.TAG_NAME=Er,e.VERSION=Pr,e.createWebAdapters=Sr,e.default=Cr,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),e}({});
|
|
1601
1601
|
//# sourceMappingURL=one-payment.browser.iife.js.map
|