#paul_code

1 messages ¡ Page 1 of 1 (latest)

rustic brookBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1427648485091577887

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

pine badge
daring meadow
#

ah I was worried that would be the case. Thank you.

#

I can't get to that link

#

get access denied

pine badge
#

Sorry, fixed it

daring meadow
#

do you know of any account setting we could set to do it? I know we can block using radar but as we can't customise the response it's not a great customer facing message

pine badge
#

So automatic filtering is not yet available (we're working on it!) but what you can do is set up a "two step" flow that allows you to inspect a preview of the payment method details provided (including card brand, country, etc) and then you can control the customer flow based on that.
https://docs.stripe.com/payments/build-a-two-step-confirmation#create-ct

In your case, you'd create the confirmation token and inspect the payment_method_preview for the card brand and ask your customer to provide a different card type if they used one you don't want to accept.

This flow works both when confirming client side or with server confirmation.

daring meadow
#

nice, I'd not come across that before. I'll take a look, thanks for your help

daring meadow
#

I've had a read of it and it look promising, the only issue is that we're using PaymentMethods still and changing isn't something that would be quick. A couple of questions, firstly will we have to move across the ConfirmationTokens in the near future, and secondly is there another way to block Amex without using confirmation tokens?

pine badge
#

we're using PaymentMethods still and changing isn't something that would be quick
Can you explain more here? Do you mean you're using createPaymentMethod() in Stripe.js?
we have to move across the ConfirmationTokens in the near future,
No, this is an optional step both in terms of replacing createPaymentMethod and in your flow in general. However, if you are using createPaymentMethod currently then I will say confirmation tokens can simplify flows for other payment methods like bank debits that require collecting a mandate for payments etc.
secondly is there another way to block Amex without using confirmation tokens?
If you're using createPaymentMethod already you can achieve a similar result there, inspecting the generated payment method object for the same details.

rustic brookBOT
daring meadow
#

this is the code we're currently using to create the payment method:
await stripe
.createPaymentMethod({
type: "card",
card: cardNumberElement,
"billing_details": {
"address": {
"country": "gb",
"postal_code": document.querySelector("#card-postcode").value
}
}
})
.then(function (result) {
return processResponse(result, noCvcCardForm);
})
.catch(ex => reportError(ex, noCvcCardForm));

#

Thanks for the confirmation about not having to move to ConfirmationTokens, our current setup using Payment Methods works well (only take cards)

pine badge
#

Yep, then you can use that and inspect the card brand there to behave as you like (show a customer error message etc)

daring meadow
#

isn't it too late at that point though as the card will already have been added to their account?

pine badge
#

Ultimately you should consider any client-side rules as the "good cop" but suggest enforcing this with a "bad cop" hard block via Radar or with a server-side check if you need to ensure this is not allowed.

pine badge
daring meadow
#

ah ok thank you, I think I need to dig into the code a bit more. Thanks for your help