Class: PaymentMethod::MercadoPago

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

Instance Method Summary collapse

Instance Method Details

#actionsObject



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

def actions
  %w{capture void}
end

#can_capture?(payment) ⇒ Boolean

Indicates whether its possible to capture the payment

Returns:

  • (Boolean)


17
18
19
# File 'app/models/payment_method/mercado_pago.rb', line 17

def can_capture?(payment)
  ['checkout', 'pending'].include?(payment.state)
end

#can_void?(payment) ⇒ Boolean

Indicates whether its possible to void the payment.

Returns:

  • (Boolean)


22
23
24
# File 'app/models/payment_method/mercado_pago.rb', line 22

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

#capture(*args) ⇒ Object



26
27
28
# File 'app/models/payment_method/mercado_pago.rb', line 26

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

#payment_profiles_supported?Boolean

Returns:

  • (Boolean)


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

def payment_profiles_supported?
  false
end

#void(*args) ⇒ Object



30
31
32
# File 'app/models/payment_method/mercado_pago.rb', line 30

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