Module: SpreeAdyen::BaseHelper

Defined in:
app/helpers/spree_adyen/base_helper.rb

Instance Method Summary collapse

Instance Method Details

#current_adyen_gatewayObject



3
4
5
# File 'app/helpers/spree_adyen/base_helper.rb', line 3

def current_adyen_gateway
  @current_adyen_gateway ||= current_store.adyen_gateway
end

#current_adyen_payment_sessionObject



7
8
9
10
11
12
13
14
15
16
# File 'app/helpers/spree_adyen/base_helper.rb', line 7

def current_adyen_payment_session
  return if current_adyen_gateway.nil?

  @current_adyen_payment_session ||= SpreeAdyen::PaymentSessions::FindOrCreate.new(
    order: @order,
    amount: @order.total_minus_store_credits,
    user: @order.user,
    payment_method: current_adyen_gateway
  ).call&.value
end