BlackBoxVision / react-native-mercadopago-px

🚀 MercadoPago PX bridge for react-native
https://react-native-mercadopago-px.blackbox-vision.tech
MIT License
104 stars 25 forks source link

"preferenceId is required for starting MP Checkout" #40

Closed maueli closed 3 years ago

maueli commented 3 years ago

I copy the example. Replace TestIDs and appear that:

"preferenceId is required for starting MP Checkout"

JonatanSalas commented 3 years ago

@maueli have you logged the preferenceId value that you're passing to the checkout? Maybe it's undefined.

maueli commented 3 years ago

I wonder if you could explain me how to set "server-side" react-native to run your example and get the "preferenceId".

Thanks!

JonatanSalas commented 3 years ago

The example has itself a README explaining the mandatory steps in order to run the application correctly. You can check it out here:

https://github.com/BlackBoxVision/react-native-mercadopago-px/tree/master/example

Also, we've a section of pre-requisites related to MP account setup:

https://github.com/BlackBoxVision/react-native-mercadopago-px#pre-requisites

maueli commented 3 years ago

Ok, I know I know. How can I get the preferenceid in a basic react-native App?. Do I have to install express to run the server-side? How/where can I run "curl" ?. Could you give me a clue or a basic example of how can I run server-side and get preferenceid easily? Thanksssss

JonatanSalas commented 3 years ago

In the example we go directly through MP Preference Creation API using the Access Token obtained from our account. That's a matter of simplicity in terms of the example.

If you want to add a server, you can check the sdk-nodejs repo: https://github.com/mercadopago/sdk-nodejs#-getting-started

I'll add a reference to the docs, but that's not related to our library setup.