#Ammar - Setup Intent
1 messages ยท Page 1 of 1 (latest)
I have a legacy application that we have just updated from using stripe tokens to the setup/payment intents api.
I am trying to add a card to the app using the new changes.
It requests a setup intent client secret and uses it on the frontend to confirm the setup intent and prompt 3DS if necessary.
Can you provide a snippet of your code?
The code works locally.
I am testing on staging site.
Can I provide the setup_intent id?
Sure that would help
seti_1Kb6P3Jk2S5ksjC9jtcuwq9V
Okay and you say this works locally. Where does it not work?
On my staging site
Can you share a request ID for a request made locally and one made from your staging site?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
I cant see the request id for the post request to stripes setup intent api confirmation endpoint. That post request is done via stripe js on the frontend and is handled by your sdk. If I check my logs on the stripe dashboard. The request is successful. But on the frontend stripe returns a 404....
req_kjB40E8Xv1eZ1L
Okay which one is this? Local or staging?
Okay so the setup intent you created locally cannot be found on your staging server?
whaaat. no no. I have an api that is setup both locally and on my staging server. I have a frontend application that is setup both locally and on my staging server. The local api servers my local frontend application. The api on the staging server serves the frontend on the staging server.
Local API -> Local frontend App Both running locally on a dev server.
Staging API -> Staging frontend Both running on a real server on the internet.
Hmm, I think my previous message that the dashboard shows the confirmation as successful was incorrect. I have just tried again. And I can see the post request to get the setup intent is successful in the dashboard. But there is no request to confirm it.
On my web application, the frontend has 404 error in the network requests. The request is from stripe.js and goes to https://api.stripe.com/v1/setup_intents/seti_1Kb6wtJk2S5ksjC92jTRWmgn/confirm
Yeah that does seem odd
As we document here: https://stripe.com/docs/api/setup_intents
The only request accepted to confirm a setup intent is a POST request
it is a post request
My code is literally: stripe.confirmCardSetup(client_secret, {payment_method: {card: _cardInstance}})
Oh sorry I just clicked the link. I can extract the creation request via the ID
That is weird, this request returned a 200.
The post request to confirm the setup intent?
Yes
The post request to create the setup intent returns a 200 and is visible on my dashboard.
But I cannot see the post request to confirm it on my dashboard.
And this is for account TripIQ?
We have stripe connect setup if that is what you are asking?
Are any of these requests being made on different accounts?
I have input the test keys for the TripIQ account.
No all should be using the same stripe test keys.
That does simplify things a bit.
I'm seeing a lot of 404 requests to /v1/charges where the customer does not have the attached source. But that is not the requests you referenced
No, that is due to the staging site having a copy of production data. And there are some automated charges that are triggering those. Not related to this issue.
Okay great, just wanted to double check.
๐ give us a bit
Just making sure it did not get lost in the ether.
You're getting this error because you're creating the Setup Intent on your platform account, by trying to confirm it with the Stripe-Account header set to your connect account client-side.
You either need to also set the Stripe-Accuont header in your server-side request to create the Setup Intent, or you need to remove the Stripe-Acount header from your client-side code
How do I decide which of those to do? Or does it not matter?
It does matter, and it really depends on what you're trying to accomplish in your integration. If you want the Payment Method that is setup through the intent to live on the connect account (I'm guessing this is what you want since this is what we recommend for standard accounts) then you should add the Stripe-Account header to your server code
Ok, thanks for the quick reply.