Class: Stall::PaymentNotificationService
- Inherits:
-
BaseService
- Object
- BaseService
- Stall::PaymentNotificationService
- Defined in:
- app/services/stall/payment_notification_service.rb
Defined Under Namespace
Classes: UnknownNotificationError
Instance Attribute Summary collapse
-
#gateway_identifier ⇒ Object
readonly
Returns the value of attribute gateway_identifier.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(gateway_identifier, request) ⇒ PaymentNotificationService
constructor
A new instance of PaymentNotificationService.
- #rendering_options ⇒ Object
Constructor Details
#initialize(gateway_identifier, request) ⇒ PaymentNotificationService
Returns a new instance of PaymentNotificationService.
7 8 9 10 |
# File 'app/services/stall/payment_notification_service.rb', line 7 def initialize(gateway_identifier, request) @gateway_identifier = gateway_identifier @request = request end |
Instance Attribute Details
#gateway_identifier ⇒ Object (readonly)
Returns the value of attribute gateway_identifier.
5 6 7 |
# File 'app/services/stall/payment_notification_service.rb', line 5 def gateway_identifier @gateway_identifier end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
5 6 7 |
# File 'app/services/stall/payment_notification_service.rb', line 5 def request @request end |
Instance Method Details
#call ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'app/services/stall/payment_notification_service.rb', line 12 def call if gateway_response.valid? validate_cart! if gateway_response.process else raise UnknownNotificationError, "The payment notification request does not seem to come from " + "the \"#{ gateway_identifier }\" gateway." end end |
#rendering_options ⇒ Object
22 23 24 |
# File 'app/services/stall/payment_notification_service.rb', line 22 def gateway_response. end |