@rebilly/framepay-vue 5.6.0 → 5.7.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 +9 -0
- package/README.md +5 -5
- package/dist/framepay-vue.js +25 -25
- package/dist/framepay-vue.umd.cjs +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
## [5.7.0](https://github.com/Rebilly/rebilly/compare/framepay-vue-v5.6.1...framepay-vue-v5.7.0) (2024-01-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **framepay-vue:** Use Framepay instead of Rebilly ([#2683](https://github.com/Rebilly/rebilly/issues/2683)) ([c9c1ec8](https://github.com/Rebilly/rebilly/commit/c9c1ec8fcf6d05b5d7e3729ba77047b985c5828f))
|
|
7
|
+
|
|
8
|
+
## [5.6.1](https://github.com/Rebilly/rebilly/compare/framepay-vue-v5.6.0...framepay-vue-v5.6.1) (2023-12-15)
|
|
9
|
+
|
|
1
10
|
## [5.6.0](https://github.com/Rebilly/rebilly/compare/framepay-vue-v5.5.1...framepay-vue-v5.6.0) (2023-12-13)
|
|
2
11
|
|
|
3
12
|
|
package/README.md
CHANGED
|
@@ -248,7 +248,7 @@ export default {
|
|
|
248
248
|
|
|
249
249
|
#### With rebilly-token
|
|
250
250
|
|
|
251
|
-
If you prefer to call `createToken()` manually, use the example below. Note that you don't want to use the `
|
|
251
|
+
If you prefer to call `createToken()` manually, use the example below. Note that you don't want to use the `Framepay` object directly, but rather the proxied `createToken` method provided by `framepay-vue`. This method returns a promise that waits for the FramePay script to be loaded before calling `Rebilly.createToken()`. Using the pattern below will help eliminate errors due to race conditions.
|
|
252
252
|
|
|
253
253
|
```html
|
|
254
254
|
<form @submit="submitHandler">
|
|
@@ -284,7 +284,7 @@ export default {
|
|
|
284
284
|
|
|
285
285
|
#### Handle token manually
|
|
286
286
|
|
|
287
|
-
The token can also be handled entirely manually. As above, be sure to call the imported `createToken()` method instead of the global `
|
|
287
|
+
The token can also be handled entirely manually. As above, be sure to call the imported `createToken()` method instead of the global `Framepay` object. This approach offers the most flexibility, but still removes the need for you to handle initialization, mounting and destruction of payment method elements.
|
|
288
288
|
|
|
289
289
|
```html
|
|
290
290
|
<form @submit="submitHandler">
|
|
@@ -451,11 +451,11 @@ Because this will only change the ID of the element you are mounting Framepay to
|
|
|
451
451
|
|
|
452
452
|
Again, you don't need to use `createToken` at all if you choose to use the `RebillyForm` component.
|
|
453
453
|
|
|
454
|
-
#### The `
|
|
454
|
+
#### The `Framepay` Object
|
|
455
455
|
|
|
456
|
-
As mentioned above, Framepay will expose the `
|
|
456
|
+
As mentioned above, Framepay will expose the `Framepay` object in the global namespace after it has loaded. We recommend that you never call the `Framepay` object directly, as `framepay-vue` is designed to either expose or abstract away all the methods you need to use Framepay.
|
|
457
457
|
|
|
458
|
-
For more information about the `
|
|
458
|
+
For more information about the `Framepay` object, see: https://www.rebilly.com/docs/dev-docs/framepay-global-reference/
|
|
459
459
|
|
|
460
460
|
### Components
|
|
461
461
|
|
package/dist/framepay-vue.js
CHANGED
|
@@ -2,22 +2,22 @@ import { openBlock as y, createElementBlock as p, createElementVNode as B, withM
|
|
|
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
|
}
|
|
5
|
-
function
|
|
5
|
+
function b({ message: e = "FramePay could not be initialized.", details: t = null } = {}) {
|
|
6
6
|
this.message = e, this.details = t, this.name = "FramePayInitializeError";
|
|
7
7
|
}
|
|
8
8
|
function u({ message: e = "FramePay could not be loaded.", details: t = null } = {}) {
|
|
9
9
|
this.message = e, this.details = t, this.name = "FramePayLoadError";
|
|
10
10
|
}
|
|
11
|
-
const P = window.process?.env?.FRAMEPAY_SCRIPT_LINK || "https://framepay.rebilly.com/
|
|
11
|
+
const P = window.process?.env?.FRAMEPAY_SCRIPT_LINK || "https://framepay.rebilly.com/framepay.js", Y = window.process?.env?.FRAMEPAY_STYLE_LINK || "https://framepay.rebilly.com/framepay.css", T = () => new Promise((e, t) => {
|
|
12
12
|
const n = document.createElement("script");
|
|
13
|
-
n.src = P, n.id = "rebilly-framepay-js", n.onload = () => e(
|
|
13
|
+
n.src = P, n.id = "rebilly-framepay-js", n.onload = () => e(Framepay), n.onerror = () => t(), document.querySelector("head").appendChild(n);
|
|
14
14
|
}).catch((e) => {
|
|
15
15
|
throw new u({ details: e });
|
|
16
16
|
});
|
|
17
|
-
let
|
|
17
|
+
let E;
|
|
18
18
|
const N = new Promise((e) => {
|
|
19
|
-
|
|
20
|
-
}), $ =
|
|
19
|
+
E = e;
|
|
20
|
+
}), $ = E, _ = N.then(T);
|
|
21
21
|
function C() {
|
|
22
22
|
if (document.querySelector("link#rebilly-framepay-css"))
|
|
23
23
|
return;
|
|
@@ -27,7 +27,7 @@ function C() {
|
|
|
27
27
|
}, document.querySelector("head").appendChild(e);
|
|
28
28
|
}
|
|
29
29
|
function a(e = {}) {
|
|
30
|
-
return
|
|
30
|
+
return _.then(
|
|
31
31
|
(t) => new Promise((n) => {
|
|
32
32
|
t.on("ready", () => {
|
|
33
33
|
n(t);
|
|
@@ -37,12 +37,12 @@ function a(e = {}) {
|
|
|
37
37
|
try {
|
|
38
38
|
e.injectStyle && C(), !t.initialized && (e.publishableKey || e.jwt) && t.initialize(e);
|
|
39
39
|
} catch (r) {
|
|
40
|
-
throw new
|
|
40
|
+
throw new b({ details: r });
|
|
41
41
|
}
|
|
42
42
|
})
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
|
-
const g = "card", w = "cardCvv", x = "cardNumber", U = "cardExpiration", S = "accountType", M = "routingNumber", k = "accountNumber", O = "iban",
|
|
45
|
+
const g = "card", w = "cardCvv", x = "cardNumber", U = "cardExpiration", S = "accountType", M = "routingNumber", k = "accountNumber", O = "iban", D = "googlePay", v = "applePay", G = "paypal", i = {
|
|
46
46
|
REBILLY_CARD: g,
|
|
47
47
|
REBILLY_CARD_CVV: w,
|
|
48
48
|
REBILLY_CARD_NUMBER: x,
|
|
@@ -51,15 +51,15 @@ const g = "card", w = "cardCvv", x = "cardNumber", U = "cardExpiration", S = "ac
|
|
|
51
51
|
REBILLY_BBAN_ROUTING_NUMBER: M,
|
|
52
52
|
REBILLY_BBAN_ACCOUNT_NUMBER: k,
|
|
53
53
|
REBILLY_IBAN: O,
|
|
54
|
-
REBILLY_GOOGLE_PAY:
|
|
55
|
-
REBILLY_APPLE_PAY:
|
|
56
|
-
REBILLY_PAYPAL:
|
|
54
|
+
REBILLY_GOOGLE_PAY: D,
|
|
55
|
+
REBILLY_APPLE_PAY: v,
|
|
56
|
+
REBILLY_PAYPAL: G
|
|
57
57
|
};
|
|
58
|
-
function
|
|
59
|
-
return
|
|
58
|
+
function z(e, t) {
|
|
59
|
+
return _.then((n) => {
|
|
60
60
|
if (!n.initialized)
|
|
61
|
-
throw new
|
|
62
|
-
message: "Please initialize
|
|
61
|
+
throw new b({
|
|
62
|
+
message: "Please initialize Framepay before creating a token"
|
|
63
63
|
});
|
|
64
64
|
return n.createToken(e, t);
|
|
65
65
|
});
|
|
@@ -69,12 +69,12 @@ function l(e) {
|
|
|
69
69
|
t.update({ ...e });
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
const
|
|
72
|
+
const f = (e, t) => {
|
|
73
73
|
const n = e.__vccOpts || e;
|
|
74
74
|
for (const [r, m] of t)
|
|
75
75
|
n[r] = m;
|
|
76
76
|
return n;
|
|
77
|
-
},
|
|
77
|
+
}, F = {
|
|
78
78
|
name: "rebilly-form",
|
|
79
79
|
emits: ["submit", "error"],
|
|
80
80
|
props: {
|
|
@@ -84,7 +84,7 @@ const L = (e, t) => {
|
|
|
84
84
|
methods: {
|
|
85
85
|
handler(e) {
|
|
86
86
|
const t = e.target;
|
|
87
|
-
|
|
87
|
+
z(t, this.extraData).then((n) => {
|
|
88
88
|
this.$attrs.onSubmit ? this.$emit("submit", n, t) : t.submit();
|
|
89
89
|
}).catch((n) => {
|
|
90
90
|
this.$emit("error", n);
|
|
@@ -110,7 +110,7 @@ function V(e, t, n, r, m, d) {
|
|
|
110
110
|
], 32)
|
|
111
111
|
]);
|
|
112
112
|
}
|
|
113
|
-
const J = /* @__PURE__ */
|
|
113
|
+
const J = /* @__PURE__ */ f(F, [["render", V]]), K = {
|
|
114
114
|
name: "rebilly-token"
|
|
115
115
|
}, q = {
|
|
116
116
|
id: "rebilly-token",
|
|
@@ -120,7 +120,7 @@ const J = /* @__PURE__ */ L(z, [["render", V]]), K = {
|
|
|
120
120
|
function X(e, t, n, r, m, d) {
|
|
121
121
|
return y(), p("input", q);
|
|
122
122
|
}
|
|
123
|
-
const Q = /* @__PURE__ */
|
|
123
|
+
const Q = /* @__PURE__ */ f(K, [["render", X]]), o = {
|
|
124
124
|
render() {
|
|
125
125
|
return c("div", {
|
|
126
126
|
id: this.mountId,
|
|
@@ -221,7 +221,7 @@ const Q = /* @__PURE__ */ L(K, [["render", X]]), o = {
|
|
|
221
221
|
beforeUnmount() {
|
|
222
222
|
this.destroyElement();
|
|
223
223
|
}
|
|
224
|
-
},
|
|
224
|
+
}, L = {
|
|
225
225
|
render() {
|
|
226
226
|
return c("div", {
|
|
227
227
|
id: this.mountId,
|
|
@@ -333,13 +333,13 @@ const Q = /* @__PURE__ */ L(K, [["render", X]]), o = {
|
|
|
333
333
|
data() {
|
|
334
334
|
return { elementType: i.REBILLY_APPLE_PAY };
|
|
335
335
|
},
|
|
336
|
-
mixins: [
|
|
336
|
+
mixins: [L]
|
|
337
337
|
}, me = {
|
|
338
338
|
name: "rebilly-paypal",
|
|
339
339
|
data() {
|
|
340
340
|
return { elementType: i.REBILLY_PAYPAL };
|
|
341
341
|
},
|
|
342
|
-
mixins: [
|
|
342
|
+
mixins: [L]
|
|
343
343
|
}, de = {
|
|
344
344
|
install(e, t = {}) {
|
|
345
345
|
$(), a(t);
|
|
@@ -360,7 +360,7 @@ export {
|
|
|
360
360
|
se as RebillyIban,
|
|
361
361
|
me as RebillyPaypal,
|
|
362
362
|
Q as RebillyToken,
|
|
363
|
-
|
|
363
|
+
z as createToken,
|
|
364
364
|
de as default,
|
|
365
365
|
l as updateConfig
|
|
366
366
|
};
|
|
@@ -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 d({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 c({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/
|
|
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 d({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 c({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",B=window.process?.env?.FRAMEPAY_STYLE_LINK||"https://framepay.rebilly.com/framepay.css",f=()=>new Promise((e,t)=>{const n=document.createElement("script");n.src=L,n.id="rebilly-framepay-js",n.onload=()=>e(Framepay),n.onerror=()=>t(),document.querySelector("head").appendChild(n)}).catch(e=>{throw new c({details:e})});let R;const I=new Promise(e=>{R=e}),A=R,_=I.then(f);function P(){if(document.querySelector("link#rebilly-framepay-css"))return;const e=document.createElement("link");e.href=B,e.id="rebilly-framepay-css",e.type="text/css",e.rel="stylesheet",e.onerror=t=>{throw new c({details:t})},document.querySelector("head").appendChild(e)}function s(e={}){return _.then(t=>new Promise(n=>{t.on("ready",()=>{n(t)}),t.on("error",l=>{throw new c({details:l})});try{e.injectStyle&&P(),!t.initialized&&(e.publishableKey||e.jwt)&&t.initialize(e)}catch(l){throw new u({details:l})}}))}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 m(e){return s(e).then(t=>{t.update({...e})})}const E=(e,t)=>{const n=e.__vccOpts||e;for(const[l,y]of t)n[l]=y;return n},Y={name:"rebilly-form",emits:["submit","error"],props:{extraData:{},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)})}},watch:{configuration(e){e&&m(e)}},mounted(){m(this.configuration)}},N={id:"stop-wrapper"};function T(e,t,n,l,y,h){return r.openBlock(),r.createElementBlock("div",N,[r.createElementVNode("form",{id:"rebilly-form",onSubmit:t[0]||(t[0]=r.withModifiers((...q)=>h.handler&&h.handler(...q),["stop","prevent"]))},[r.renderSlot(e.$slots,"default")],32)])}const C=E(Y,[["render",T]]),g={name:"rebilly-token"},$={id:"rebilly-token","data-rebilly":"token",type:"hidden"};function w(e,t,n,l,y,h){return r.openBlock(),r.createElementBlock("input",$)}const U=E(g,[["render",w]]),a={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){s(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 d}})},destroyElement(){this.element&&this.element.destroy()}},created(){this.mountElement(`#${this.mountId}`)},beforeDestroy(){this.destroyElement()},beforeUnmount(){this.destroyElement()}},k={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){s(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 d({details:n})}})},destroyElement(){this.element&&this.element.destroy()}},watch:{configuration(e){e&&m(e)}},created(){this.mountElement(`#${this.mountId}`)},beforeDestroy(){this.destroyElement()},beforeUnmount(){this.destroyElement()}},p={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){s(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",l=>{this.$emit("token-ready",l),this.$parent.$emit("token-ready",l)})}catch(n){throw new d({details:n})}})},destroyElement(){this.element&&this.element.destroy()}},watch:{configuration(e){e&&m(e)}},created(){this.mountElement(`#${this.mountId}`)},beforeDestroy(){this.destroyElement()},beforeUnmount(){this.destroyElement()}},M={name:"rebilly-card",data(){return{elementType:o.REBILLY_CARD}},mixins:[a]},O={name:"rebilly-card-cvv",data(){return{elementType:o.REBILLY_CARD_CVV}},mixins:[a]},S={name:"rebilly-card-expiration",data(){return{elementType:o.REBILLY_CARD_EXPIRATION}},mixins:[a]},D={name:"rebilly-card-number",data(){return{elementType:o.REBILLY_CARD_NUMBER}},mixins:[a]},G={name:"rebilly-bban-account-type",data(){return{elementType:o.REBILLY_BBAN_ACCOUNT_TYPE}},mixins:[a]},F={name:"rebilly-bban-routing-number",data(){return{elementType:o.REBILLY_BBAN_ROUTING_NUMBER}},mixins:[a]},V={name:"rebilly-bban-account-number",data(){return{elementType:o.REBILLY_BBAN_ACCOUNT_NUMBER}},mixins:[a]},x={name:"rebilly-iban",data(){return{elementType:o.REBILLY_IBAN}},mixins:[a]},j={name:"rebilly-google-pay",data(){return{elementType:o.REBILLY_GOOGLE_PAY}},mixins:[k]},z={name:"rebilly-apple-pay",data(){return{elementType:o.REBILLY_APPLE_PAY}},mixins:[p]},v={name:"rebilly-paypal",data(){return{elementType:o.REBILLY_PAYPAL}},mixins:[p]},K={install(e,t={}){A(),s(t)}};i.RebillyApplePay=z,i.RebillyBbanAccountNumber=V,i.RebillyBbanAccountType=G,i.RebillyBbanRoutingNumber=F,i.RebillyCard=M,i.RebillyCardCvv=O,i.RebillyCardExpiration=S,i.RebillyCardNumber=D,i.RebillyFieldTypes=o,i.RebillyForm=C,i.RebillyGooglePay=j,i.RebillyIban=x,i.RebillyPaypal=v,i.RebillyToken=U,i.createToken=b,i.default=K,i.updateConfig=m,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": "5.
|
|
4
|
+
"version": "5.7.0",
|
|
5
5
|
"description": "Official Vue wrapper for Rebilly FramePay",
|
|
6
6
|
"author": "Rebilly",
|
|
7
7
|
"repository": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@rebilly/eslint-config": "*",
|
|
47
47
|
"@testing-library/cypress": "^7.0.2",
|
|
48
48
|
"@vitejs/plugin-vue": "^4.2.3",
|
|
49
|
-
"@vue/test-utils": "^2.4.
|
|
49
|
+
"@vue/test-utils": "^2.4.3",
|
|
50
50
|
"cypress": "^12.17.4",
|
|
51
51
|
"cypress-iframe": "^1.0.1",
|
|
52
52
|
"jsdom": "^21.1.1",
|