#Ammar - Setup Intent

1 messages ยท Page 1 of 1 (latest)

spare vapor
#

Hi ๐Ÿ‘‹ what are you trying to do?

cinder turret
#

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.

spare vapor
#

Can you provide a snippet of your code?

cinder turret
#

The code works locally.

#

I am testing on staging site.

#

Can I provide the setup_intent id?

spare vapor
#

Sure that would help

cinder turret
#

seti_1Kb6P3Jk2S5ksjC9jtcuwq9V

spare vapor
#

Okay and you say this works locally. Where does it not work?

cinder turret
#

On my staging site

spare vapor
cinder turret
#

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

spare vapor
#

Okay which one is this? Local or staging?

cinder turret
#

staging

#

req_qMFAGEVXgadsO1

#

that is from local

spare vapor
#

Okay so the setup intent you created locally cannot be found on your staging server?

cinder turret
#

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.

spare vapor
#

Yeah that does seem odd

cinder turret
#

it is a post request

#

My code is literally: stripe.confirmCardSetup(client_secret, {payment_method: {card: _cardInstance}})

spare vapor
#

Oh sorry I just clicked the link. I can extract the creation request via the ID

#

That is weird, this request returned a 200.

cinder turret
#

The post request to confirm the setup intent?

spare vapor
#

Yes

cinder turret
#

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.

spare vapor
#

And this is for account TripIQ?

cinder turret
#

We have stripe connect setup if that is what you are asking?

spare vapor
#

Are any of these requests being made on different accounts?

cinder turret
#

I have input the test keys for the TripIQ account.

#

No all should be using the same stripe test keys.

spare vapor
#

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

cinder turret
#

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.

spare vapor
#

Okay great, just wanted to double check.

cinder turret
#

Phew

#

Looks like discord is back online.

#

Any updates ๐Ÿ™‚

royal agate
#

๐Ÿ‘‹ give us a bit

cinder turret
#

Just making sure it did not get lost in the ether.

royal agate
#

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

cinder turret
#

How do I decide which of those to do? Or does it not matter?

royal agate
#

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

cinder turret
#

Ok, thanks for the quick reply.