bnpl-sdk-button
Version:
You can use this package to integrate BNPL.
74 lines (66 loc) • 1.49 kB
JavaScript
import * as zoid from "zoid/dist/zoid.frameworks";
// import Vue from "vue";
// Button child component
const bnplButton = zoid.create({
tag: "bnpl-button-v1.2.9",
url: "https://4d9f-43-247-122-63.in.ngrok.io/button",
autoResize: {
width: false,
height: false,
},
dimensions: {
width: "100%",
height: "100%",
},
});
export const sdk = zoid
.create({
// The html tag used to render the component
tag: "bnpl-sdk-v1.2.9",
url: "https://4d9f-43-247-122-63.in.ngrok.io/",
autoResize: {
width: false,
height: false,
},
dimensions: {
width: "100%",
height: "100%",
},
// Child components of parent SDK
children: () => {
return {
bnplButton: bnplButton,
};
},
// Method called for the child
exports: ({ getExports }) => {
return {
btnRedirect: () =>
getExports().then((exports) => exports.btnRedirect()),
};
},
// The size of the component
props: {
domain: {
type: "string",
required: false,
},
merchantAppKey: {
type: "string",
required: false,
},
merchantOrderID: {
type: "string",
required: false,
},
grandTotal: {
type: "string",
required: false,
},
currency: {
type: "string",
required: false,
}
},
})
// .driver("vue", Vue); // convert zoid component into a vue component