holasoycael / mercadopago-frontend-nextjs

10 stars 5 forks source link

Don`t work #1

Closed IgorDePaula closed 2 years ago

IgorDePaula commented 2 years ago

Nothing console error or warning, Nothing terminal error or warning.

holasoycael commented 2 years ago

Nothing console error or warning, Nothing terminal error or warning.

Hi there!! I'm install repository and run command to open serve in localhost and works good. What appears to you?

IgorDePaula commented 2 years ago

I does too, but when I out my production key to test, nothing happens, anything, no alerts, no console errors or warnings, no terminal errors or warnings, nothing happens. I expect thw payment workflow occur normally. But nothing happens.

holasoycael commented 2 years ago

Did you correctly use the keys on the front-end and back-end?

ACCESS_TOKEN (server-side) window.Mercadopago.setPublishableKey PUBLIC_KEY (client-side) mercadopago.configurations.setAccessToken

IgorDePaula commented 2 years ago

You app haven't any server side key setting...I setted only pub key on frontend. Maybe is using an old version of js sdk of frontend. By API, the correct is use of v2 of js on frontend.

holasoycael commented 2 years ago

You app haven't any server side key setting...I setted only pub key on frontend. Maybe is using an old version of js sdk of frontend. By API, the correct is use of v2 of js on frontend.

Ahh!! Obviously it's my friend, because both keys are personal. I share my PUBLIC_KEY because no problem. But my ACCESS_TOKEN is confidential, so make sure you use your key.

Follow the steps to configure your settings:

Dashboard developer from Mercadopago References from the first playlist with short videos 01. API do Mercado Pago com Node.js — Introdução (11:37-13:22) 01.1 API do Mercado Pago com Node.js — Credenciais (00:00-00:30) Second playlist references with more detailed videos 01. API do Mercado Pago com Node.js – Introdução (03:42-05:19) 01. API do Mercado Pago com Node.js – Introdução (06:22-07:39)

About Mercado Pago documentation Credentials section (See or create your credentials here) Credentials

Hope I helped my friend, after completing your settings, please reply to this issue ✨

IgorDePaula commented 2 years ago

You could enter anything in the token method, not the real key, and leave your example fully functional, with just the keys swapping. And to say keys are personal is not a smart thing to say, as every dev knows that.