#Krishna_Awate
1 messages · Page 1 of 1 (latest)
You can do this client-side using stripe.retreievePaymentIntent (https://stripe.com/docs/js/payment_intents/retrieve_payment_intent)
I want to do it on server side
There isn't a way to do it server-side - we require you to have the PaymentIntent ID to retrieve it
If I have payment intent id then how can i retrieve?
I tried this but it is showing not valid id
Can you share a request ID that's failing?
"No such payment_intent: 'pi_3NIEe1RXxFtUszmC1DuVE2tN
I need the request ID (req_123) not the error message
req_OX7SvBPi2d3HCU
You're getting an error because that PaymentIntent was created on a connected account with the stripe-account header
If you want to retrieve the PI you have to also set the Stripe-Account header to the same account ID you used when you created it
hwo can i do that
const paymentIntent = await stripe.paymentIntents.retrieve(
payment_intent_id
);
right now I am doing this.
We give examples of how to do this here: https://stripe.com/docs/connect/authentication#stripe-account-header
Did not get code for retriveing payment intent
Yeah we don't give an exact example specifically for retrieving PaymentIntent but we show you exactly how to set the header, which should be the same across all requests
Did you read through the docs I sent fully? We have multiple examples of how to set requestOptions.StripeAccount so it'd help if you'd clarify what specifically you're confused about
const paymentIntent = await stripe.paymentIntents.retrieve(
payment_intent_id,
{
stripeAccount: bank_info.stripe_account_id,
}
);
I have set like docs
but not working
do you have a new reqeust ID I can look at?
req_KvDmbaE4VEI2Og'
Try this
const paymentIntent = await stripe.paymentIntents.retrieve(
payment_intent_id,
{},
{
stripeAccount: bank_info.stripe_account_id,
}
);
Are you 100% sure you're running the code that you're expecting? Have you logged out bank_info.stripe_account_id and confirmed it's the value you expect?
👍 awesome! glad you got it working