Sha256: 4f137ad0167f3316b271114a3355f8a779af04e74bd254e0f16c2c2fdb4cab04

Contents?: true

Size: 536 Bytes

Versions: 1

Compression:

Stored size: 536 Bytes

Contents

module Spree
  CheckoutController.class_eval do
    before_filter :coinbase_redirect, :only => [:update]

    private
    def coinbase_redirect
      return unless (params[:state] == "payment") && params[:order][:payments_attributes]

      payment_method = PaymentMethod.find(params[:order][:payments_attributes].first[:payment_method_id])
      if payment_method.kind_of?(Spree::PaymentMethod::Coinbase)
        redirect_to spree_coinbase_redirect_url(:payment_method_id => payment_method.id)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree_coinbase-2.2.0.1 app/controllers/spree/checkout_controller_decorator.rb