// Usage of the library with showPan and its options
alal.bootstrap({
clientAccessToken: "live_MvlIyIQZXyaacuuUSajfx1le0CnKTeUgrUF1d0aEi1nEDGcbWB",
showPan: {
cardPan: {
domId: "custom-card-pan",
styles: {
"color": "green",
"font-family": "monospace",
"font-size": "10px",
"font-weight": "bold",
"background": "transparent"
},
},
copyCardPan: {
domId: "copy-pan-container",
onCopySuccess: copyCardPanSuccess = () => alert("Copied PAN!"),
onCopyFailure: copyCardPanFailure = error => console.error(error),
styles: {
color: "white",
"background": "red"
}
}
},
showExp: {
cardExp: {
domId: "custom-card-exp",
styles: {
"color": "green",
"font-family": "monospace",
"font-size": "10px",
"font-weight": "bold",
"background": "transparent"
},
},
copyCardExp: {
domId: "copy-exp-container",
onCopySuccess: copyCardPanSuccess = () => alert("Copied Exp!"),
onCopyFailure: copyCardPanFailure = error => console.error(error),
}
},
showCvv: {
cardCvv: {
domId: "custom-card-cvv",
styles: {
"color": "green",
"font-family": "monospace",
"font-size": "10px",
"font-weight": "bold",
"background": "transparent"
},
},
copyCardCvv: {
domId: "copy-cvv-container",
onCopySuccess: copyCardPanSuccess = () => alert("Copied CVV!"),
onCopyFailure: copyCardPanFailure = error => console.error(error),
}
},
callbackEvents: {
onSuccess: () => {
console.log("Success!")
},
onFailure: error => {
console.error(error);
}
}
});