Class: SolidusBolt::PaymentMethod

Inherits:
Object
  • Object
show all
Defined in:
app/models/solidus_bolt/payment_method.rb

Instance Method Summary collapse

Instance Method Details

#gateway_classObject



9
10
11
# File 'app/models/solidus_bolt/payment_method.rb', line 9

def gateway_class
  ::SolidusBolt::Gateway
end

#partial_nameObject



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

def partial_name
  'bolt'
end

#payment_source_classObject



13
14
15
# File 'app/models/solidus_bolt/payment_method.rb', line 13

def payment_source_class
  ::SolidusBolt::PaymentSource
end

#preferred_bolt_api_urlObject



25
26
27
# File 'app/models/solidus_bolt/payment_method.rb', line 25

def preferred_bolt_api_url
  bolt_config.environment_url
end

#preferred_bolt_base_urlObject



21
22
23
# File 'app/models/solidus_bolt/payment_method.rb', line 21

def preferred_bolt_base_url
  bolt_config.embed_js
end

#try_void(payment) ⇒ Object



29
30
31
32
33
# File 'app/models/solidus_bolt/payment_method.rb', line 29

def try_void(payment)
  return false unless payment.source.can_void?(payment)

  gateway.void(payment.response_code, originator: payment)
end