/solidus_mercado_pago

A way to include Mercado Pago (Argentinian/Brazilian) payment method in Solidus

Primary LanguageRubyBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Solidus Mercado Pago Payment Method.

Gem Version Build Status Maintainability Test Coverage Dependency Status

This project is a fork from spree version maintained by manuca, which is compatible with spree 3.2.0 and Rails 5.

gem 'solidus_mercado_pago', git: "git@github.com:ngelx/solidus_mercado_pago.git"

You should run inside your project

bundle exec rails g solidus_mercado_pago:install

This will import assets and migrations

Configuration

config/secrets.yml

development:
  secret_key_base: ...
  mercadopago:
    client_id: <client id from mercadopago>
    client_secret: <client secret from mercadopago>
    sandbox: true | false

Usage

  • Add a new payment method in the admin panel of type Spree::PaymentMethod::MercadoPago
  • After adding the payment method you will be able to configure your Client ID and Client Secret (provided by Mercado Pago).

IPN

For IPN you need to configure the notification URL in Mercado Pago's site. The notification URL will be http[s]://[your_domain]/mercado_pago/ipn. Please review Mercado Pago's documentation at http://developers.mercadopago.com/ for the correct place where to configure IPN notification URLs.

Testing

  • Clone this repo
  • ln -s docker-compose-{platform}.yml docker-compose.yml
  • docker-sync start Only in mac
  • docker-compose up
  • docker-compose run web bundle exec rake test_app to build a dummy app directory inside specs
  • docker-compose run web bundle exec rspec spec