Skip to content

"No primary field found. Please create and mount one before calling 'createCardToken'. Ignoring call..." #205

Closed Answered by icaldana
r9software asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @r9software! I see the issue is already closed but I'd like to add more info. First of all you are correct, this message is sent when the field wasn’t properly initialised as mentioned on the documentation.

    const cardNumberElement = mp.fields.create('cardNumber', {
      placeholder: "Número de la tarjeta"
    }).mount('form-checkout__cardNumber');

Secondly, I recommend you to use Payment Brick instead of Core Methods, since you will have all the logic you mentioned plus the UI for free.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by icaldana
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants