frames-react-native icon indicating copy to clipboard operation
frames-react-native copied to clipboard

Empty Card Number produce a null is not an object error

Open dani-z opened this issue 3 years ago • 0 comments

Hi everyone,

We are integrating with Checkout.com using This Frames SDK and noticed that, when I am not adding any card number and tapping the Pay button I am seeing the error below.

 INFO  Emitting "cardTokenizationFailed" [TypeError: null is not an object (evaluating 'state.cardNumber.replace')]

On a quick glance at the code, most probably val here is null / undefined so replace will fail. https://github.com/checkout/frames-react-native/blob/main/src/components/CardNumber.tsx#L29

An easy guard there should fix the issue.

LE: it is actually happening for Expire date as well

 INFO  Emitting "cardTokenizationFailed" [TypeError: null is not an object (evaluating 'state.expiryDate.split')]

dani-z avatar Nov 15 '22 12:11 dani-z