Class: MercadoPago::BaseAction
- Inherits:
-
Object
- Object
- MercadoPago::BaseAction
- Defined in:
- lib/mercado_pago/actions/base_action.rb
Direct Known Subclasses
CreateAdvancedPayment, RefundAdvancedPayment, SearchAdvancedPayment
Instance Method Summary collapse
-
#initialize ⇒ BaseAction
constructor
A new instance of BaseAction.
- #run ⇒ Object
Constructor Details
#initialize ⇒ BaseAction
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
#run ⇒ Object
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 |