Skip to content

HTTP Wrapper for Mercado Pago's API πŸŒπŸ’΅πŸ”„

License

Notifications You must be signed in to change notification settings

nardonykolyszyn/mercadopago-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

44 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Mercado Pago Gem

Index

  • API end-points
    • Clients
      • Search a customer by email
      • Search a customer by any criteria
      • Create a customer
      • Remove customer
      • Update customer
    • Cards
      • Retrieve

Installation

  $ gem install mercadopago-ruby
  require 'mercadopago'

Clients

  • Get a customer by email
  @client = MercadoPago::API::Clients.new(access_token: ACCESS_TOKEN)
  @client.search_customers_by_email('[email protected]')
  • Get a customer by any criteria
  @client.search_by(first_name: 'Peter Khaule')
  • Create a new customer
  @client.create_customer(email: '[email protected]')
  • Remove customer
  @client.remove_customer(CUSTOMER_ID)
  • Update customer
 payload = {
   first_name: 'Peter Khaule'
 }
 @client.update_customer(CUSTOMER_ID, payload)

Cards

Mercado Pago provides credit cards to being used in the sandbox environment. See list

  • Adding a new card Cards should be added using the official Mercado Pago's JS SDK, because risky data should not go through our Backend side, instead, Mercado Pago will return a card_token attribute which you can be used to add a new card to an existing customer. How to create a new card
  • Add a card to an existing customer Once you have your card_token and you customer_id you can associate both, in this way adding a card to an existing customer.
     @client = MercadoPago::API::Cards.new(access_token: ACCESS_TOKEN)
     @client.add_card_to_customer(CUSTOMER_ID, CARD_TOKEN)
  • Retrieve customer cards
      @client.retrieve_customer_cards(CUSTOMER_ID)

About

HTTP Wrapper for Mercado Pago's API πŸŒπŸ’΅πŸ”„

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages