better_spree_paypal_express
better_spree_paypal_express copied to clipboard
Allow configuration of confirmation step
Currently it's hardcoded to have confirmation on the PayPal checkout. There should be a configuration option to allow us to specify whether or not the confirmation happens on PayPal or happens on Spree.
If it happens on PayPal, then the user sees a "Pay Now" button on PayPal and then is immediately taken to the complete order page.
If it happens on Spree, then the user sees a "Continue" button on PayPal and is taken to the order confirmation page on Spree. From there, they click "Place Order" and then they're shown the complete order page.
This is the useraction
option within PayPalController
which is handling this.
i am trying to do it. should the preference set in a initializer, or in the controller?
The preference should be set along with the other gateway preferences in the admin backend. There is no initializer override for these preferences yet.
If you do implement this feature, please ensure that there is a test that when this feature is turned on that the confirmation happens on the PayPal side. Also ensure that there is a test that makes sure that confirmation on the Spree side works.
Thank you.
well I am still thinking about doing it, but testing the paypal side, I have no clue about how to do it, and think it is too much. can we make the problem somehow simpler so that we can start working on it? I mean for our eshop with this single line of code it works fine: https://github.com/keevee/better_spree_paypal_express/commit/dee51b91de95a21688a4f8c38f97d26304f6cd28
so can we agree on just having a simple preference for it?
@azinazadi You will need to sign up for a developer account, which is covered in this project's README. From there, you should be able to write a feature spec which covers the situation that you're trying to fix.
any update on this? under german law we need the checkout confirmation to be on our site and not in paypal. but if you guys haven't been able to figure this out then i don't think i will be able to put together a patch that allows for that. i might have to switch to a different payments provider afterall
Dear @patrickdet it is definitely possible and not very complicated if you are somehow a rails programmer. in our case we did it with a simple patch which you can see it 3 comments above.
we didnt go through making a configuration variable and spec, as we finished with the project. maybe you can do it. that would be great.
@azinazadi and @patrickdet,
Whats the status of this. Is someone submitting a PR?
@jspizziri im not working on this project anymore. if you are experienced little bit you can make it in couple of hours...
I ran into the opposite of this problem: https://github.com/spree-contrib/better_spree_paypal_express/issues/34
Here's what I modified in the paypal_controller.rb:
if pp_response.success?
if Spree::Config[:always_include_confirm_step] == true
redirect_to provider.express_checkout_url(pp_response)
else
redirect_to provider.express_checkout_url(pp_response, :useraction => 'commit')
end
else
I human-tested it with the confirm step enabled and disabled in spree 2.4. It works fine.