Paramétres de la méthode .bootstrap()
clientAccessToken
clientAccessToken est le jeton qui permet d’accéder à la carte spécifiée, elle expire au bout de 24 heures. Get Access Token Card API Reference
string
required
Jeton d’identification de la carte
showPan
showPan permet d’afficher le numéro de carte
Object
required
Object
required
Show properties
Show properties
showExp
showExp permet d’afficher la date d’expiration de la carte
Object
required
Object
required
Show properties
Show properties
showCvv
showCvv permet d’afficher la showCvv de la carte
Object
required
Object
required
Show properties
Show properties
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div id="custom-card-pan"></div>
<div id='copy-pan-container'></div>
<div id="custom-card-exp"></div>
<div id='copy-exp-container'></div>
<div id="custom-card-cvv"></div>
<div id='copy-cvv-container'></div>
<script src="https://www.sandbox.saalal.com/js/1.0.1/alal.js"></script>
<script src="/app.js"></script>
<body>
</html>
// 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);
}
}
});
