Class: SpreeAdyen::CheckoutPresenter
- Inherits:
-
Object
- Object
- SpreeAdyen::CheckoutPresenter
- Defined in:
- app/presenters/spree_adyen/checkout_presenter.rb
Overview
use this serializer to configure the Adyen Drop-in component docs.adyen.com/online-payments/build-your-integration/sessions-flow/?platform=Web&integration=Drop-in&version=6.18.1&tab=embed_script_and_stylesheet_1_2#configure
Instance Method Summary collapse
-
#initialize(payment_session) ⇒ CheckoutPresenter
constructor
A new instance of CheckoutPresenter.
- #to_h ⇒ Object
- #to_json(*_args) ⇒ Object
Constructor Details
#initialize(payment_session) ⇒ CheckoutPresenter
Returns a new instance of CheckoutPresenter.
5 6 7 |
# File 'app/presenters/spree_adyen/checkout_presenter.rb', line 5 def initialize(payment_session) @payment_session = payment_session end |
Instance Method Details
#to_h ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'app/presenters/spree_adyen/checkout_presenter.rb', line 13 def to_h @to_h ||= { session: { id: payment_session.adyen_id, sessionData: payment_session.adyen_data }, environment: payment_session.payment_method.environment, amount: { value: Spree::Money.new(payment_session.amount, currency: currency).cents, currency: currency }, countryCode: country_iso, locale: locale, clientKey: payment_session.payment_method.preferred_client_key, showPayButton: true } end |
#to_json(*_args) ⇒ Object
9 10 11 |
# File 'app/presenters/spree_adyen/checkout_presenter.rb', line 9 def to_json(*_args) @to_json ||= to_h.to_json end |