Tipsi-stripe: How to get the Error code ?

Created on 11 May 2018  Â·  4Comments  Â·  Source: tipsi/tipsi-stripe

const card = await Stripe.createTokenWithCard({
        number: newCard.number,
        expMonth: parseInt(newCard.expiration),
        expYear: parseInt(newCard.expiration.substring(4)),
        cvc: newCard.cvc,
        name: this.state.user.name
      })
      .catch(error => {
        console.log(error);
      })

The error print :

Error: Your card's expiration month is invalid.
at createErrorFromErrorData (NativeModules.js:121)
at NativeModules.js:78
at MessageQueue.__invokeCallback (MessageQueue.js:398)
at MessageQueue.js:137
at MessageQueue.__guardSafe (MessageQueue.js:314)
at MessageQueue.invokeCallbackAndReturnFlushedQueue (MessageQueue.js:136)
at debuggerWorker.js:70

My question is : How do I get the object ? I want to get the error code and not the error message ...

(Ps : error.message give me this : "Error: Your card's expiration month is invalid.")

All 4 comments

Up to get the Error code key on android ?

@LucasLpr Issues #267 and #130 may be useful… not not too late. 😉 Hopefully useful for others arriving here.

Still not ...

Was this page helpful?
0 / 5 - 0 ratings