module MercadoPago::Collection

Public Class Methods

notification(access_token, payment_id, sandbox = false) click to toggle source

Receives an access_token and a payment id and retrieves information of the payment. This is useful, for example, to check the status of a payment.

  • access_token: an access_token of the MercadoPago account associated with the payment to be checked.

  • payment_id: the id of the payment to be checked.

  • sandbox: whether or not the sandbox mode should be activated.

# File lib/mercadopago/collection.rb, line 14
def self.notification(access_token, payment_id, sandbox = false)
  uri_prefix = sandbox ? '/sandbox' : ''
  MercadoPago::Request.wrap_get("#{uri_prefix}/collections/notifications/#{payment_id}?access_token=#{access_token}", { accept: 'application/json' })
end
notification_authorized(access_token, authorized_id) click to toggle source
  • access_token: an access_token of the MercadoPago account associated with the payment to be checked.

  • authorized_id: the id of the authorized payment to be checked.

# File lib/mercadopago/collection.rb, line 23
def self.notification_authorized(access_token, authorized_id)
  MercadoPago::Request.wrap_get("/authorized_payments/#{authorized_id}?access_token=#{access_token}", { accept: 'application/json' })
end
notification_preapproval(access_token, preapproval_id) click to toggle source
  • access_token: an access_token of the MercadoPago account associated with the payment to be checked.

  • preapproval_id: the id of the recurring payment to be checked.

# File lib/mercadopago/collection.rb, line 31
def self.notification_preapproval(access_token, preapproval_id)
  MercadoPago::Request.wrap_get("/preapproval/#{preapproval_id}?access_token=#{access_token}", { accept: 'application/json' })
end