#kr0nos_best-practices

1 messages ¡ Page 1 of 1 (latest)

leaden boltBOT
#

👋 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.

steady horizon
blissful moat
#

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?

steady horizon
#

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

Build an integration where you can render the Payment Element prior to creating a PaymentIntent or SetupIntent.

Build a low-code payment form and embed it on your site or host it on Stripe.

blissful moat
#

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

steady horizon
#

as in Checkout Sessions vs Payment Element? or deferred vs non-deferred?

blissful moat
#

Deferred vs non-deferred I guess, needing and not needing a client secret

steady horizon
#

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

blissful moat
#

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?

steady horizon
#

yep, either would work

blissful moat
#

Awesome thank you

#

Could you keep the thread open for a few? im gonna try to implement it

steady horizon
#

sure, will keep this thread open. Even if it's closed, you can ask a question again anytime