Class: Spree::Admin::PaymentPaywayQueriersController

Inherits:
PaymentPaywayBaseController show all
Includes:
Backend::Callbacks
Defined in:
app/controllers/spree/admin/payment_payway_queriers_controller.rb

Instance Method Summary collapse

Methods inherited from PaymentPaywayBaseController

#load_payment, #model_class, #validate_order

Instance Method Details

#showObject



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/spree/admin/payment_payway_queriers_controller.rb', line 8

def show
  tran_status = @payment.payment_method.check_transaction(@payment)

  if tran_status.success?
    @payment.update_column(:gateway_status, true)
    flash[:success] =
      Spree.t('vpago.payments.payment_found_with_result', result: tran_status.json_response)
  else
    flash[:error] = Spree.t('vpago.payments.payment_not_found_with_error', error: tran_status.error_message)
  end

  redirect_to admin_order_payment_path(order_id: @payment.order.number, id: @payment.number)
end