#paul_code
1 messages ¡ Page 1 of 1 (latest)
đ 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.
hey there, this is not something currently supported in the web Payment Element: https://docs.stripe.com/js/elements_object/create_payment_element
ah I was worried that would be the case. Thank you.
I can't get to that link
get access denied
Sorry, fixed it
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
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.
nice, I'd not come across that before. I'll take a look, thanks for your help
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?
we're using PaymentMethods still and changing isn't something that would be quick
Can you explain more here? Do you mean you're usingcreatePaymentMethod()in Stripe.js?
we have to move across the ConfirmationTokens in the near future,
No, this is an optional step both in terms of replacingcreatePaymentMethodand in your flow in general. However, if you are usingcreatePaymentMethodcurrently 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 usingcreatePaymentMethodalready you can achieve a similar result there, inspecting the generated payment method object for the same details.
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)
Yep, then you can use that and inspect the card brand there to behave as you like (show a customer error message etc)
isn't it too late at that point though as the card will already have been added to their account?
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.
Using createPaymentMethod doesn't do anything beyond generate a payment method object, what happens after that is up you your integration. If you attach that to the customer, you can check the card brand before doing that step.
ah ok thank you, I think I need to dig into the code a bit more. Thanks for your help