Class: EffectiveOrders::AppCheckoutService

Inherits:
Object
  • Object
show all
Defined in:
lib/effective_orders/app_checkout_service.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(order) ⇒ AppCheckoutService

Returns a new instance of AppCheckoutService.



9
10
11
# File 'lib/effective_orders/app_checkout_service.rb', line 9

def initialize(order)
  @order = order
end

Instance Attribute Details

#orderObject (readonly)

Returns the value of attribute order.



7
8
9
# File 'lib/effective_orders/app_checkout_service.rb', line 7

def order
  @order
end

Class Method Details

.call(order:) ⇒ Object



3
4
5
# File 'lib/effective_orders/app_checkout_service.rb', line 3

def self.call(order:)
  new(order).tap(&:call)
end

Instance Method Details

#callObject

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/effective_orders/app_checkout_service.rb', line 13

def call
  raise NotImplementedError, "overwrite the `call` instance method in #{self.class}"
end

#payment_detailsObject

A Hash or easily serializable object like a String



22
23
# File 'lib/effective_orders/app_checkout_service.rb', line 22

def payment_details
end

#success?Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


17
18
19
# File 'lib/effective_orders/app_checkout_service.rb', line 17

def success?
  raise NotImplementedError, "overwrite the `success?` instance method in #{self.class}"
end