@rebilly/framepay-vue 8.0.1 → 8.2.0

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 CHANGED
@@ -1,6 +1,6 @@
1
- ## [8.0.1](https://github.com/Rebilly/rebilly/compare/framepay-vue-v8.0.0...framepay-vue-v8.0.1) (2024-11-25)
1
+ ## [8.2.0](https://github.com/Rebilly/rebilly/compare/framepay-vue-v8.1.0...framepay-vue-v8.2.0) (2024-11-26)
2
2
 
3
3
 
4
- ### Bug Fixes
4
+ ### Features
5
5
 
6
- * **framepay-npm:** publish package publically ([#8817](https://github.com/Rebilly/rebilly/issues/8817)) ([ccc245c](https://github.com/Rebilly/rebilly/commit/ccc245ccc142ea891695233ecd6e62bc905ddeda))
6
+ * **api-metadata, rebilly-js-sdk:** Update resources based on latest api definitions ([#8740](https://github.com/Rebilly/rebilly/issues/8740)) ([e0b7123](https://github.com/Rebilly/rebilly/commit/e0b7123076aa95556a6cefdd4aa8fcce7ac3f5ff))
@@ -20,9 +20,9 @@ async function N({
20
20
  n(window.Framepay);
21
21
  else {
22
22
  const a = document.createElement("link");
23
- a.setAttribute("href", t ?? Y), a.setAttribute("rel", "stylesheet"), document.head.prepend(a);
23
+ a.setAttribute("href", t || Y), a.setAttribute("rel", "stylesheet"), document.head.prepend(a);
24
24
  const o = document.createElement("script");
25
- o.setAttribute("src", e ?? T), o.onload = () => n(window.Framepay), o.onerror = () => r(
25
+ o.setAttribute("src", e || T), o.onload = () => n(window.Framepay), o.onerror = () => r(
26
26
  new Error(
27
27
  "@rebilly/framepay npm package: Failed to load FramePay script"
28
28
  )
@@ -1 +1 @@
1
- (function(i,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(i=typeof globalThis<"u"?globalThis:i||self,r(i.FramePayVue={},i.Vue))})(this,function(i,r){"use strict";function y({message:e="Could not mount FramePay to element.",details:t=null}={}){this.message=e,this.details=t,this.name="FramePayMountError"}function u({message:e="FramePay could not be initialized.",details:t=null}={}){this.message=e,this.details=t,this.name="FramePayInitializeError"}function h({message:e="FramePay could not be loaded.",details:t=null}={}){this.message=e,this.details=t,this.name="FramePayLoadError"}const L=window.process?.env?.FRAMEPAY_SCRIPT_LINK||"https://framepay.rebilly.com/framepay.js";window.process?.env?.FRAMEPAY_STYLE_LINK;const B="https://framepay.rebilly.com/framepay.js",f="https://framepay.rebilly.com/framepay.css";async function I({scriptLink:e,styleLink:t}={}){return new Promise((n,a)=>{if(window.Framepay)n(window.Framepay);else{const m=document.createElement("link");m.setAttribute("href",t??f),m.setAttribute("rel","stylesheet"),document.head.prepend(m);const s=document.createElement("script");s.setAttribute("src",e??B),s.onload=()=>n(window.Framepay),s.onerror=()=>a(new Error("@rebilly/framepay npm package: Failed to load FramePay script")),document.head.append(s)}})}const A=()=>new Promise(e=>{I({scriptLink:L}).then(t=>e(t))}).catch(e=>{throw new h({details:e})});let R;const P=new Promise(e=>{R=e}),Y=R,p=P.then(A);function d(e={}){return p.then(t=>new Promise(n=>{t.on("ready",()=>{n(t)}),t.on("error",a=>{throw new h({details:a})});try{!t.initialized&&(e.publishableKey||e.jwt)&&t.initialize(e)}catch(a){throw new u({details:a})}}))}const o={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 _(e,t){return p.then(n=>{if(!n.initialized)throw new u({message:"Please initialize Framepay before creating a token"});return n.createToken(e,t)})}function c(e){return d(e).then(t=>{t.update({...e})})}const b=(e,t)=>{const n=e.__vccOpts||e;for(const[a,m]of t)n[a]=m;return n},T={name:"RebillyForm",props:{extraData:{type:Object,default:()=>({})},configuration:{type:Object,default:()=>({})}},emits:["submit","error"],watch:{configuration(e){e&&c(e)}},mounted(){c(this.configuration)},methods:{handler(e){const t=e.target;_(t,this.extraData).then(n=>{this.$attrs.onSubmit?this.$emit("submit",n,t):t.submit()}).catch(n=>{this.$emit("error",n)})}}},N={id:"stop-wrapper"};function C(e,t,n,a,m,s){return r.openBlock(),r.createElementBlock("div",N,[r.createElementVNode("form",{id:"rebilly-form",onSubmit:t[0]||(t[0]=r.withModifiers((...q)=>s.handler&&s.handler(...q),["stop","prevent"]))},[r.renderSlot(e.$slots,"default")],32)])}const w=b(T,[["render",C]]),g={name:"RebillyToken"},$={id:"rebilly-token","data-rebilly":"token",type:"hidden"};function U(e,t,n,a,m,s){return r.openBlock(),r.createElementBlock("input",$)}const k=b(g,[["render",U]]),l={render(){return r.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){d(this.configuration).then(t=>{try{this.elementType.startsWith("card")?this.element=r.markRaw(t.card.mount(e,this.elementType)):this.elementType==="iban"?this.element=r.markRaw(t.iban.mount(e)):[o.REBILLY_BBAN_ACCOUNT_TYPE,o.REBILLY_BBAN_ACCOUNT_NUMBER,o.REBILLY_BBAN_ROUTING_NUMBER].includes(this.elementType)&&(this.element=r.markRaw(t.bban.mount(e,this.elementType))),this.element.on("ready",()=>this.$emit("ready")),this.element.on("change",n=>this.$emit("change",n)),this.element.on("focus",()=>this.$emit("focus")),this.element.on("blur",()=>this.$emit("blur"))}catch{throw new y}})},destroyElement(){this.element&&this.element.destroy()}},created(){this.mountElement(`#${this.mountId}`)},beforeDestroy(){this.destroyElement()},beforeUnmount(){this.destroyElement()}},O={render(){return r.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){d(this.configuration).then(t=>{try{this.element=r.markRaw(t.googlePay.mount(e)),this.element.on("ready",()=>this.$emit("ready")),this.element.on("change",n=>this.$emit("change",n)),this.element.on("focus",()=>this.$emit("focus")),this.element.on("blur",()=>this.$emit("blur")),this.element.on("error",()=>this.$emit("error")),t.on("token-ready",n=>{this.$emit("token-ready",n),this.$parent.$emit("token-ready",n)})}catch(n){throw new y({details:n})}})},destroyElement(){this.element&&this.element.destroy()}},watch:{configuration(e){e&&c(e)}},created(){this.mountElement(`#${this.mountId}`)},beforeDestroy(){this.destroyElement()},beforeUnmount(){this.destroyElement()}},E={render(){return r.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){d(this.configuration).then(t=>{try{let n=null;this.elementType===o.REBILLY_APPLE_PAY?n=t.applePay:this.elementType===o.REBILLY_PAYPAL&&(n=t.paypal),this.element=r.markRaw(n.mount(e)),t.on("token-ready",a=>{this.$emit("token-ready",a),this.$parent.$emit("token-ready",a)})}catch(n){throw new y({details:n})}})},destroyElement(){this.element&&this.element.destroy()}},watch:{configuration(e){e&&c(e)}},created(){this.mountElement(`#${this.mountId}`)},beforeDestroy(){this.destroyElement()},beforeUnmount(){this.destroyElement()}},M={name:"rebilly-card",data(){return{elementType:o.REBILLY_CARD}},mixins:[l]},D={name:"rebilly-card-cvv",data(){return{elementType:o.REBILLY_CARD_CVV}},mixins:[l]},S={name:"rebilly-card-expiration",data(){return{elementType:o.REBILLY_CARD_EXPIRATION}},mixins:[l]},F={name:"rebilly-card-number",data(){return{elementType:o.REBILLY_CARD_NUMBER}},mixins:[l]},G={name:"rebilly-bban-account-type",data(){return{elementType:o.REBILLY_BBAN_ACCOUNT_TYPE}},mixins:[l]},V={name:"rebilly-bban-routing-number",data(){return{elementType:o.REBILLY_BBAN_ROUTING_NUMBER}},mixins:[l]},j={name:"rebilly-bban-account-number",data(){return{elementType:o.REBILLY_BBAN_ACCOUNT_NUMBER}},mixins:[l]},x={name:"rebilly-iban",data(){return{elementType:o.REBILLY_IBAN}},mixins:[l]},z={name:"rebilly-google-pay",data(){return{elementType:o.REBILLY_GOOGLE_PAY}},mixins:[O]},K={name:"rebilly-apple-pay",data(){return{elementType:o.REBILLY_APPLE_PAY}},mixins:[E]},v={name:"rebilly-paypal",data(){return{elementType:o.REBILLY_PAYPAL}},mixins:[E]},X={install(e,t={}){Y(),d(t)}};i.RebillyApplePay=K,i.RebillyBbanAccountNumber=j,i.RebillyBbanAccountType=G,i.RebillyBbanRoutingNumber=V,i.RebillyCard=M,i.RebillyCardCvv=D,i.RebillyCardExpiration=S,i.RebillyCardNumber=F,i.RebillyFieldTypes=o,i.RebillyForm=w,i.RebillyGooglePay=z,i.RebillyIban=x,i.RebillyPaypal=v,i.RebillyToken=k,i.createToken=_,i.default=X,i.updateConfig=c,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(i,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],r):(i=typeof globalThis<"u"?globalThis:i||self,r(i.FramePayVue={},i.Vue))})(this,function(i,r){"use strict";function y({message:e="Could not mount FramePay to element.",details:t=null}={}){this.message=e,this.details=t,this.name="FramePayMountError"}function u({message:e="FramePay could not be initialized.",details:t=null}={}){this.message=e,this.details=t,this.name="FramePayInitializeError"}function h({message:e="FramePay could not be loaded.",details:t=null}={}){this.message=e,this.details=t,this.name="FramePayLoadError"}const L=window.process?.env?.FRAMEPAY_SCRIPT_LINK||"https://framepay.rebilly.com/framepay.js";window.process?.env?.FRAMEPAY_STYLE_LINK;const B="https://framepay.rebilly.com/framepay.js",f="https://framepay.rebilly.com/framepay.css";async function I({scriptLink:e,styleLink:t}={}){return new Promise((n,a)=>{if(window.Framepay)n(window.Framepay);else{const m=document.createElement("link");m.setAttribute("href",t||f),m.setAttribute("rel","stylesheet"),document.head.prepend(m);const s=document.createElement("script");s.setAttribute("src",e||B),s.onload=()=>n(window.Framepay),s.onerror=()=>a(new Error("@rebilly/framepay npm package: Failed to load FramePay script")),document.head.append(s)}})}const A=()=>new Promise(e=>{I({scriptLink:L}).then(t=>e(t))}).catch(e=>{throw new h({details:e})});let R;const P=new Promise(e=>{R=e}),Y=R,p=P.then(A);function d(e={}){return p.then(t=>new Promise(n=>{t.on("ready",()=>{n(t)}),t.on("error",a=>{throw new h({details:a})});try{!t.initialized&&(e.publishableKey||e.jwt)&&t.initialize(e)}catch(a){throw new u({details:a})}}))}const o={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 _(e,t){return p.then(n=>{if(!n.initialized)throw new u({message:"Please initialize Framepay before creating a token"});return n.createToken(e,t)})}function c(e){return d(e).then(t=>{t.update({...e})})}const b=(e,t)=>{const n=e.__vccOpts||e;for(const[a,m]of t)n[a]=m;return n},T={name:"RebillyForm",props:{extraData:{type:Object,default:()=>({})},configuration:{type:Object,default:()=>({})}},emits:["submit","error"],watch:{configuration(e){e&&c(e)}},mounted(){c(this.configuration)},methods:{handler(e){const t=e.target;_(t,this.extraData).then(n=>{this.$attrs.onSubmit?this.$emit("submit",n,t):t.submit()}).catch(n=>{this.$emit("error",n)})}}},N={id:"stop-wrapper"};function C(e,t,n,a,m,s){return r.openBlock(),r.createElementBlock("div",N,[r.createElementVNode("form",{id:"rebilly-form",onSubmit:t[0]||(t[0]=r.withModifiers((...q)=>s.handler&&s.handler(...q),["stop","prevent"]))},[r.renderSlot(e.$slots,"default")],32)])}const w=b(T,[["render",C]]),g={name:"RebillyToken"},$={id:"rebilly-token","data-rebilly":"token",type:"hidden"};function U(e,t,n,a,m,s){return r.openBlock(),r.createElementBlock("input",$)}const k=b(g,[["render",U]]),l={render(){return r.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){d(this.configuration).then(t=>{try{this.elementType.startsWith("card")?this.element=r.markRaw(t.card.mount(e,this.elementType)):this.elementType==="iban"?this.element=r.markRaw(t.iban.mount(e)):[o.REBILLY_BBAN_ACCOUNT_TYPE,o.REBILLY_BBAN_ACCOUNT_NUMBER,o.REBILLY_BBAN_ROUTING_NUMBER].includes(this.elementType)&&(this.element=r.markRaw(t.bban.mount(e,this.elementType))),this.element.on("ready",()=>this.$emit("ready")),this.element.on("change",n=>this.$emit("change",n)),this.element.on("focus",()=>this.$emit("focus")),this.element.on("blur",()=>this.$emit("blur"))}catch{throw new y}})},destroyElement(){this.element&&this.element.destroy()}},created(){this.mountElement(`#${this.mountId}`)},beforeDestroy(){this.destroyElement()},beforeUnmount(){this.destroyElement()}},O={render(){return r.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){d(this.configuration).then(t=>{try{this.element=r.markRaw(t.googlePay.mount(e)),this.element.on("ready",()=>this.$emit("ready")),this.element.on("change",n=>this.$emit("change",n)),this.element.on("focus",()=>this.$emit("focus")),this.element.on("blur",()=>this.$emit("blur")),this.element.on("error",()=>this.$emit("error")),t.on("token-ready",n=>{this.$emit("token-ready",n),this.$parent.$emit("token-ready",n)})}catch(n){throw new y({details:n})}})},destroyElement(){this.element&&this.element.destroy()}},watch:{configuration(e){e&&c(e)}},created(){this.mountElement(`#${this.mountId}`)},beforeDestroy(){this.destroyElement()},beforeUnmount(){this.destroyElement()}},E={render(){return r.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){d(this.configuration).then(t=>{try{let n=null;this.elementType===o.REBILLY_APPLE_PAY?n=t.applePay:this.elementType===o.REBILLY_PAYPAL&&(n=t.paypal),this.element=r.markRaw(n.mount(e)),t.on("token-ready",a=>{this.$emit("token-ready",a),this.$parent.$emit("token-ready",a)})}catch(n){throw new y({details:n})}})},destroyElement(){this.element&&this.element.destroy()}},watch:{configuration(e){e&&c(e)}},created(){this.mountElement(`#${this.mountId}`)},beforeDestroy(){this.destroyElement()},beforeUnmount(){this.destroyElement()}},M={name:"rebilly-card",data(){return{elementType:o.REBILLY_CARD}},mixins:[l]},D={name:"rebilly-card-cvv",data(){return{elementType:o.REBILLY_CARD_CVV}},mixins:[l]},S={name:"rebilly-card-expiration",data(){return{elementType:o.REBILLY_CARD_EXPIRATION}},mixins:[l]},F={name:"rebilly-card-number",data(){return{elementType:o.REBILLY_CARD_NUMBER}},mixins:[l]},G={name:"rebilly-bban-account-type",data(){return{elementType:o.REBILLY_BBAN_ACCOUNT_TYPE}},mixins:[l]},V={name:"rebilly-bban-routing-number",data(){return{elementType:o.REBILLY_BBAN_ROUTING_NUMBER}},mixins:[l]},j={name:"rebilly-bban-account-number",data(){return{elementType:o.REBILLY_BBAN_ACCOUNT_NUMBER}},mixins:[l]},x={name:"rebilly-iban",data(){return{elementType:o.REBILLY_IBAN}},mixins:[l]},z={name:"rebilly-google-pay",data(){return{elementType:o.REBILLY_GOOGLE_PAY}},mixins:[O]},K={name:"rebilly-apple-pay",data(){return{elementType:o.REBILLY_APPLE_PAY}},mixins:[E]},v={name:"rebilly-paypal",data(){return{elementType:o.REBILLY_PAYPAL}},mixins:[E]},X={install(e,t={}){Y(),d(t)}};i.RebillyApplePay=K,i.RebillyBbanAccountNumber=j,i.RebillyBbanAccountType=G,i.RebillyBbanRoutingNumber=V,i.RebillyCard=M,i.RebillyCardCvv=D,i.RebillyCardExpiration=S,i.RebillyCardNumber=F,i.RebillyFieldTypes=o,i.RebillyForm=w,i.RebillyGooglePay=z,i.RebillyIban=x,i.RebillyPaypal=v,i.RebillyToken=k,i.createToken=_,i.default=X,i.updateConfig=c,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rebilly/framepay-vue",
3
3
  "type": "module",
4
- "version": "8.0.1",
4
+ "version": "8.2.0",
5
5
  "description": "Official Vue wrapper for Rebilly FramePay",
6
6
  "author": "Rebilly",
7
7
  "repository": {