Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to complete abandoned/pending purchases #2714

Closed
evertiro opened this issue Oct 13, 2014 · 75 comments
Closed

Add option to complete abandoned/pending purchases #2714

evertiro opened this issue Oct 13, 2014 · 75 comments

Comments

@evertiro
Copy link

Users should be able to complete abandoned/pending purchases on subsequent visits. In order to facilitate this, a status of 'processing' should be added which will be used by eChecks instead of the 'pending' status used now. This will allow pending purchases to be completed without risking affecting eCheck purchases which are pending processing.

@pippinsplugins has indicated that WooCommerce does this well and we should take inspiration from them.

@pippinsplugins
Copy link
Contributor

Should be a great feature for v2.3

@evertiro
Copy link
Author

Blah... more annoying than I thought. Might need a hand with this one.

@pippinsplugins
Copy link
Contributor

Have you looked at how Woo does it yet?

@evertiro
Copy link
Author

evertiro commented Dec 1, 2014

Yes

@pippinsplugins
Copy link
Contributor

Okay . . . and do you still need a hand? Help me help you.

@pippinsplugins
Copy link
Contributor

Let's hold off on this until #2667 is completed so that we are not refactoring payment creation / updates twice.

@danieliser
Copy link
Contributor

Isn't this partially already covered by several extensions aimed at recovering them? Maybe would be well suited as a feature for those plugins instead. Like the idea to clean up the pending transfers though.

Also consider starting down the path with this will likely eventually result in those extensions being merged into core as first comes showing people those transactions next comes reminding them by email since that would be a simple step with this in place as well.

@pippinsplugins
Copy link
Contributor

No, not really. The current extensions generate new purchase records. We want to complete the existing pending record.

@danieliser
Copy link
Contributor

Oh sorry, I was under the assumption from their descriptions that they took abandoned and pending carts and notified users to come back to finish them.

@pippinsplugins
Copy link
Contributor

They do notify them but they just recreate the purchase.

On Sun, Jan 18, 2015 at 7:06 PM, Daniel Iser notifications@github.com
wrote:

Oh sorry, I was under the assumption from their descriptions that they
took abandoned and pending carts and notified users to come back to finish
them.


Reply to this email directly or view it on GitHub
#2714 (comment)
.

@danieliser
Copy link
Contributor

Ok then ignore my previous statements.

@pippinsplugins pippinsplugins modified the milestones: 2.4, 2.3 Feb 10, 2015
@KingYes
Copy link
Contributor

KingYes commented Mar 22, 2015

@pippinsplugins: For now, can I continue pending purchase manually?

@pippinsplugins
Copy link
Contributor

@KingYes yes

@KingYes
Copy link
Contributor

KingYes commented Mar 23, 2015

How?

@pippinsplugins
Copy link
Contributor

Oh, sorry, I just reread what you wrote.

No, that's not supported yet.

@KingYes
Copy link
Contributor

KingYes commented Mar 23, 2015

Okay.
Do you know when it's will be supported?

@pippinsplugins
Copy link
Contributor

Not yet.

On Mon, Mar 23, 2015 at 9:57 AM, Yakir Sitbon notifications@github.com
wrote:

Okay.
Do you know when it's will be supported?


Reply to this email directly or view it on GitHub
#2714 (comment)
.

@pippinsplugins
Copy link
Contributor

This is too large of a feature to finish up for 2.4 since we're just a few days away from beta. Punting to 2.5.

@pippinsplugins
Copy link
Contributor

👍

@SeanTOSCD
Copy link
Contributor

The UI/UX is looking and functioning wonderfully for me. I did try to complete a pending purchase through PayPal Standard, though, and everything seems to work fine until I'm sent back to my site. The payment is still pending and all the new UI for completing the purchase is still there.

screenshot 2017-01-17 10 35 08

No one else is experiencing this?

@cklosowski
Copy link
Contributor

@SDavisMedia that's because PayPal standard requires that IPN pings your store to complete the purchase...and doesn't get a TXN ID until that happens. If you try and complete with a gateway that doesn't require IPN (like stripe) does it work as you expect...or test gateway?

@SeanTOSCD
Copy link
Contributor

Definitely works if I complete the recovery purchase with Stripe.

@cklosowski
Copy link
Contributor

Thanks @SDavisMedia How we feeling here @easydigitaldownloads/core-devs, those that have tested, thinking we're in a good spot here?

@pippinsplugins
Copy link
Contributor

Thought of something last night we need to support here.

  1. Add items to your cart
  2. Go to checkout and use PayPal Standard
  3. At payPal click the back button (not cancel and return but the actual browser back button)
  4. Cart will now be empty

Let's do the following:

  1. Not empty the cart on submission to PayPal
  2. Set the pending payment in the session to ID an in-process payment
  3. Not emptying the cart means clicking back button will work and will show the existing cart contents
  4. Empty the cart when we receive the payment-processing template upon redirect from PayPal

@SeanTOSCD
Copy link
Contributor

From a UI/UX perspective, that definitely couldn't hurt anything. If it's possible, I think we should definitely do it. In fact, I'm pretty sure there have been a ton of tickets about it... more so in the past.

@cklosowski
Copy link
Contributor

@pippinsplugins I set it so that the cart is emptied when viewing the PayPal purchase confirmation. Clicking the back button, while it will provide the user with the cart they had before, will create a pending payment though, that isn't recoverable...

If they Go to paypal, click the back button, and then go to paypal again, they'll have 2 EDD payments, since they didn't enter the recovery process, they just clicked the back button, which in some cases, the browser never even hits the server for, just pings the local storage memory for it. So by allowing the back button, we could create more confusion, I think, as now we hve multiple orders for customers, one pending (or processing, I think is what you were tryign to say?) and one complete if they process it the 2nd time.

@pippinsplugins
Copy link
Contributor

Any reason we couldn't go ahead and set it as in recovery as soon as the customer goes to PayPal? That way if they click back, the payment ID in session is detected?

@cklosowski
Copy link
Contributor

We can, however since the browser isn't actually re-polling the server or cookie data, there is a pretty high chance that it won't even re-read the cookie variable. I'll work it up to do that, however it cannot be guaranteed, so we'll have to play with it.

@cklosowski
Copy link
Contributor

Ok @pippinsplugins fixed that up. It seems to work fine in Chrome at least with the tests I've done. As long as we're aware it's something that the browser 'might' not respect, I think we're ok, but it should respect it as long as the browsers are following normal specs.

@pippinsplugins
Copy link
Contributor

@cklosowski just did some testing on it. Worked beautifully for me and took care of the exact problem that originally triggered us creating this issue: multiple pending payments for a single order due to customers clicking the back button.

💯

@sunnyratilal
Copy link
Contributor

Tested and working perfectly fine on my end too 👍

sunnyratilal added a commit that referenced this issue Jan 24, 2017
Complete abandoned and pending payments #2714
@sunnyratilal
Copy link
Contributor

Merged into release/2.7

@pippinsplugins
Copy link
Contributor

💯

@pippinsplugins
Copy link
Contributor

I'm seeing an error happen on the live site when testing this:

URL: https://easydigitaldownloads.com/checkout/?edd_action=recover_payment&payment_id=914927

Error log (incomplete for unknown reason):

#1 /wordpress-4.7.2/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array)
#2 /wordpress-4.7.2/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#3 /dom8333/wp-content/plugins/easy-digital-downloads/includes/actions.php(25): do_action('edd_recover_pay...', Array)
#4 /wordpress-4.7.2/wp-includes/class-wp-hook.php(298): edd_get_actions('')
#5 /wordpress-4.7.2/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)
#6 /wordpress-4.7.2/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
#7 /wordpress-4.7.2/wp-settings.php(449): do_action('init')
#8 /dom8333/wp-config.php(74): require_once('/wordpress-4.7....')
#9 /dom8333/wp-load.php(37): require_once('/dom8333/wp-con...')
#10 /wordpress-4.7.2/wp-blog-header.php(13): require_once('/dom8 in /dom8333/wp-content/plugins/easy-digital-downloads/includes/payments/actions.php on line 381

@pippinsplugins
Copy link
Contributor

Looks like it's a left over empty() method call for the cart class:

// Empty out the cart.
EDD()->cart->empty();

That method was changed to empty_cart().

@pippinsplugins
Copy link
Contributor

Yep, fixed.

@cklosowski
Copy link
Contributor

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants