Class: MercadoPago::BaseAction

Inherits:
Object
  • Object
show all
Defined in:
lib/mercado_pago/actions/base_action.rb

Instance Method Summary collapse

Constructor Details

#initializeBaseAction

Returns a new instance of BaseAction.



7
8
9
# File 'lib/mercado_pago/actions/base_action.rb', line 7

def initialize
  self.rest_client = Blanket.wrap("https://api.mercadopago.com/v1/", params: {access_token: MercadoPago.configuration.access_token}, headers: {'Content-Type' =>'application/json'})
end

Instance Method Details

#runObject



11
12
13
14
# File 'lib/mercado_pago/actions/base_action.rb', line 11

def run
  perform
  OpenStruct.new(success?: !has_errors?, advanced_payment: result_payment, errors: errors)
end