Page 2 of 3
Re: Paypal sandbox does not complete payment
Posted: 28 Mar 2021, 21:35
by p38
Hi Jan,
Initially paypal did not work, until I saw in forum to disable SSL, and then it worked fine, all the way to successful payment.
The last entry in the logs says "Order status change", but looking at the change value, it is setting the status to cancelled (value=3), and not completed (value=6).
Code: Select all
2021-03-28 17:49:31 Notice Payment - PayPal Standard - Order Status Change 173.0.82.126 https://xxxxxx.xxx/index.php?option=com_phocacart&view=response&task=response.paymentnotify&type=paypal_standard&pid=1&tmpl=component Order status changed to: 3, User: Anonymous
Once payment is complete, Phoca indicates as such, so the callback seems to be received correctly, it is just that PhocaCart is setting the incorrect status for some reason.
This is a brand new install, and I mostly did not change any default settings, so it should work virtually out the box.
I have tried everything, to no avail.
I am at a loss now as dont know where to look next.
Paul
Re: Paypal sandbox does not complete payment
Posted: 31 Mar 2021, 12:04
by p38
Hi Jan,
Do you perhaps have any feedback for me as to where further to look?
Re: Paypal sandbox does not complete payment
Posted: 02 Apr 2021, 17:26
by Jan
Hi, the orders status is changed by paypal order status. So first you need to detect which status you got from PayPal and then see the PayPal options to check if this status is assigned to some order status in Phoca Cart.
Jan
Re: Paypal sandbox does not complete payment
Posted: 02 Apr 2021, 18:02
by p38
Thanks Jan,
How would I detect what the order status is coming back from Paypal if I am using the PhocaPaypal plugin?
The system logs seem to indicate PayaPal was successfull, but yet Phoca is changing teh status to value 3, Cancelled.
2021-03-27 21:47:3 Notice Payment - PayPal Standard - SENDING FORM TO PAYPAL
2021-03-27 21:52:06 Notice Payment - PayPal Standard - SUCCESS
2021-03-27 21:52:06 Notice Payment - PayPal Standard - Order Status Change
On a live payment the money comes off the account, so paypal must be working correctly.
Paul
Re: Paypal sandbox does not complete payment
Posted: 02 Apr 2021, 18:23
by Jan
Did you recheck if all the statuses set in payment method options are correctly set?

Re: Paypal sandbox does not complete payment
Posted: 02 Apr 2021, 20:32
by p38
Hi, yes, this was the first thing I checked, and Peter confirmed all looked correct. The only thing is I disabled SSL check as paypal did not work at all, and after searching your forum, this was a suggestion to swicth off. Once done, paypal worked perfectly

Re: Paypal sandbox does not complete payment
Posted: 03 Apr 2021, 14:59
by Jan
Hi, are you abe to test the payment again. If, yes, try to open this file:
plugins\pcp\paypal_standard\paypal_standard.php
and change the line cca 535
FROM:
Code: Select all
PhocacartLog::add(1, 'Payment - PayPal Standard - Order Status Change', (int)$id, 'Order status changed to: '.$statusOption);
TO:
Code: Select all
PhocacartLog::add(1, 'Payment - PayPal Standard - Order Status Change', (int)$id, 'Order status changed to: '.$statusOption . '('.$paymentStatus.')');
This should show us the status returned by PayPal to your site.
Please, edit the code, save the changes and try to do the test payment with enabled logging.
Jan
Re: Paypal sandbox does not complete payment
Posted: 03 Apr 2021, 16:26
by p38
Hi Jan,
Many thanks, your suggestion to output the paypal status in the logs helped me to solve the problem.
It turns out that altho Paypal sandbox will indicate successful payment it turns out I was not aware that, apart from selecting sandbox mode, I also had to put in the sandbox merchant email as well.
I had incorrectly assumed phoca would handle this, and it is not entirely clear in the documents or tooltip.
Perhaps as a suggestion, you can change the tooltip similar below, which would clear up any misunderstanding regarding sandbox setup.

Many thanks to you for your help and Peter as well.
I will be making a donation.
Re: Paypal sandbox does not complete payment
Posted: 04 Apr 2021, 16:35
by Jan
Hi, Ok, thank you for the info, I will add the text to next version.
Jan
Re: Paypal sandbox does not complete payment
Posted: 19 Feb 2023, 18:55
by Ellinor
I had the same problem. Turned on logging and this error apperaed: cURL error: [60] SSL certificate problem: unable to get local issuer certificate, User: Anonymous
I then disabled the SSL verification and tried again using the Guest Checkout. Order status still remained pending.
I then disabled the Guest checkout and registered my sandbox user.
Only then the correct status Completed appeared on my order.
It seems to have something to do with the Guest Checkout?
Or is it my settings for Guest Checkout? Is there some way of force create account on Guest Checkout to make it work?
Thanks in advance,