Sha256: f401689f5873546e11238d4c85c993366ac95ec47c8e74dd164afdbac4274453
Contents?: true
Size: 631 Bytes
Versions: 8
Compression:
Stored size: 631 Bytes
Contents
module Spree module CheckoutControllerDecorator def self.prepended(base) base.before_action :process_payments_and_set_keys, only: :edit, if: proc { params[:state] == 'payment_confirm' } end def process_payments_and_set_keys @order.tap do |order| order.process_payments! order.reload.payments.valid.where.not(intent_client_key: nil).last.tap do |payment| @client_secret = payment.intent_client_key @pk_key = payment.payment_method.preferred_publishable_key end end end end end ::Spree::CheckoutController.prepend Spree::CheckoutControllerDecorator
Version data entries
8 entries across 8 versions & 2 rubygems