Class: SpreeAdyen::CapturePayloadPresenter
- Inherits:
-
Object
- Object
- SpreeAdyen::CapturePayloadPresenter
- Defined in:
- app/presenters/spree_adyen/capture_payload_presenter.rb
Constant Summary collapse
- REFERENCE_SUFFIX =
'capture'.freeze
Instance Method Summary collapse
-
#initialize(amount_in_cents:, payment:, payment_method:) ⇒ CapturePayloadPresenter
constructor
A new instance of CapturePayloadPresenter.
- #to_h ⇒ Object
Constructor Details
#initialize(amount_in_cents:, payment:, payment_method:) ⇒ CapturePayloadPresenter
Returns a new instance of CapturePayloadPresenter.
5 6 7 8 9 10 |
# File 'app/presenters/spree_adyen/capture_payload_presenter.rb', line 5 def initialize(amount_in_cents:, payment:, payment_method:) @amount_in_cents = amount_in_cents @payment = payment @order = payment.order @payment_method = payment_method end |
Instance Method Details
#to_h ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'app/presenters/spree_adyen/capture_payload_presenter.rb', line 12 def to_h { amount: { value: amount_in_cents, currency: payment.currency }, reference: reference, merchantAccount: payment_method.preferred_merchant_account }.merge!(SpreeAdyen::ApplicationInfoPresenter.new.to_h) end |