Payments - Ruby - Mercado Pago Developers
Which documentation are you looking for?

Do not know how to start integrating? 

Check the first steps

Create payment

You can create and add payment information using the SDK below. For details on request parameters, check the Create payment API.

Important
When executing the APIs mentioned in this documentation, you may come across the attribute X-Idempotency-Key. Filling it out is important to ensure the execution and reexecution of requests without undesirable situations, such as duplicate payments, for example.
          
require 'mercadopago'

sdk = Mercadopago::SDK.new('ENV_ACCESS_TOKEN')

custom_headers = {
 'x-idempotency-key': '<SOME_UNIQUE_VALUE>'
}

custom_request_options = Mercadopago::RequestOptions.new(custom_headers: custom_headers)

payment_request = {
  token: 'ff8080814c11e237014c1ff593b57b4d',
  installments: 1,
  transaction_amount: 100,
  payer: {
    type: 'customer',
    id: '123456789-jxOV430go9fx2e'
  }
}
payment_response = sdk.payment.create(payment_request, custom_request_options)
payment = payment_response[:response]