Class: Stall::CartPaymentValidationService

Inherits:
BaseService
  • Object
show all
Defined in:
app/services/stall/cart_payment_validation_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cart) ⇒ CartPaymentValidationService

Returns a new instance of CartPaymentValidationService.



5
6
7
# File 'app/services/stall/cart_payment_validation_service.rb', line 5

def initialize(cart)
  @cart = cart
end

Instance Attribute Details

#cartObject (readonly)

Returns the value of attribute cart.



3
4
5
# File 'app/services/stall/cart_payment_validation_service.rb', line 3

def cart
  @cart
end

Instance Method Details

#callObject



9
10
11
12
13
14
15
16
17
# File 'app/services/stall/cart_payment_validation_service.rb', line 9

def call
  cart.payment.pay!
  send_payment_notification_emails!
  create_credit_notes!

  # Always return true since errors should have raised if anything got
  # wrong.
  true
end