Class: Bodega::PaymentMethod::Base

Inherits:
Object
  • Object
show all
Extended by:
Optional
Defined in:
lib/bodega/payment_method/base.rb

Direct Known Subclasses

Paypal, Stripe

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(order) ⇒ Base

Returns a new instance of Base.



18
19
20
# File 'lib/bodega/payment_method/base.rb', line 18

def initialize(order)
  self.order = order
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



8
9
10
# File 'lib/bodega/payment_method/base.rb', line 8

def options
  @options
end

#orderObject

Returns the value of attribute order.



8
9
10
# File 'lib/bodega/payment_method/base.rb', line 8

def order
  @order
end

Instance Method Details

#checkout_url(success_url, cancel_url, params = {}) ⇒ Object



10
11
12
# File 'lib/bodega/payment_method/base.rb', line 10

def checkout_url(success_url, cancel_url, params = {})
  raise "Implement #{self.class.name}#checkout_url"
end

#complete!(options = {}) ⇒ Object



14
15
16
# File 'lib/bodega/payment_method/base.rb', line 14

def complete!(options = {})
  raise "Implement #{self.class.name}#complete!"
end

#shipping?Boolean

Does the payment method provide shipping details? If not, they’ll be editable at checkout.

Returns:

  • (Boolean)


24
25
26
# File 'lib/bodega/payment_method/base.rb', line 24

def shipping?
  true
end