#Mahesh Waman-bacs-payment
1 messages ยท Page 1 of 1 (latest)
Hello ๐
can you provide more information on how you're trying to integrate bacs payment?
I have done bacs payment integration and I am using stripe checkout functionality
I have done success and cancel functionality
but I need to know about that payment is successed or has some error
how I can get respective failure code
I want to take care this failure code
Thank you for providing more information. When you get redirected to cancel page/route, You can retrieve the session object and take a look at the error code there.
You can inject the session ID to your return URL like this
"http://yoursite.com/order/success?session_id={CHECKOUT_SESSION_ID}"
I have done API for this but in response getting null
export async function checkoutSuccess(
session_id: string
){
try {
const session:any = await stripe.checkout.sessions.retrieve(session_id);
console.log('session',session);
const customer:any = await stripe.customers.retrieve(session.customer);
console.log('customer',customer);
return customer.name;
}catch(err){
return err
}
}
this is code of line I have done
do you have a request ID I can take a look at? it should look something like req_123
I done get any request id
like this getting response in API call
I am passing session id then I getting response as null
Try adding some more logging to your code.
Check if there's indeed value in the session_id variable when your checkoutSuccess function is called.
I see. Can you try making a new request with this and see if a request ID pops up?
You can also find it under account logs
can you tell me some brief related to get detail from session id
When you retrieve the session object, you can expand the payment_intent on it to check on its status.
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-payment_intent
If the payment failed with a specific error code, you'd find it there
but I didn't get the session object in API response
can you give me your account ID so I can pull up the relevant request? it should look something like acc_xxxxx
you can find it under account settings
give me some moment