@aGandrass Can you not create a Radar rule?
Sep 19, 2018
11
Level 2
Block American Express Cards via Stripe API
Hi, I am trying to block all American Express Credit Card on my payment form. Is there a way to block them via the Stripe API and show the user that I do no accept American Express Credit Cards? Thank you very much
Level 67
$cc_number = 34567852345235;
$amex = ["34", "37"];
$first2 = substr($cc_number, 0, 2); // get first 2 numbers
if (in_array($first2, $amex)) { // see if first 2 are 34 or 37
// is amex card, reject
}
or make a helper
function isAmexCard($ccNumber) {
$amex = ["34", "37"];
$first2 = substr($ccNumber, 0, 2); // get first 2 numbers
return (in_array($first2, $amex));
}
if (isAmexCard($cc_number)) {
// is amex card, reject
}
Please or to participate in this conversation.