#Mahesh Waman-bacs-payment

1 messages ยท Page 1 of 1 (latest)

upper inlet
#

Hello ๐Ÿ‘‹
can you provide more information on how you're trying to integrate bacs payment?

foggy stag
#

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

upper inlet
#

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}"

foggy stag
#

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

upper inlet
#

do you have a request ID I can take a look at? it should look something like req_123

foggy stag
#

I done get any request id

#

like this getting response in API call

#

I am passing session id then I getting response as null

upper inlet
#

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.

foggy stag
#

I am passing only this things

upper inlet
#

You can also find it under account logs

foggy stag
#

can you tell me some brief related to get detail from session id

upper inlet
foggy stag
#

but I didn't get the session object in API response

upper inlet
#

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

foggy stag
#

give me some moment

urban verge
#

๐Ÿ‘‹ Are you still looking for an account ID?

#

I looked up the Checkout Session ID from your screenshot, and it looks like that customer doesn't have a name - it was created with just an email, which is why customer.name is giving you null