Class: Spree::Webhook::AcledasController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/webhook/acledas_controller.rb

Instance Method Summary collapse

Instance Method Details

#errorObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'app/controllers/spree/webhook/acledas_controller.rb', line 23

def error
  order = @payment.order

  if order.paid?
    flash[:order_completed] = '1' # required by order_just_completed for purchase tracking
  end

  pending_or_paid = order.paid? || @payment.pending?
  if params[:app_checkout].to_s == '1'
    redirect_to pending_or_paid ? success_payway_results_path : failed_payway_results_path
  else
    redirect_to pending_or_paid ? order_path(order) : checkout_state_path(:payment)
  end
end

#returnObject

call back after transaction complete at acleda system “15.0”, “_transactionid”=>“PJ9ETZD4”, “_paymentresult”=>“SUCCESS”, “_paymenttokenid”=>“lVqWKcLHVk6s0rIgk/T8Vdbzsg0=”, “_resultCode”=>“0”



12
13
14
15
# File 'app/controllers/spree/webhook/acledas_controller.rb', line 12

def return
  render_plain = true
  check_and_redirect(render_plain)
end

#successObject

success “_transactionid”=>“PJ9ETZD4”, “_paymentresult”=>“SUCCESS”, “_paymenttokenid”=>“lVqWKcLHVk6s0rIgk/T8Vdbzsg0=”, “_resultCode”=>“0”, “controller”=>“spree/webhook/acledas”, “action”=>“success”



19
20
21
# File 'app/controllers/spree/webhook/acledas_controller.rb', line 19

def success
  check_and_redirect
end