#hiru99-PaymentIntent

1 messages · Page 1 of 1 (latest)

fervent pewter
#

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

signal kiln
#

i am creating this for application api so how can i manage this

fervent pewter
#

I am afraid I don't follow your question

#

Could you elaborate on the scenario?

signal kiln
#

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

fervent pewter
#

what request is that (can you get the request id req_xxx here)?

signal kiln
#

req_KhdFN0nFNsw0nV

fervent pewter
#

In this log I see response has a PaymentIntent block

#

with id = pi_3LFtc32SCaQd7EIe0kuvzVJM, status = requires_payment_method

signal kiln
#

so why i didn't get any response

#

if payment intent is blocked then i need response that payment is blocked or successed

fervent pewter
#

It depends on which tool/SDK you are using

#

What programming language is that?

#

What log do you have?

signal kiln
#

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

fervent pewter
#

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

signal kiln
#

but i didn't get object response i need that response

signal kiln
#

so where is the status of this payment intent

fervent pewter
#

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

#
  try {
    const paymentIntent = await stripe.paymentIntents.create(...);
  } catch (e) {
    console.log(e);
  }
});
signal kiln
#

i already in catch block i got this message

fervent pewter
#

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

#

Is the problem that you don't have the Id?

#

I believe it should be inside the error object, no?

signal kiln
#

and in the object where i can get this BLOCKED Status

fervent pewter
#

That could not be in the object. You can consider it's "blocked" by the last_payment_error_code = 'card_declined'

signal kiln
#

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

fervent pewter