Skip to content

Commit

Permalink
Merge pull request #38 from adyen-examples/26-display-card-issuing-co…
Browse files Browse the repository at this point in the history
…untry

Display card issuing country
  • Loading branch information
ayodejidev authored Jan 25, 2024
2 parents 01fa88d + 1ca650a commit 6baa047
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 44 deletions.
131 changes: 91 additions & 40 deletions data/cards.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,20 @@
{
"cardnumber" : "3700 0000 0000 002",
"expiry" : "03/30",
"CVC" : "7373"
"CVC" : "7373",
"country" : "NL"
},
{
"cardnumber" : "3700 0000 0100 018",
"expiry" : "03/30",
"CVC" : "7373"
"CVC" : "7373",
"country" : "NL"
},
{
"cardnumber" : "3714 4963 5398 431",
"expiry" : "03/30",
"CVC" : "7373",
"country" : "n/a",
"secure3DS" : true
}
]
Expand All @@ -28,12 +31,14 @@
{
"cardnumber" : "6703 4444 4444 4449",
"expiry" : "03/30",
"CVC" : "None"
"CVC" : "n/a",
"country" : "BE"
},
{
"cardnumber" : "6703 0000 0000 0000 003",
"expiry" : "03/30",
"CVC" : "None"
"CVC" : "n/a",
"country" : "BE"
}
]
},
Expand All @@ -44,7 +49,8 @@
{
"cardnumber" : "4871 0499 9999 9910",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "BE"
}
]
},
Expand All @@ -55,12 +61,14 @@
{
"cardnumber" : "4360 0000 0100 0005",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "FR"
},
{
"cardnumber" : "4035 5014 2814 6300",
"expiry" : "03/30",
"CVC" : "737",
"country" : "FR",
"secure3DS" : true
}
]
Expand All @@ -72,7 +80,8 @@
{
"cardnumber" : "4035 5010 0000 0008",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "FR"
}
]
},
Expand All @@ -83,22 +92,26 @@
{
"cardnumber" : "8171 9999 2766 0000",
"expiry" : "10/30",
"CVC" : "737"
"CVC" : "737",
"country" : "CN"
},
{
"cardnumber" : "8171 9999 0000 0000 021",
"expiry" : "10/30",
"CVC" : "737"
"CVC" : "737",
"country" : "CN"
},
{
"cardnumber" : "6243 0300 0000 0001",
"expiry" : "12/29",
"CVC" : "737"
"CVC" : "737",
"country" : "CN"
},
{
"cardnumber" : "6250 9470 0000 0014",
"expiry" : "03/30",
"CVC" : "123",
"country" : "CN",
"secure3DS" : true
}
]
Expand All @@ -110,12 +123,20 @@
{
"cardnumber" : "3600 6666 3333 44",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "US"
},
{
"cardnumber" : "3607 0500 0010 20",
"expiry" : "03/30",
"CVC" : "737",
"country" : "NL"
},
{
"cardnumber" : "3056 9309 0259 04",
"expiry" : "03/30",
"CVC" : "737",
"country" : "n/a",
"secure3DS" : true
}
]
Expand All @@ -127,17 +148,21 @@
{
"cardnumber" : "6011 6011 6011 6611",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "US"
},
{
"cardnumber" : "6445 6445 6445 6445",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "GB"
},
{
"cardnumber" : "3056 9309 0259 04",
"cardnumber" : "6011 1111 1111 1117",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "n/a",
"secure3DS" : true
}
]
},
Expand All @@ -148,12 +173,14 @@
{
"cardnumber" : "6771 7980 2100 0008",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "US"
},
{
"cardnumber" : "5000 5500 0000 0029",
"expiry" : "03/30",
"CVC" : "None",
"CVC" : "n/a",
"country" : "n/a",
"secure3DS" : true
}
]
Expand All @@ -165,78 +192,93 @@
{
"cardnumber" : "2222 4000 7000 0005",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "CA"
},
{
"cardnumber" : "5555 3412 4444 1115",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "NL"
},
{
"cardnumber" : "5577 0000 5577 0004",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "PL"
},
{
"cardnumber" : "5555 4444 3333 1111",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "GB"
},

{
"cardnumber" : "2222 4107 4036 0010",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "NL"
},
{
"cardnumber" : "5555 5555 5555 4444",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "GB"
},
{
"cardnumber" : "2222 4107 0000 0002",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "NL"
},
{
"cardnumber" : "2222 4000 1000 0008",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "CA"
},
{
"cardnumber" : "2223 0000 4841 0010",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "NL"
},
{
"cardnumber" : "2222 4000 6000 0007",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "CA"
},
{
"cardnumber" : "2223 5204 4356 0010",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "NL"
},
{
"cardnumber" : "2222 4000 3000 0004",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "CA"
},
{
"cardnumber" : "5100 0600 0000 0002",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "US"
},
{
"cardnumber" : "2222 4000 5000 0009",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "CA"
},
{
"cardnumber" : "5103 2219 1119 9245",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "BR"
}
]
},
Expand All @@ -247,37 +289,44 @@
{
"cardnumber" : "4111 1111 4555 1142",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "NL"
},
{
"cardnumber" : "4111 1120 1426 7661",
"expiry" : "12/30",
"CVC" : "737"
"CVC" : "737",
"country" : "FR"
},
{
"cardnumber" : "4988 4388 4388 4305",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "ES"
},
{
"cardnumber" : "4166 6766 6766 6746",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "NL"
},
{
"cardnumber" : "4111 1111 1111 1111",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "NL"
},
{
"cardnumber" : "4444 3333 2222 1111",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "GB"
},
{
"cardnumber" : "4917 6100 0000 0000",
"expiry" : "03/30",
"CVC" : "737",
"country" : "n/a",
"secure3DS" : true
}
]
Expand All @@ -289,7 +338,8 @@
{
"cardnumber" : "4001 0200 0000 0009",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "BR"
}
]
},
Expand All @@ -300,7 +350,8 @@
{
"cardnumber" : "4013 2500 0000 0000 006",
"expiry" : "03/30",
"CVC" : "737"
"CVC" : "737",
"country" : "PL"
}
]
}
Expand Down
11 changes: 7 additions & 4 deletions panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ function createFavourites() {
}
var tdNumber = $('<td>').addClass("tdCardNumber").text(cardnumber);
addCopyHandlers(tdNumber);

var tdExpiry = ($('<td>').addClass("tdExpiry").text(item.expiry));
addCopyHandlers(tdExpiry);
var tdCode = ($('<td>').addClass("tdCode").text(item.CVC));
Expand Down Expand Up @@ -350,13 +349,15 @@ function createCardsBrandSection(brand, cards) {
var tdHidden = ($('<td>').addClass("hidden").text(brand + " " + item.cardnumber));
}
addCopyHandlers(tdNumber);
var tdCountry = ($('<td>').addClass("center").addClass("tdCountry").text(item.country));
addCopyHandlers(tdCountry);
var tdExpiry = ($('<td>').addClass("center").addClass("tdExpiry").text(item.expiry));
addCopyHandlers(tdExpiry);
var tdCode = ($('<td>').addClass("center").addClass("tdCode").text(item.CVC));
addCopyHandlers(tdCode);
var tdLinks = ($('<td>').addClass("center").append(createLinks("card")));
row.append(tdHidden).append(tdIcon).append(tdNumber).append(tdExpiry).append(tdCode).append(tdLinks);
table.append(row);
row.append(tdHidden).append(tdIcon).append(tdNumber).append(tdCountry).append(tdExpiry).append(tdCode).append(tdLinks);
table.append(row);
}
});

Expand Down Expand Up @@ -426,10 +427,12 @@ function createIbans() {
var tdIcon = ($('<td>').append(makeIbanFavIcon(item.iban)));
var tdNumber = ($('<td>').addClass("tdCardNumber").text(item.iban));
addCopyHandlers(tdNumber);
var tdCountry = ($('<td>').addClass("tdCountry").text(item.country));
addCopyHandlers(tdCountry);
var tdName = ($('<td>').addClass("tdExpiry").text(item.name)); // note: use expiry column for IBAN account holder
addCopyHandlers(tdName)
var tdLinks = ($('<td>').addClass("center").append(createLinks("iban")));
row.append(tdHidden).append(tdIcon).append(tdNumber).append(tdName).append(tdLinks);
row.append(tdHidden).append(tdIcon).append(tdNumber).append(tdCountry).append(tdName).append(tdLinks);
table.append(row);
}
});
Expand Down

0 comments on commit 6baa047

Please sign in to comment.