fix error on paypal redirect after checkout
This commit is contained in:
parent
481f8099af
commit
3369b39341
|
|
@ -11,7 +11,7 @@ class ApiPayPalController < ApiController
|
||||||
|
|
||||||
def start_checkout
|
def start_checkout
|
||||||
#cancel_path = params[:path] ? params[:path] : ERB::Util.url_encode('/client#/checkoutPayment')
|
#cancel_path = params[:path] ? params[:path] : ERB::Util.url_encode('/client#/checkoutPayment')
|
||||||
cancel_url = params[:path] ? params[:path] : ERB::Util.url_encode(ApplicationHelper.spa_base_uri(request) + '/checkout')
|
cancel_url = params[:path] ? params[:path] : ERB::Util.url_encode(ApplicationHelper.spa_base_uri + '/checkout')
|
||||||
|
|
||||||
tax = true
|
tax = true
|
||||||
tax_rate = tax ? 0.0825 : 0
|
tax_rate = tax ? 0.0825 : 0
|
||||||
|
|
@ -27,7 +27,8 @@ class ApiPayPalController < ApiController
|
||||||
:Version => "117.0",
|
:Version => "117.0",
|
||||||
:SetExpressCheckoutRequestDetails =>
|
:SetExpressCheckoutRequestDetails =>
|
||||||
{
|
{
|
||||||
:ReturnURL => ApplicationHelper.spa_base_uri(request) + '/checkout/paypal/confirm',
|
#:ReturnURL => ApplicationHelper.spa_base_uri + '/checkout/paypal/confirm',
|
||||||
|
:ReturnURL => ApplicationHelper.base_uri(request) + '/auth/paypal/checkout',
|
||||||
:CancelURL => cancel_url,
|
:CancelURL => cancel_url,
|
||||||
# :NoShipping => "1",
|
# :NoShipping => "1",
|
||||||
# :ReqConfirmShipping => "0",
|
# :ReqConfirmShipping => "0",
|
||||||
|
|
|
||||||
|
|
@ -358,7 +358,7 @@ class ApiUsersController < ApiController
|
||||||
# end
|
# end
|
||||||
|
|
||||||
def request_reset_password
|
def request_reset_password
|
||||||
User.reset_password(current_user.email, ApplicationHelper.spa_base_uri(request))
|
User.reset_password(current_user.email, ApplicationHelper.spa_base_uri)
|
||||||
respond_with current_user, responder: ApiResponder, :status => 200
|
respond_with current_user, responder: ApiResponder, :status => 200
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,8 @@ class SessionsController < ApplicationController
|
||||||
# on failure, cancel=1
|
# on failure, cancel=1
|
||||||
|
|
||||||
if params[:cancel] == '1' || params[:cancel] == 1
|
if params[:cancel] == '1' || params[:cancel] == 1
|
||||||
redirect_to params[:path] ? params[:path] : ApplicationHelper.spa_base_uri(request) + '/jamtracks'
|
#redirect_to params[:path] ? params[:path] : '/client#/jamtrack'
|
||||||
|
redirect_to params[:path] ? params[:path] : ApplicationHelper.spa_base_uri
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -86,7 +87,7 @@ class SessionsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
#redirect_to '/client#/paypal/confirm'
|
#redirect_to '/client#/paypal/confirm'
|
||||||
redirect_to ApplicationHelper.spa_base_uri(request) + '/checkout/paypal/confirm'
|
redirect_to ApplicationHelper.spa_base_uri + '/checkout/paypal/confirm'
|
||||||
end
|
end
|
||||||
|
|
||||||
# OAuth docs
|
# OAuth docs
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ module ApplicationHelper
|
||||||
(request.ssl? ? "https://" : "http://") + request.host_with_port
|
(request.ssl? ? "https://" : "http://") + request.host_with_port
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.spa_base_uri(request)
|
def self.spa_base_uri
|
||||||
Rails.application.config.spa_origin_url
|
Rails.application.config.spa_origin_url
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue