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.")
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.
@LucasLpr Upgrade to 5.6.0 and see this
https://github.com/tipsi/tipsi-stripe/blob/master/CHANGELOG.md#560---2018-08-22
https://tipsi.github.io/tipsi-stripe/docs/errorcodes.html
Still not ...