#kr0nos_best-practices
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/1318421711061913623
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hello! You don't have to create a PaymentIntent first. The ExpressCheckoutElement can be initialized without a PaymentIntent. You can take a look at the guide here : https://docs.stripe.com/elements/express-checkout-element/accept-a-payment
okay one sec ill look through it
Man this is all so confusing there are so many ways to do everything lol..
So the goal is to create this form. Initially I didnt have the express checkout element, it was just the form where they enter amount. Then by pressing the "Donate with card" button it would take the amount, and create a payment intent, retrieve client secret, and render the payment element.
Then I started to integrate the ExpressCheckoutElement, but for it to be visible right away like in the picture, I had to create an initial payment intent and provide the client secret to a seperate Elements providor
youre saying I dont need to create the payment intent. Will i have to change how the payment Element works?
if you want to load the Payment Element without an Intent, that's also possible : https://stripe.com/docs/payments/accept-a-payment-deferred
Have you considered using Checkout Sessions though? It will be a lot easier to integrate : https://docs.stripe.com/payments/checkout
Yes I have to build it from scratch, we a building a donation management platform, has to be all custom.
Can you explain what the difference is between the 2 methods? Like why you would chose one over the other
as in Checkout Sessions vs Payment Element? or deferred vs non-deferred?
Deferred vs non-deferred I guess, needing and not needing a client secret
the deferred intent flow allows you to initialize the Element without needing to create an Intent first. There are users who like you, also prefer not to have to create an Intent first and end up having a large number of incomplete Intents. Another benefit of a deferred flow is to allow users to be able to implement certain logic / calculations that will impact the PaymentIntent based off the PaymentMethod that the customer uses. The user wouldn't need to make multiple requests to update the PaymentIntent since they create the PaymentIntent after the PaymentMethod is created
Got it, so other than displaying the element and creating the payment intent later in the flow, they are essentially the same? For my use case of a donation form either would work?
yep, either would work
Awesome thank you
Could you keep the thread open for a few? im gonna try to implement it
sure, will keep this thread open. Even if it's closed, you can ask a question again anytime