#Pravin-confirmCardPayment

1 messages · Page 1 of 1 (latest)

autumn nest
#

👋 happy to help

#

you just need to pass the PaymentIntent's client secret

untold plume
#

I am passing the paymentIntents client secret

#

still confirm payment call is failing for me

autumn nest
#

the Stripe object you're using should be instantiated with the Stripe Account header if the PI was created that way

untold plume
#

I have instantiated stripe object like this const stripe = Stripe('*************');
I am working on plain javascript code

autumn nest
#

do you have the PI id? pi_xxx

untold plume
#

yes I have payment intent ID

#

below is the confirm call code I am using

autumn nest
#

I meant could you please share it?

untold plume
#

sure

autumn nest
#

the pi_xxx

untold plume
#

pi_3L8LSXPSc6y6Wd9J0qUVVcmI

#

I am trying to make confirm for connect user

autumn nest
#

sorry for the late reply

untold plume
#

this is my curl for the confirm payment

#

curl 'https://api.stripe.com/v1/payment_intents/pi_3L8LyaPSc6y6Wd9J0Zw4T4DL/confirm'
-H 'authority: api.stripe.com'
-H 'accept: application/json'
-H 'accept-language: en-GB,en-US;q=0.9,en;q=0.8'
-H 'content-type: application/x-www-form-urlencoded'
-H 'origin: https://js.stripe.com'
-H 'referer: https://js.stripe.com/'
-H 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="102", "Google Chrome";v="102"'
-H 'sec-ch-ua-mobile: ?0'
-H 'sec-ch-ua-platform: "macOS"'
-H 'sec-fetch-dest: empty'
-H 'sec-fetch-mode: cors'
-H 'sec-fetch-site: same-site'
-H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36'
--data-raw 'payment_method=pm_1L8LyXAlnu7mVSWlMkBugCeU&expected_payment_method_type=card&use_stripe_sdk=true&key=&client_secret=*'
--compressed

autumn nest
#

I see that you made a successful confirmation

#

the idea is the you need to have 2 Stripe objects on the front

#

the one for the Platform

#

and the one for the Connected account

untold plume
#

no the confirm payment call is failing for me

autumn nest
#

I understand

untold plume
#

can you please help me how to configure 2 stripe objects in the Javascript code

autumn nest
#

I'm investigating could you please hold on a minute

untold plume
#

sure

autumn nest
#

what key are you using on the Stripe object in the front end? the Connected account's public key?

untold plume
#

yes

autumn nest
#

when you created the PI you created it using your Platform's secret key

untold plume
#

which is pk_test_*******

#

I did not create the account public key
we are having web application running in react and we are using the key and I am using the same to connect from Java script code

#

pk_test_**********

#

I am able to make payments in the react code web application

#

it is in production as well

autumn nest
#

you need to create the PI and confirm it using the same combination of keys/Stripe-Account header

#

meaning if you generated the PI using the Platform's secret key, you have to confirm using the Platform's public key
if you generated the PI using the Platform's secret key with a StripeAccount Header for the connected key (destination charges), then you need to instantiate a Stripe object on the front with the public key of the Platform and the Stripe Account header and use that object to confirm the PI

lunar solstice
#

Hey, taking over here. Let me know if there's any follow-up Qs I can answer!