@rebilly/framepay-vue 7.2.0 → 7.3.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
- ## [7.2.0](https://github.com/Rebilly/rebilly/compare/framepay-vue-v7.1.2...framepay-vue-v7.2.0) (2024-11-20)
1
+ ## [7.3.0](https://github.com/Rebilly/rebilly/compare/framepay-vue-v7.2.1...framepay-vue-v7.3.0) (2024-11-25)
2
2
 
3
3
 
4
4
  ### Features
5
5
 
6
- * **api-metadata, rebilly-js-sdk:** Update resources based on latest api definitions ([#8738](https://github.com/Rebilly/rebilly/issues/8738)) ([6190668](https://github.com/Rebilly/rebilly/commit/61906687f5dd69949d94edd52ed0244cd7493c28))
6
+ * **framepay-npm:** Prepare for publishing, and add error propagation ([#8765](https://github.com/Rebilly/rebilly/issues/8765)) ([b4ab4a5](https://github.com/Rebilly/rebilly/commit/b4ab4a52bba2de2c986b1292896391598194ace8))
@@ -1,4 +1,4 @@
1
- import { openBlock as u, createElementBlock as y, createElementVNode as I, withModifiers as B, renderSlot as A, h as c, markRaw as a } from "vue";
1
+ import { openBlock as u, createElementBlock as y, createElementVNode as I, withModifiers as B, renderSlot as A, h as c, markRaw as l } from "vue";
2
2
  function h({ message: e = "Could not mount FramePay to element.", details: t = null } = {}) {
3
3
  this.message = e, this.details = t, this.name = "FramePayMountError";
4
4
  }
@@ -15,28 +15,32 @@ async function N({
15
15
  scriptLink: e,
16
16
  styleLink: t
17
17
  } = {}) {
18
- return new Promise((n) => {
18
+ return new Promise((n, r) => {
19
19
  if (window.Framepay)
20
20
  n(window.Framepay);
21
21
  else {
22
- const r = document.createElement("link");
23
- r.setAttribute("href", t ?? Y), r.setAttribute("rel", "stylesheet"), document.head.prepend(r);
24
- const s = document.createElement("script");
25
- s.setAttribute("src", e ?? T), s.onload = () => n(window.Framepay), document.head.append(s);
22
+ const a = document.createElement("link");
23
+ a.setAttribute("href", t ?? Y), a.setAttribute("rel", "stylesheet"), document.head.prepend(a);
24
+ const o = document.createElement("script");
25
+ o.setAttribute("src", e ?? T), o.onload = () => n(window.Framepay), o.onerror = () => r(
26
+ new Error(
27
+ "@rebilly/framepay npm package: Failed to load FramePay script"
28
+ )
29
+ ), document.head.append(o);
26
30
  }
27
31
  });
28
32
  }
29
- const $ = () => new Promise((e) => {
33
+ const w = () => new Promise((e) => {
30
34
  N({ scriptLink: P }).then((t) => e(t));
31
35
  }).catch((e) => {
32
36
  throw new b({ details: e });
33
37
  });
34
- let _;
35
- const w = new Promise((e) => {
36
- _ = e;
37
- }), g = _, E = w.then($);
38
- function l(e = {}) {
39
- return E.then(
38
+ let E;
39
+ const $ = new Promise((e) => {
40
+ E = e;
41
+ }), g = E, _ = $.then(w);
42
+ function m(e = {}) {
43
+ return _.then(
40
44
  (t) => new Promise((n) => {
41
45
  t.on("ready", () => {
42
46
  n(t);
@@ -51,12 +55,12 @@ function l(e = {}) {
51
55
  })
52
56
  );
53
57
  }
54
- const C = "card", x = "cardCvv", U = "cardNumber", O = "cardExpiration", k = "accountType", M = "routingNumber", S = "accountNumber", D = "iban", F = "googlePay", v = "applePay", G = "paypal", i = {
58
+ const C = "card", x = "cardCvv", U = "cardNumber", k = "cardExpiration", O = "accountType", M = "routingNumber", S = "accountNumber", D = "iban", F = "googlePay", v = "applePay", G = "paypal", i = {
55
59
  REBILLY_CARD: C,
56
60
  REBILLY_CARD_CVV: x,
57
61
  REBILLY_CARD_NUMBER: U,
58
- REBILLY_CARD_EXPIRATION: O,
59
- REBILLY_BBAN_ACCOUNT_TYPE: k,
62
+ REBILLY_CARD_EXPIRATION: k,
63
+ REBILLY_BBAN_ACCOUNT_TYPE: O,
60
64
  REBILLY_BBAN_ROUTING_NUMBER: M,
61
65
  REBILLY_BBAN_ACCOUNT_NUMBER: S,
62
66
  REBILLY_IBAN: D,
@@ -65,7 +69,7 @@ const C = "card", x = "cardCvv", U = "cardNumber", O = "cardExpiration", k = "ac
65
69
  REBILLY_PAYPAL: G
66
70
  };
67
71
  function z(e, t) {
68
- return E.then((n) => {
72
+ return _.then((n) => {
69
73
  if (!n.initialized)
70
74
  throw new p({
71
75
  message: "Please initialize Framepay before creating a token"
@@ -73,15 +77,15 @@ function z(e, t) {
73
77
  return n.createToken(e, t);
74
78
  });
75
79
  }
76
- function m(e) {
77
- return l(e).then((t) => {
80
+ function d(e) {
81
+ return m(e).then((t) => {
78
82
  t.update({ ...e });
79
83
  });
80
84
  }
81
85
  const L = (e, t) => {
82
86
  const n = e.__vccOpts || e;
83
- for (const [r, s] of t)
84
- n[r] = s;
87
+ for (const [r, a] of t)
88
+ n[r] = a;
85
89
  return n;
86
90
  }, j = {
87
91
  name: "RebillyForm",
@@ -98,11 +102,11 @@ const L = (e, t) => {
98
102
  emits: ["submit", "error"],
99
103
  watch: {
100
104
  configuration(e) {
101
- e && m(e);
105
+ e && d(e);
102
106
  }
103
107
  },
104
108
  mounted() {
105
- m(this.configuration);
109
+ d(this.configuration);
106
110
  },
107
111
  methods: {
108
112
  handler(e) {
@@ -115,11 +119,11 @@ const L = (e, t) => {
115
119
  }
116
120
  }
117
121
  }, K = { id: "stop-wrapper" };
118
- function V(e, t, n, r, s, d) {
122
+ function V(e, t, n, r, a, o) {
119
123
  return u(), y("div", K, [
120
124
  I("form", {
121
125
  id: "rebilly-form",
122
- onSubmit: t[0] || (t[0] = B((...f) => d.handler && d.handler(...f), ["stop", "prevent"]))
126
+ onSubmit: t[0] || (t[0] = B((...f) => o.handler && o.handler(...f), ["stop", "prevent"]))
123
127
  }, [
124
128
  A(e.$slots, "default")
125
129
  ], 32)
@@ -132,10 +136,10 @@ const Q = /* @__PURE__ */ L(j, [["render", V]]), X = {
132
136
  "data-rebilly": "token",
133
137
  type: "hidden"
134
138
  };
135
- function q(e, t, n, r, s, d) {
139
+ function q(e, t, n, r, a, o) {
136
140
  return u(), y("input", W);
137
141
  }
138
- const Z = /* @__PURE__ */ L(X, [["render", q]]), o = {
142
+ const Z = /* @__PURE__ */ L(X, [["render", q]]), s = {
139
143
  render() {
140
144
  return c("div", {
141
145
  id: this.mountId,
@@ -156,13 +160,13 @@ const Z = /* @__PURE__ */ L(X, [["render", q]]), o = {
156
160
  },
157
161
  methods: {
158
162
  mountElement(e) {
159
- l(this.configuration).then((t) => {
163
+ m(this.configuration).then((t) => {
160
164
  try {
161
- this.elementType.startsWith("card") ? this.element = a(t.card.mount(e, this.elementType)) : this.elementType === "iban" ? this.element = a(t.iban.mount(e)) : [
165
+ this.elementType.startsWith("card") ? this.element = l(t.card.mount(e, this.elementType)) : this.elementType === "iban" ? this.element = l(t.iban.mount(e)) : [
162
166
  i.REBILLY_BBAN_ACCOUNT_TYPE,
163
167
  i.REBILLY_BBAN_ACCOUNT_NUMBER,
164
168
  i.REBILLY_BBAN_ROUTING_NUMBER
165
- ].includes(this.elementType) && (this.element = a(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"));
169
+ ].includes(this.elementType) && (this.element = l(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"));
166
170
  } catch {
167
171
  throw new h();
168
172
  }
@@ -205,9 +209,9 @@ const Z = /* @__PURE__ */ L(X, [["render", q]]), o = {
205
209
  },
206
210
  methods: {
207
211
  mountElement(e) {
208
- l(this.configuration).then((t) => {
212
+ m(this.configuration).then((t) => {
209
213
  try {
210
- this.element = a(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) => {
214
+ this.element = l(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) => {
211
215
  this.$emit("token-ready", n), this.$parent.$emit("token-ready", n);
212
216
  });
213
217
  } catch (n) {
@@ -221,7 +225,7 @@ const Z = /* @__PURE__ */ L(X, [["render", q]]), o = {
221
225
  },
222
226
  watch: {
223
227
  configuration(e) {
224
- e && m(e);
228
+ e && d(e);
225
229
  }
226
230
  },
227
231
  created() {
@@ -257,10 +261,10 @@ const Z = /* @__PURE__ */ L(X, [["render", q]]), o = {
257
261
  },
258
262
  methods: {
259
263
  mountElement(e) {
260
- l(this.configuration).then((t) => {
264
+ m(this.configuration).then((t) => {
261
265
  try {
262
266
  let n = null;
263
- this.elementType === i.REBILLY_APPLE_PAY ? n = t.applePay : this.elementType === i.REBILLY_PAYPAL && (n = t.paypal), this.element = a(n.mount(e)), t.on("token-ready", (r) => {
267
+ this.elementType === i.REBILLY_APPLE_PAY ? n = t.applePay : this.elementType === i.REBILLY_PAYPAL && (n = t.paypal), this.element = l(n.mount(e)), t.on("token-ready", (r) => {
264
268
  this.$emit("token-ready", r), this.$parent.$emit("token-ready", r);
265
269
  });
266
270
  } catch (n) {
@@ -274,7 +278,7 @@ const Z = /* @__PURE__ */ L(X, [["render", q]]), o = {
274
278
  },
275
279
  watch: {
276
280
  configuration(e) {
277
- e && m(e);
281
+ e && d(e);
278
282
  }
279
283
  },
280
284
  created() {
@@ -294,49 +298,49 @@ const Z = /* @__PURE__ */ L(X, [["render", q]]), o = {
294
298
  data() {
295
299
  return { elementType: i.REBILLY_CARD };
296
300
  },
297
- mixins: [o]
301
+ mixins: [s]
298
302
  }, te = {
299
303
  name: "rebilly-card-cvv",
300
304
  data() {
301
305
  return { elementType: i.REBILLY_CARD_CVV };
302
306
  },
303
- mixins: [o]
307
+ mixins: [s]
304
308
  }, ne = {
305
309
  name: "rebilly-card-expiration",
306
310
  data() {
307
311
  return { elementType: i.REBILLY_CARD_EXPIRATION };
308
312
  },
309
- mixins: [o]
313
+ mixins: [s]
310
314
  }, ie = {
311
315
  name: "rebilly-card-number",
312
316
  data() {
313
317
  return { elementType: i.REBILLY_CARD_NUMBER };
314
318
  },
315
- mixins: [o]
319
+ mixins: [s]
316
320
  }, re = {
317
321
  name: "rebilly-bban-account-type",
318
322
  data() {
319
323
  return { elementType: i.REBILLY_BBAN_ACCOUNT_TYPE };
320
324
  },
321
- mixins: [o]
325
+ mixins: [s]
322
326
  }, oe = {
323
327
  name: "rebilly-bban-routing-number",
324
328
  data() {
325
329
  return { elementType: i.REBILLY_BBAN_ROUTING_NUMBER };
326
330
  },
327
- mixins: [o]
331
+ mixins: [s]
328
332
  }, se = {
329
333
  name: "rebilly-bban-account-number",
330
334
  data() {
331
335
  return { elementType: i.REBILLY_BBAN_ACCOUNT_NUMBER };
332
336
  },
333
- mixins: [o]
337
+ mixins: [s]
334
338
  }, ae = {
335
339
  name: "rebilly-iban",
336
340
  data() {
337
341
  return { elementType: i.REBILLY_IBAN };
338
342
  },
339
- mixins: [o]
343
+ mixins: [s]
340
344
  }, le = {
341
345
  name: "rebilly-google-pay",
342
346
  data() {
@@ -357,7 +361,7 @@ const Z = /* @__PURE__ */ L(X, [["render", q]]), o = {
357
361
  mixins: [R]
358
362
  }, ce = {
359
363
  install(e, t = {}) {
360
- g(), l(t);
364
+ g(), m(t);
361
365
  }
362
366
  };
363
367
  export {
@@ -377,5 +381,5 @@ export {
377
381
  Z as RebillyToken,
378
382
  z as createToken,
379
383
  ce as default,
380
- m as updateConfig
384
+ d as updateConfig
381
385
  };
@@ -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 c({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=>{if(window.Framepay)n(window.Framepay);else{const a=document.createElement("link");a.setAttribute("href",t??f),a.setAttribute("rel","stylesheet"),document.head.prepend(a);const s=document.createElement("script");s.setAttribute("src",e??B),s.onload=()=>n(window.Framepay),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.then(A);function m(e={}){return _.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 b(e,t){return _.then(n=>{if(!n.initialized)throw new u({message:"Please initialize Framepay before creating a token"});return n.createToken(e,t)})}function d(e){return m(e).then(t=>{t.update({...e})})}const p=(e,t)=>{const n=e.__vccOpts||e;for(const[a,s]of t)n[a]=s;return n},T={name:"RebillyForm",props:{extraData:{type:Object,default:()=>({})},configuration:{type:Object,default:()=>({})}},emits:["submit","error"],watch:{configuration(e){e&&d(e)}},mounted(){d(this.configuration)},methods:{handler(e){const t=e.target;b(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,s,y){return r.openBlock(),r.createElementBlock("div",N,[r.createElementVNode("form",{id:"rebilly-form",onSubmit:t[0]||(t[0]=r.withModifiers((...q)=>y.handler&&y.handler(...q),["stop","prevent"]))},[r.renderSlot(e.$slots,"default")],32)])}const w=p(T,[["render",C]]),g={name:"RebillyToken"},$={id:"rebilly-token","data-rebilly":"token",type:"hidden"};function U(e,t,n,a,s,y){return r.openBlock(),r.createElementBlock("input",$)}const k=p(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){m(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 c}})},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){m(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 c({details:n})}})},destroyElement(){this.element&&this.element.destroy()}},watch:{configuration(e){e&&d(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){m(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 c({details:n})}})},destroyElement(){this.element&&this.element.destroy()}},watch:{configuration(e){e&&d(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(),m(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=b,i.default=X,i.updateConfig=d,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": "7.2.0",
4
+ "version": "7.3.0",
5
5
  "description": "Official Vue wrapper for Rebilly FramePay",
6
6
  "author": "Rebilly",
7
7
  "repository": {