Class: Spree::Admin::PaymentWingSdkBaseController

Inherits:
BaseController
  • Object
show all
Includes:
Backend::Callbacks
Defined in:
app/controllers/spree/admin/payment_wing_sdk_base_controller.rb

Instance Method Summary collapse

Instance Method Details

#load_paymentObject



16
17
18
# File 'app/controllers/spree/admin/payment_wing_sdk_base_controller.rb', line 16

def load_payment
  @payment = Payment.find_by!(number: params[:id])
end

#validate_orderObject



9
10
11
12
13
14
# File 'app/controllers/spree/admin/payment_wing_sdk_base_controller.rb', line 9

def validate_order
  if @payment.order.completed?
    flash[:error] = Spree.t('vpago.payments.not_allow_for_order_completed')
    redirect_to admin_order_payment_path(order_id: @payment.order.number, id: @payment.number)
  end
end