Paypal Sandbox keeps returning Pending

Posts: 15
Joined: 04/09/2008

Hello, I am testing the payment workflow with Paypal Sandbox but even though the payment completes successfully on the Sandbox site, in Ubercart the Orders log only shows:

Payment is pending at PayPal: Reason unknown; contact PayPal Customer Service for more information.

and that messes up the automatic role upgrade assignment on my site.

Now is this a Paypal Sandbox problem or a Ubertcart problem? Has anyone else having the same type of problem? Thanks!

Posts: 15
Joined: 04/09/2008

Now I found this other post: http://www.ubercart.org/comment/16393/ubercart-role-assignment-issue

Can anyone else confirm that "Pending" status from Paypal occurs only after user has paid? This seems like something to take care of ASAP!

Posts: 15
Joined: 04/09/2008

So I see what happens is that the order stays on InCheckout while user is still on Paypal site (even after payment is completed succesfully on Paypal). Then only after user clicks Paypal's "return to site" button, order status gets updated from InCheckOut to Pending.

So this problem can be solved modifying the Workflow like:

If Order Status == Pending Then Order Status = Complete
(Instead of checking for Order Balance ==0)

One problem is that this workflow may only work with Paypal but I guess it would not be correct for other payment gateways? So is this a glitch with Paypal?

And, what if user just closes the Paypal windows without ever clicking the "return to site" button? Any more foolproof way of updating order status on successful payment?

Posts: 15
Joined: 04/09/2008

Ok now I understand more about the process but then the question is, what triggers the balance = 0 state?

I read that Pending is the default post_checkout status and that the default worflow ng profile moves the status to Complete after checking for balance <= 0 , but then this check fails in my case, why is that? In other words, why doesnt the balance go to zero after client returns from succesful Paypal payment?

Posts: 15
Joined: 04/09/2008

Allright, what was happening was that the Sandbox Business Acct was set not to accept automatically payments in other currencies so my test client was paying in Euros and therefore the balance wouldn't change on payment completion because it still had to be accepted from within the sandbox Business account.

(I am sure others are falling on similar situations)

...can go to sleep now DANGIT!

Posts: 5245
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Glad you got it figured out. Just to clarify... a pending payment at PayPal is different from the pending order status in Ubercart. A pending PayPal payment means it still hasn't received the money, so you wouldn't want to update an order to completed in that case. The balance will go to $0.00 once PayPal sends a notification that the payment has cleared. They stay in pending for payments like yours and also for eChecks. You don't want to mail out the goods if an eCheck hasn't cleared, or you may get stuck with no product and no money.