From 9d3f86dd03b04ca2c5d1a64ae2abe34657f71959 Mon Sep 17 00:00:00 2001 From: Eduardo Zepeda Date: Sun, 23 Aug 2020 00:05:05 -0500 Subject: [PATCH] Update README.md --- README.md | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 94f3da1..1e9c5c9 100644 --- a/README.md +++ b/README.md @@ -26,22 +26,45 @@ Settings.py configuration Add the *payments_mercadopago.MercadoPagoProvider* to your *PAYMENT_VARIANTS* variable. Also to make it available add MercadoPago to your *CHECKOUT_PAYMENT_CHOICES variable* +Mercado Pago doesn't require you to specify a fixed sandbox endpoint, instead they provide you with a sandbox token and a production token, for testing and production, respectively. + +Configuration for development +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +```Python +PAYMENT_VARIANTS = { + # ... + 'MercadoPago':('payments_mercadopago.MercadoPagoProvider',{ + 'access_token': 'MERCADO_PAGO_SANDBOX_ACCESS_TOKEN', + 'sandbox_mode: True}) +} + +CHECKOUT_PAYMENT_CHOICES = [('MercadoPago', 'Mercado Pago')] +``` + +If you have any problem using localhost urls as the return value of get_failure_url() or get_success_url() methods try using [ngrok](https://ngrok.com/) instead. + +Configuration for production +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ```Python PAYMENT_VARIANTS = { # ... 'MercadoPago':('payments_mercadopago.MercadoPagoProvider',{ 'access_token': 'MERCADO_PAGO_ACCESS_TOKEN', - 'init_point': 'sandbox_init_point'}) + 'sandbox_mode: False}) } CHECKOUT_PAYMENT_CHOICES = [('MercadoPago', 'Mercado Pago')] ``` -Mercado Pago doesn't require you to specify a sandbox endpoint, instead they provide you with a sandbox token and a production token, for testing and production, respectively. -You can get your own Mercado Pago production or sandbox access token in your [Mercado Pago developer panel](https://www.mercadopago.com.mx/developers/panel/credentials) +Obtaining the Tokens +-------------------- + +You can get your own Mercado Pago production and sandbox access tokens in your [Mercado Pago developer panel](https://www.mercadopago.com.mx/developers/panel/credentials) -Usage ------ +Documentation +------------- For detailed instructions on how to use django-payments please visit the official [django-payments documentation](https://django-payments.readthedocs.io/en/latest/)