#johnnyshao_code

1 messages ¡ Page 1 of 1 (latest)

honest oasisBOT
#

👋 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/1389369703302037745

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

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

unborn dome
#

hello! just to clarify, what customer information are you looking to update? and when you say "in the internal system" do you mean in your database?

#

generally speaking for something like this i would recommend using webhooks and listening for the checkout.session.completed event, and if there is specific data you need to update you can store it in the checkout session's metadata during their checkout process

pliant jay
#

Hi Solanum, we are running a web application for Tradies. The customers uses the application to create invoices for the end customers to pay. I am using Stripe Checkout to build the invoice portal. We store all customers's data in our own database.
Once the end customer paid the invoice, an API call should be made to the application backend to update the invoice data in the database such as marking the invoice as done.

unborn dome
#

ok, for confirming payment you should definitely be using webhooks - anything that is dependent on client-side behavior (such as redirects) is prone to failure since a lot can happen client side to disrupt customer behavior

pliant jay
#

Thanks for the suggestion. It makes sense. I will have a read on the webhook doc now.
Also, I have another question on the checkout UI component. Can I ask about it in this thread?

unborn dome
#

yep of course! what's up?

pliant jay
#

Is there a way to disable the email and the country input requirement? Those two fields are required to setup checkout session according to the Stripe tutorial. But we want to simplify the payment portal for the end customers by not requiring them to input those two fields.

unborn dome
#

good question - let me check

#

hmm, so i am not finding a way to disable the requirement to collect an email and country / zip for checkout sessions entirely

#

you can also use updateBillingAddress / updateEmail to add the data to the session, assuming you already have the data

#

but i think you will need to collect or provide it somehow or another

#

actually hold up - that might only be true for the email. you can disable collecting the country / zip by passing this into the Payment Element options:

  fields: {
    billingDetails: "never"   
  }
}```
<https://docs.stripe.com/js/elements_object/create_payment_element#payment_element_create-options-fields-billingDetails>
#

so the email is still going to be required unless you pass it in via a customer or updateEmail, but you can at least remove the country requirement. note that if you're using automatic tax we require billing address data to calculate tax

pliant jay
#

Thanks for checking on this. Let me try it out and let you know.

#

Is it possible for you to keep this thread open for a bit longer just in case I have followup questions on topics I asked?

unborn dome
#

we usually keep threads open for 30ish minutes if no questions are being asked, but if we do close it you can always just include a link to the previos thread if you want to share context

#

we also have an automation that automatically links us to previous threads when you create a new one, so if you just reference "my last thread" whoever you're talking to should be able to find it

pliant jay
#

Ah ok, that is fine then. You can close it once the time is up.

#

Thanks Solanum.

unborn dome
#

yep of course!