Class: PaymentMethod::MercadoPago
- Inherits:
-
PaymentMethod
- Object
- PaymentMethod
- PaymentMethod::MercadoPago
- Defined in:
- app/models/spree/payment_method/mercado_pago.rb
Instance Method Summary collapse
- #actions ⇒ Object
- #auto_capture? ⇒ Boolean
-
#can_void?(payment) ⇒ Boolean
Admin options.
- #payment_profiles_supported? ⇒ Boolean
- #provider(additional_options = {}) ⇒ Object
- #provider_class ⇒ Object
- #source_required? ⇒ Boolean
- #void(*args) ⇒ Object
Instance Method Details
#actions ⇒ Object
38 39 40 |
# File 'app/models/spree/payment_method/mercado_pago.rb', line 38 def actions %w{void} end |
#auto_capture? ⇒ 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
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
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( = {}) @provider ||= begin = { sandbox: preferred_sandbox } client = provider_class.new(self, .merge()) client.authenticate client end end |
#provider_class ⇒ Object
11 12 13 |
# File 'app/models/spree/payment_method/mercado_pago.rb', line 11 def provider_class ::MercadoPago::Client end |
#source_required? ⇒ 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 |