#KenMonster - Decline Response

1 messages · Page 1 of 1 (latest)

bright grove
#

Hello! Taking a look, hang on...

shadow mortar
#

Thanks Rubeus

bright grove
#

Looks like the error detail is present in the err object. Is the issue that you're trying to access the "Your card was declined." error message and display that in your UI?

shadow mortar
#

Yes that's it

#

but you can see when we console the value of err or setupIntent (the two values we are setting on return) they are both undefined

#

The json returned includes the error data

#

but the statement
const {setupIntent, err} = await this.stripe.confirmCardSetup(

is returning undefined for both values

#

the code is copied straight from the api. So we were wondering:

  1. are we calling it wrong?
  2. because it is a 402 is it not returning a value?
bright grove
#

I think you're calling it wrong, try changing err to error and see if it works as expected.

shadow mortar
#

oh thanks - will try - that would be very simple 🙂

#

doh! thanks that was it 🤦‍♂️

bright grove
#

Glad it was easy to fix!