From 010c1c799d2f1dd9a2468b71ae72bd30b8604122 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Wed, 18 Nov 2020 14:55:29 +0000 Subject: [PATCH] Add some notes on paypal checkout flow --- app/controllers/spree/paypal_controller_decorator.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/controllers/spree/paypal_controller_decorator.rb b/app/controllers/spree/paypal_controller_decorator.rb index a012978600..e454442a36 100644 --- a/app/controllers/spree/paypal_controller_decorator.rb +++ b/app/controllers/spree/paypal_controller_decorator.rb @@ -40,6 +40,9 @@ Spree::PaypalController.class_eval do begin pp_response = provider.set_express_checkout(pp_request) if pp_response.success? + # At this point Paypal has *provisionally* accepted that the payment can now be placed, + # and the user will be redirected to a Paypal payment page. On completion, the user is + # sent back and the response is handled in the #confirm action in this controller. redirect_to provider.express_checkout_url(pp_response, useraction: 'commit') else flash[:error] = Spree.t('flash.generic_error', scope: 'paypal', reasons: pp_response.errors.map(&:long_message).join(" "))