#hendr1x_api

1 messages ¡ Page 1 of 1 (latest)

fiery hamletBOT
#

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

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

pulsar raven
#

Couple grammar fixes in my original post : I just found out yesterday (last saved conversation here) that attaching a paymentMethod***

#

My checkout is custom...

sturdy copper
pulsar raven
#

Thanks for your help. I'm starting to go crazy.

#

What I'm trying to do is handle the situation where a person enters their payment information, goes to the confirm page, then changes their account.

#

So you guys don't let me change a customer on a paymentIntent/setupIntent once its attached.

#

So, if I'm using pyamentIntent without setup_future_usage I have no choice but to delete the valid paymentMethod they just provided and have them enter it in again?

#

but if setup_future_usage is set or if I'm using setupIntent I can simpley cancel the payment and the paymentMethod can reattached to the new setupIntent/paymentIntent.

sturdy copper
#

Why would you want to change the customer associated?

#

Also what's your checkout flow?

#

Specifically

#

Are you using confirmation tokens? You mentioned there's a separate confirmation page

pulsar raven
#

I'm not sure what you mean by specifically...so let me know if you need more information...but I have a shipping, payment, then confirmation page.

#

This is what my notes say about confirmationTokens

#

*createConfirmationToken was used but caused the following issues

*saved payments on account used paymentMethod so I had to support both

*confirmSetup had support for using confirmationTokens but I was told it not standard to use and might cause issues

#

So apparently I had them at one point and "decided" not utilize them

sturdy copper
#

So what are you doing in your code

#

What's the sequence of api endpoints

pulsar raven
#

First I generate a payment form using elements.create('payment') in JS on payment page. I also allow for saved payment_methods if user is logged in. Then server side (PHP), prior to showing the confirm page, I generate the paymentIntent (supporting both setup_future_usage and without) or setupIntent based on customer settings. Prior and post this process I do as much testing for validity as possible. Finally, on click of the submit button...in JS, I send stripe.confirmPayment() or confirmSetup() with a return_url.

sturdy copper
#

Ah ok so it's the deferred intent flow

#

Why do you need to change the customer id though on the confirm page? That I don't get

pulsar raven
#

I'm required to handle all edge cases. So if a person is in checkout and then logs out of their accound and into another one is the one I'm dealing with now.

sturdy copper
#

In that scenario you'd need to start the checkout flow over

pulsar raven
#

So cancel the payment and detach the paymentMethod right?

sturdy copper
#

Or just leave it

#

Really it's up to you

pulsar raven
#

Alright. I just wanted to make sure I didn't have other options.