Skip to content

Commit ee401a9

Browse files
fix: example
1 parent ed1738f commit ee401a9

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

examples/card-form/index.html

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
},
5454
},
5555
function (form) {
56+
let preferredCardType = null;
5657
form.getNumberField().on("input", function (e) {
5758
if (e.card_number_length == 6) {
5859
client.getCardInformation(
@@ -83,13 +84,13 @@ <h4 style="margin: 0 0 10px 0; color: #333;">Select Card Type:</h4>
8384
const radioButtons = radioGroup.querySelectorAll('input[name="cardType"]')
8485
radioButtons.forEach(radio => {
8586
radio.addEventListener('change', function() {
86-
window.preferred_card_type = this.value
87-
console.log("User selected card type:", window.preferred_card_type)
87+
preferredCardType = this.value
88+
console.log("User selected card type:", preferredCardType)
8889
})
8990
})
9091

9192
// Set initial value
92-
window.preferred_card_type = null
93+
preferredCardType = null
9394
}
9495
},
9596
function(err) {
@@ -121,7 +122,7 @@ <h4 style="margin: 0 0 10px 0; color: #333;">Select Card Type:</h4>
121122
{
122123
name: document.getElementById("card-form-name").value,
123124
zip: "10018",
124-
preferred_card_type: window.preferred_card_type
125+
preferred_card_type: preferredCardType
125126
},
126127
function (token) {
127128
console.log("Tokenization Success", token)

0 commit comments

Comments
 (0)