Class: Spree::SolidusSixSaferpay::ProcessAuthorizedPayment
- Inherits:
-
Object
- Object
- Spree::SolidusSixSaferpay::ProcessAuthorizedPayment
- Defined in:
- app/services/spree/solidus_six_saferpay/process_authorized_payment.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#order ⇒ Object
readonly
Returns the value of attribute order.
-
#saferpay_payment ⇒ Object
readonly
Returns the value of attribute saferpay_payment.
-
#success ⇒ Object
readonly
Returns the value of attribute success.
-
#user_message ⇒ Object
readonly
Returns the value of attribute user_message.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
- #gateway ⇒ Object
-
#initialize(saferpay_payment) ⇒ ProcessAuthorizedPayment
constructor
A new instance of ProcessAuthorizedPayment.
- #success? ⇒ Boolean
Constructor Details
#initialize(saferpay_payment) ⇒ ProcessAuthorizedPayment
Returns a new instance of ProcessAuthorizedPayment.
11 12 13 14 |
# File 'app/services/spree/solidus_six_saferpay/process_authorized_payment.rb', line 11 def initialize(saferpay_payment) @saferpay_payment = saferpay_payment @order = saferpay_payment.order end |
Instance Attribute Details
#order ⇒ Object (readonly)
Returns the value of attribute order.
5 6 7 |
# File 'app/services/spree/solidus_six_saferpay/process_authorized_payment.rb', line 5 def order @order end |
#saferpay_payment ⇒ Object (readonly)
Returns the value of attribute saferpay_payment.
5 6 7 |
# File 'app/services/spree/solidus_six_saferpay/process_authorized_payment.rb', line 5 def saferpay_payment @saferpay_payment end |
#success ⇒ Object (readonly)
Returns the value of attribute success.
5 6 7 |
# File 'app/services/spree/solidus_six_saferpay/process_authorized_payment.rb', line 5 def success @success end |
#user_message ⇒ Object (readonly)
Returns the value of attribute user_message.
5 6 7 |
# File 'app/services/spree/solidus_six_saferpay/process_authorized_payment.rb', line 5 def @user_message end |
Class Method Details
.call(saferpay_payment) ⇒ Object
7 8 9 |
# File 'app/services/spree/solidus_six_saferpay/process_authorized_payment.rb', line 7 def self.call(saferpay_payment) new(saferpay_payment).call end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'app/services/spree/solidus_six_saferpay/process_authorized_payment.rb', line 16 def call check_liability_shift_requirements! validate_payment! # SUCCESS! cancel_old_solidus_payments saferpay_payment.create_solidus_payment! @success = true self rescue ::SolidusSixSaferpay::InvalidSaferpayPayment => e cancel_saferpay_payment @user_message = e. @success = false self end |
#gateway ⇒ Object
41 42 43 |
# File 'app/services/spree/solidus_six_saferpay/process_authorized_payment.rb', line 41 def gateway raise NotImplementedError, "Must be implemented in ProcessPaymentPagePayment or ProcessTransactionPayment" end |
#success? ⇒ Boolean
37 38 39 |
# File 'app/services/spree/solidus_six_saferpay/process_authorized_payment.rb', line 37 def success? @success end |