#dlavoie-plannit_code

1 messages ยท Page 1 of 1 (latest)

raw compassBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1352678689237635094

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

odd kettle
carmine anchor
#

ok but there must be another way to parse the error than the text? for example, in the server-side sample, there is a failure_code

  "id": "tmr_xxx",
  "object": "terminal.reader",
  "action": {
    "failure_code": "card_declined",
    "failure_message": "Your card has insufficient funds.",
    "process_payment_intent": {
      "payment_intent": "pi_xxx"
    },
    "status": "failed",
    "type": "process_payment_intent"
  },
  ...
}
odd kettle
#

That's JSON, so you can parse that and deal with it like an object.

carmine anchor
#

ok but this was a server side sample

#

in my case it's an error object

#

where can I find the definition of this object?

#

i suppose there is an enum somewhere with possibles errors codes

#

but that doesn't show possibles values

#

the equivalent of failure_code

#

I guess

carmine anchor
#

ok thank you! also, I would like to simulate various failure scenario with the simulated terminal but can't find how to achieve that

odd kettle
carmine anchor
#

ok, thank you for your help, you can close this thread, have a nice day ๐Ÿ™‚