#bruuh_api

1 messages ยท Page 1 of 1 (latest)

nocturne grottoBOT
#

๐Ÿ‘‹ 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/1219268356365090836

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

whole boneBOT
violet dock
#

Hi there ๐Ÿ‘‹ I don't believe that is possible to do directly with Checkout Sessions, but let me double check on that.

winter forge
#

Thank you

violet dock
#

Yeah, I'm not spotting a way to block those with Checkout Sessions alone. Instead the approach that comes to mind is to write a custom Radar Rule, which I believes require having a Radar for Fraud Teams subscription, to block payments that don't use a supported zip code. Even that may not be the best experience though, I'm the most familiar with Radar, but believe that leads to a generic decline message being displayed to the cusotmers.

winter forge
#

How about then collecting the zipcodes and check by a pre-established list and based on that let the checkout be instantiated or not?

violet dock
#

Like you collect it ahead of creating the checkout session, and then only create the Checkout Session and direct the customer to it if they provided something within your list? That sounds like it could work, my concern would be if they entered one zip in the check then another during checkout.

winter forge
#

yeah, true. will check on my end this

#

can we prefill with zip code and disable it?

violet dock
#

Is this for one-time payments?

#

If so, I'd recommend trying to set payment_intent_data.shipping.address.postal_code
https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-payment_intent_data-shipping-address-postal_code
I'm not certain that will disable the field during the checkout flow, but is the best option I'm coming across so far

winter forge
#

It's for subscriptio payments/products

violet dock
#

Ah, hm, for Subscriptions I'd recommend trying to create a Customer object first and provide their shipping details that you have to shipping.address
https://docs.stripe.com/api/customers/create#create_customer-shipping-address
then pass the ID of that Customer when creating the Checkout Session and see if that causes the entered shipping info to be pulled through.

winter forge
#

Will look into that. Thank you

violet dock
#

(I'm trying to test on the side to see if it works, but the server is a bit busy at the moment)

whole boneBOT