Thank you sir! Just started using Stripe in a project and this information has been incredibly helpful. Will have to experiment with some of the tools illustrated but this video has been a great overview to kick off from. Much appreciated!
The CLI is helpful for working with webhooks. Previously I configured the webhook endpoint on the stripe website directly, but that meant i had to do some port-forwarding on my router. Plus, moving to another network was a pain too. Would require all that port forwarding config again. As I saw in the video, with the CLI can simply point to localhost. Will check it out for sure. Thanks
Hey Ryan-great question! Currently, the Stripe Checkout API does not provide a direct option to restrict shipping to specific states. Keep in mind that you also can't do additional validation during the actual Checkout-the only way is to ask for the shipping address before Checkout. You can also add text near the shipping address form [0] noting which states you do not support, but if people still pay from an unsupported state, you will have to handle it after the fact by refunding the user. [0] docs.stripe.com/payments/checkout/customization#customize-text-policies
Thank you for the reply. A refund after the fact is not ideal, but I can definitely do the former, get shipping information upfront. So if the Checkout API doesn't have options for states, I do see a way to listen for events on the shipping address Element. Is building the form with elements and checking the state selected a possibility?
@@StripeDev As you said, not natively, but with Elements, I can listen for the state of "state" in the shipping address element and loop through my accepted states. At that point, I can either allow them to continue because they are in our area of service, or... Unmount and pop up an alert/modal with the option to reenter the address? Therefore remounting the elements? Im not sure what I'm going to do yet, but I think this will just be a last ditch effort to avoid payments from areas we don't ship to. I will still collect shipping info up front, validate, and pre-fill the shipping info on the checkout page. A little more work instead of using the Checkout API, but I can create a solution for my use case.
Hello Cecil, I know this video is about CLI, but do you know the Checkout API as well? This sounds strange, but I would like to restrict the shipping address states. I ship frozen foods, and my company is a small startup and can't ship nationally yet. I have tried to access the , but is restricted. I see a way to for allowed_countries, but nothing for states. Is it possible?
Hey there! You'll want to make sure your restricted keys are up to date and valid-take a look at our doc here for more info: docs.stripe.com/stripe-cli/keys.