Skip to content

Empty Card Number produce a null is not an object error #20

Open
@dani-z

Description

@dani-z

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')]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions