diff --git a/app/controllers/checkout_controller.rb b/app/controllers/checkout_controller.rb index 884a5da2f4..77137f5940 100644 --- a/app/controllers/checkout_controller.rb +++ b/app/controllers/checkout_controller.rb @@ -138,9 +138,8 @@ class CheckoutController < Spree::CheckoutController render :edit and return end - redirect_to(main_app.shop_paypal_payment_url(@order, :payment_method_id => payment_method.id)) + render json: {path: main_app.paypal_payment_url(@order, :payment_method_id => payment_method.id)}, status: 200 true - end # Overriding to customize the cancel url diff --git a/app/views/spree/checkout/payment/_paypalexpress.html.haml b/app/views/spree/checkout/payment/_paypalexpress.html.haml new file mode 100644 index 0000000000..e69de29bb2 diff --git a/config/routes.rb b/config/routes.rb index d166116086..51826d6777 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -16,7 +16,7 @@ Openfoodnetwork::Application.routes.draw do get '/checkout', :to => 'checkout#edit' , :as => :checkout put '/checkout', :to => 'checkout#update' , :as => :update_checkout - get "/checkout/paypal_payment", to: 'checkout#paypal_payment', as: :paypal_payment + get '/checkout/paypal_payment/:order_id', to: 'checkout#paypal_payment', as: :paypal_payment resources :enterprises do collection do