Class: PaymentMethod::MercadoPago

Inherits:
PaymentMethod
  • Object
show all
Defined in:
app/models/spree/payment_method/mercado_pago.rb

Instance Method Summary collapse

Instance Method Details

#actionsObject



38
39
40
# File 'app/models/spree/payment_method/mercado_pago.rb', line 38

def actions
  %w{void}
end

#auto_capture?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'app/models/spree/payment_method/mercado_pago.rb', line 28

def auto_capture?
  false
end

#can_void?(payment) ⇒ Boolean

Admin options

Returns:

  • (Boolean)


34
35
36
# File 'app/models/spree/payment_method/mercado_pago.rb', line 34

def can_void?(payment)
  payment.state != 'void'
end

#payment_profiles_supported?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'app/models/spree/payment_method/mercado_pago.rb', line 7

def payment_profiles_supported?
  false
end

#provider(additional_options = {}) ⇒ Object



15
16
17
18
19
20
21
22
# File 'app/models/spree/payment_method/mercado_pago.rb', line 15

def provider(additional_options = {})
  @provider ||= begin
                  options = { sandbox: preferred_sandbox }
                  client = provider_class.new(self, options.merge(additional_options))
                  client.authenticate
                  client
                end
end

#provider_classObject



11
12
13
# File 'app/models/spree/payment_method/mercado_pago.rb', line 11

def provider_class
  ::MercadoPago::Client
end

#source_required?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'app/models/spree/payment_method/mercado_pago.rb', line 24

def source_required?
  false
end

#void(*args) ⇒ Object



42
43
44
# File 'app/models/spree/payment_method/mercado_pago.rb', line 42

def void(*args)
  ActiveMerchant::Billing::Response.new(true, "", {}, {})
end