#hiru99-PaymentIntent
1 messages · Page 1 of 1 (latest)
Hi, from backend you can call the retrieve PaymentIntent to see its status
but before that if you use webhook, you should always has its latest status
i am creating this for application api so how can i manage this
see when i create payment intent from backend side this stripe api throw error me that card is declined so how can i get the status of this payment intent . because i want to send the status to the application side so send me the solution
what request is that (can you get the request id req_xxx here)?
req_KhdFN0nFNsw0nV
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
In this log I see response has a PaymentIntent block
with id = pi_3LFtc32SCaQd7EIe0kuvzVJM, status = requires_payment_method
so why i didn't get any response
if payment intent is blocked then i need response that payment is blocked or successed
It depends on which tool/SDK you are using
What programming language is that?
What log do you have?
i am using node js for backend
i need simple answer that why i didn't get any resonse if payment intant is blocked
?
why ?
i get payment method log but if payment intent is blocked thani didn't get any response
so how can i manage this
read first whole scene and reply me
I am trying to help you. The first screen looks like some website to me. What's that?
Latest screen I can see your code, what is its output?
Its output should have the full object as response in your Dashboard shows
but i didn't get object response i need that response
i receive this error response
so where is the status of this payment intent
I am confused. What's that screen? Why don't you check your console log on your nodejs application?
I think you need try catch in NodeJS
Let's try this https://github.com/stripe-samples/accept-a-payment/blob/main/custom-payment-flow/server/node/server.js#L100-L115
try {
const paymentIntent = await stripe.paymentIntents.create(...);
} catch (e) {
console.log(e);
}
});
i already in catch block i got this message
and what did you got from console.log(paymentIntent)? Nothing?
So it's errored before reaching there
Okie one workaround is when you catch the error, you can fire another Retrieve PaymentIntent API to get the latest status of your PaymentIntent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Is the problem that you don't have the Id?
I believe it should be inside the error object, no?
That could not be in the object. You can consider it's "blocked" by the last_payment_error_code = 'card_declined'
can yo send me the list of error that i can manage if card is declined that payment is blocked share me the all scenario
Here is the error card_declined: https://stripe.com/docs/error-codes#card-declined