@rebilly/framepay-vue 12.220.0 → 12.220.1
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/CHANGELOG.md +2 -2
- package/dist/framepay-vue.js +6 -4
- package/dist/framepay-vue.umd.cjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/framepay-vue.js
CHANGED
|
@@ -20,10 +20,12 @@ async function p({ scriptLink: e, styleLink: t } = {}) {
|
|
|
20
20
|
return new Promise((n, r) => {
|
|
21
21
|
if (window.Framepay) n(window.Framepay);
|
|
22
22
|
else {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
if (t !== "no-style-script") {
|
|
24
|
+
let e = document.createElement("link");
|
|
25
|
+
e.setAttribute("href", t || f), e.setAttribute("rel", "stylesheet"), document.head.prepend(e);
|
|
26
|
+
}
|
|
27
|
+
let i = document.createElement("script");
|
|
28
|
+
i.setAttribute("src", e || d), i.onload = () => n(window.Framepay), i.onerror = () => r(/* @__PURE__ */ Error("@rebilly/framepay npm package: Failed to load FramePay script")), document.head.append(i);
|
|
27
29
|
}
|
|
28
30
|
});
|
|
29
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("vue")):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.FramePayVue={},e.Vue))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});function n({message:e=`Could not mount FramePay to element.`,details:t=null}={}){this.message=e,this.details=t,this.name=`FramePayMountError`}function r({message:e=`FramePay could not be initialized.`,details:t=null}={}){this.message=e,this.details=t,this.name=`FramePayInitializeError`}function i({message:e=`FramePay could not be loaded.`,details:t=null}={}){this.message=e,this.details=t,this.name=`FramePayLoadError`}var a=window.process?.env?.FRAMEPAY_SCRIPT_LINK;window.process?.env?.FRAMEPAY_STYLE_LINK;var o=`https://framepay.rebilly.com/framepay.js`,s=`https://framepay.rebilly.com/framepay.css`;async function c({scriptLink:e,styleLink:t}={}){return new Promise((n,r)=>{if(window.Framepay)n(window.Framepay);else{let
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("vue")):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.FramePayVue={},e.Vue))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});function n({message:e=`Could not mount FramePay to element.`,details:t=null}={}){this.message=e,this.details=t,this.name=`FramePayMountError`}function r({message:e=`FramePay could not be initialized.`,details:t=null}={}){this.message=e,this.details=t,this.name=`FramePayInitializeError`}function i({message:e=`FramePay could not be loaded.`,details:t=null}={}){this.message=e,this.details=t,this.name=`FramePayLoadError`}var a=window.process?.env?.FRAMEPAY_SCRIPT_LINK;window.process?.env?.FRAMEPAY_STYLE_LINK;var o=`https://framepay.rebilly.com/framepay.js`,s=`https://framepay.rebilly.com/framepay.css`;async function c({scriptLink:e,styleLink:t}={}){return new Promise((n,r)=>{if(window.Framepay)n(window.Framepay);else{if(t!==`no-style-script`){let e=document.createElement(`link`);e.setAttribute(`href`,t||s),e.setAttribute(`rel`,`stylesheet`),document.head.prepend(e)}let i=document.createElement(`script`);i.setAttribute(`src`,e||o),i.onload=()=>n(window.Framepay),i.onerror=()=>r(Error(`@rebilly/framepay npm package: Failed to load FramePay script`)),document.head.append(i)}})}var l=()=>c({scriptLink:a}).catch(e=>{throw new i({details:e})}),u,d=new Promise(e=>{u=e}),f=u,p=d.then(l);function m(e={}){return p.then(t=>new Promise((n,i)=>{let a=!1;t.on(`ready`,()=>{n(t)}),t.on(`error`,e=>{a=!0,i(new r({details:e}))});try{!a&&!t.initialized&&(e.publishableKey||e.jwt)&&t.initialize(e).catch(e=>{i(new r({details:e}))})}catch(e){throw new r({details:e})}}))}var h={REBILLY_CARD:`card`,REBILLY_CARD_CVV:`cardCvv`,REBILLY_CARD_NUMBER:`cardNumber`,REBILLY_CARD_EXPIRATION:`cardExpiration`,REBILLY_BBAN_ACCOUNT_TYPE:`accountType`,REBILLY_BBAN_ROUTING_NUMBER:`routingNumber`,REBILLY_BBAN_ACCOUNT_NUMBER:`accountNumber`,REBILLY_IBAN:`iban`,REBILLY_GOOGLE_PAY:`googlePay`,REBILLY_APPLE_PAY:`applePay`,REBILLY_PAYPAL:`paypal`};function g(e,t){return p.then(n=>{if(!n.initialized)throw new r({message:`Please initialize Framepay before creating a token`});return n.createToken(e,t)})}function _(e){return m(e).then(t=>{t.update({...e})})}var v=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},y={name:`RebillyForm`,props:{extraData:{type:Object,default:()=>({})},configuration:{type:Object,default:()=>({})}},emits:[`submit`,`error`],watch:{configuration(e){e&&_(e)}},mounted(){_(this.configuration)},methods:{handler(e){let t=e.target;g(t,this.extraData).then(e=>{this.$attrs.onSubmit?this.$emit(`submit`,e,t):t.submit()}).catch(e=>{this.$emit(`error`,e)})}}},b={id:`stop-wrapper`};function x(e,n,r,i,a,o){return(0,t.openBlock)(),(0,t.createElementBlock)(`div`,b,[(0,t.createElementVNode)(`form`,{id:`rebilly-form`,onSubmit:n[0]||=(0,t.withModifiers)((...e)=>o.handler&&o.handler(...e),[`stop`,`prevent`])},[(0,t.renderSlot)(e.$slots,`default`)],32)])}var S=v(y,[[`render`,x]]),C={name:`RebillyToken`},w={id:`rebilly-token`,"data-rebilly":`token`,type:`hidden`};function T(e,n,r,i,a,o){return(0,t.openBlock)(),(0,t.createElementBlock)(`input`,w)}var E=v(C,[[`render`,T]]),D={render(){return(0,t.h)(`div`,{id:this.mountId,domProps:{id:this.mountId}})},props:{id:{type:String},configuration:{}},data(){return{element:null,mountId:this.id?this.id:`${this.$options.name}-mount`}},methods:{mountElement(e){m(this.configuration).then(r=>{try{this.elementType.startsWith(`card`)?this.element=(0,t.markRaw)(r.card.mount(e,this.elementType)):this.elementType===`iban`?this.element=(0,t.markRaw)(r.iban.mount(e)):[h.REBILLY_BBAN_ACCOUNT_TYPE,h.REBILLY_BBAN_ACCOUNT_NUMBER,h.REBILLY_BBAN_ROUTING_NUMBER].includes(this.elementType)&&(this.element=(0,t.markRaw)(r.bban.mount(e,this.elementType))),this.element.on(`ready`,()=>this.$emit(`ready`)),this.element.on(`change`,e=>this.$emit(`change`,e)),this.element.on(`focus`,()=>this.$emit(`focus`)),this.element.on(`blur`,()=>this.$emit(`blur`))}catch{throw new n}})},destroyElement(){this.element&&this.element.destroy()}},created(){this.mountElement(`#${this.mountId}`)},beforeDestroy(){this.destroyElement()},beforeUnmount(){this.destroyElement()}},O={render(){return(0,t.h)(`div`,{id:this.mountId,domProps:{id:this.mountId}})},props:{id:{type:String},configuration:{}},data(){return{element:null,mountId:this.id?this.id:`${this.$options.name}-mount`}},methods:{mountElement(e){m(this.configuration).then(r=>{try{this.element=(0,t.markRaw)(r.googlePay.mount(e)),this.element.on(`ready`,()=>this.$emit(`ready`)),this.element.on(`change`,e=>this.$emit(`change`,e)),this.element.on(`focus`,()=>this.$emit(`focus`)),this.element.on(`blur`,()=>this.$emit(`blur`)),this.element.on(`error`,()=>this.$emit(`error`)),r.on(`token-ready`,e=>{this.$emit(`token-ready`,e),this.$parent.$emit(`token-ready`,e)})}catch(e){throw new n({details:e})}})},destroyElement(){this.element&&this.element.destroy()}},watch:{configuration(e){e&&_(e)}},created(){this.mountElement(`#${this.mountId}`)},beforeDestroy(){this.destroyElement()},beforeUnmount(){this.destroyElement()}},k={render(){return(0,t.h)(`div`,{id:this.mountId,domProps:{id:this.mountId}})},props:{id:{type:String},configuration:{}},data(){return{element:null,mountId:this.id?this.id:`${this.$options.name}-mount`}},methods:{mountElement(e){m(this.configuration).then(r=>{try{let n=null;this.elementType===h.REBILLY_APPLE_PAY?n=r.applePay:this.elementType===h.REBILLY_PAYPAL&&(n=r.paypal),this.element=(0,t.markRaw)(n.mount(e)),r.on(`token-ready`,e=>{this.$emit(`token-ready`,e),this.$parent.$emit(`token-ready`,e)})}catch(e){throw new n({details:e})}})},destroyElement(){this.element&&this.element.destroy()}},watch:{configuration(e){e&&_(e)}},created(){this.mountElement(`#${this.mountId}`)},beforeDestroy(){this.destroyElement()},beforeUnmount(){this.destroyElement()}},A={name:`rebilly-card`,data(){return{elementType:h.REBILLY_CARD}},mixins:[D]},j={name:`rebilly-card-cvv`,data(){return{elementType:h.REBILLY_CARD_CVV}},mixins:[D]},M={name:`rebilly-card-expiration`,data(){return{elementType:h.REBILLY_CARD_EXPIRATION}},mixins:[D]},N={name:`rebilly-card-number`,data(){return{elementType:h.REBILLY_CARD_NUMBER}},mixins:[D]},P={name:`rebilly-bban-account-type`,data(){return{elementType:h.REBILLY_BBAN_ACCOUNT_TYPE}},mixins:[D]},F={name:`rebilly-bban-routing-number`,data(){return{elementType:h.REBILLY_BBAN_ROUTING_NUMBER}},mixins:[D]},I={name:`rebilly-bban-account-number`,data(){return{elementType:h.REBILLY_BBAN_ACCOUNT_NUMBER}},mixins:[D]},L={name:`rebilly-iban`,data(){return{elementType:h.REBILLY_IBAN}},mixins:[D]},R={name:`rebilly-google-pay`,data(){return{elementType:h.REBILLY_GOOGLE_PAY}},mixins:[O]},z={name:`rebilly-apple-pay`,data(){return{elementType:h.REBILLY_APPLE_PAY}},mixins:[k]},B={name:`rebilly-paypal`,data(){return{elementType:h.REBILLY_PAYPAL}},mixins:[k]};e.RebillyApplePay=z,e.RebillyBbanAccountNumber=I,e.RebillyBbanAccountType=P,e.RebillyBbanRoutingNumber=F,e.RebillyCard=A,e.RebillyCardCvv=j,e.RebillyCardExpiration=M,e.RebillyCardNumber=N,e.RebillyFieldTypes=h,e.RebillyForm=S,e.RebillyGooglePay=R,e.RebillyIban=L,e.RebillyPaypal=B,e.RebillyToken=E,e.createToken=g,e.default={install(e,t={}){f(),m(t)}},e.updateConfig=_});
|