[Done v1.3.9] Paypal / Gift Certificates and the eternal checkout loop
I have a customer who recently decided to sell gift certificates. I followed the instructions for setting up a gift certificate, and the tested a purchase. Everything tested fine until I confirmed the order in paypal. After confirming in paypal I get redirected back to step 2 of the checkout process on my clients website. After checking my bank, paypal has submitted a pre-authorization, but no emails were sent to the store manager email or the test customer email, and no new order shows up in the admin.
This only happens when I set the model number on the certificate to GIFT-XXX. All other products test out fine.
I am running version 1.3.8a on php 4.3.11. Paypal Website Payments Pro and Paypal Express Checkout are the only payment gateways that are enabled. The site is set up on a GoDaddy server, but I was told the problem occurred on another hosting server before I picked up the client and moved them to GoDaddy.
Thanks
Virtual Carts not Handled Correctly with Paypal WPP
Hello all,
While enabling gift certificates today I ran into a strange issue while trying to pay for them with PayPal Website Payments Pro. For orders with a pure virtual cart (only gift certificates in my case -- we sell physical products) I was redirected back to checkout_payment after clicking "confirm order" on step 3.
Steps to reproduce:
- Start with a fresh session. Add a gift certificate (any amount) to your order.
- Proceed to checkout (log in, etc). checkout_shipping should be skipped for this cart as it contains no physical products.
- Select PayPal on checkout_payment.
- Click "confirm order" on checkout_confirmation.
- Log into PayPal. Verify the amount and click "continue."
At this point you will be redirected to checkout_shipping. Zen Cart will then realize you have a virtual cart and redirect you to checkout_payment. - At this point you are in a "special payment" so you can only enter comments, etc., not re-select your payment type. Proceed to checkout_confirmation.
- Click "confirm order."
- Run through the PayPal screens and your transaction will be successful.
This looks to be an issue with Zen's handling of virtual carts. In paypalwpp.php line 1660 Zen checks for a virtual cart skips calling the paypalwpp->getOverrideAddress() function. Unfortunately, getOverrideAddress() is where the "markflow" GET variable is committed to a session variable. So, when we get to line 1732, $reviewOrder is left true and PayPal is told to display a "continue" button, rather than "confirm."
I added the following fix to my paypalwpp.php file starting at line 1659. I added the one line above "} else {":
Code:
if ($_SESSION['cart']->get_content_type() == 'virtual' && isset($_SESSION['customer_id']) && $_SESSION['customer_id'] > 0) {
$this->zcLog('ec-step1-addr_check', "cart contents is virtual and customer is logged in ... therefore options['NOSHIPPING']=1");
$options['NOSHIPPING'] = 1;
$_SESSION['paypal_ec_markflow']=(int)$_GET['markflow'];
} else {
For obvious reasons, I'm hesitant to tinker with the PayPal files. Can someone knowledgeable about Zen's PayPal system please take a look at this and verify that it's a valid fix?
Thanks!
Re: Virtual Carts not Handled Correctly with Paypal WPP
The system intentionally goes to the checkout_payment page if you have coupon or gift certificate support enabled on your site, so that the customer can enter a coupon or gift cert redemption code before confirming final payment amount.
Re: Virtual Carts not Handled Correctly with Paypal WPP
Quote:
Originally Posted by
DrByte
The system intentionally goes to the checkout_payment page if you have coupon or gift certificate support enabled on your site, so that the customer can enter a coupon or gift cert redemption code before confirming final payment amount.
Hi Dr. Byte,
Yes, for an Express Checkout that is true. However, this isn't an express checkout, just a normal PayPal transaction. (I logged in using an existing account.) For virtual carts, the bug is displaying the checkout_payment page twice.
The behavior is also not duplicated for physical carts.
Also, it just occurred to me that I didn't post my version of Zen: 1.3.8a.
Re: Virtual Carts not Handled Correctly with Paypal WPP
Well, if you're editing the paypalwpp.php file, you're dealing with Express Checkout ... so, I'm uncertain whether there's really a problem here.
Website Payments Pro uses paypaldp.php.
And, no, don't complain about the nomenclature of the filenames ... we've heard it lots.
Re: Virtual Carts not Handled Correctly with Paypal WPP
Ok, I just checked my Zen config and you are correct. The payment module is "PayPal Express Checkout." The file being called is paypalwpp.php. My apologies, I made an assumption based on the filename.
Now, to confuse the matter further... :smile:
This is not an express checkout per se. I'm logging into Zen with a pre-existing account. I am not redirected to PayPal until after (the first) checkout_confirmation.
Thanks for your help!
Re: Virtual Carts not Handled Correctly with Paypal WPP
So, you're just saying that it's looping through the checkout pages one extra time?
Re: Virtual Carts not Handled Correctly with Paypal WPP
Quote:
Originally Posted by
DrByte
So, you're just saying that it's looping through the checkout pages one extra time?
Yes, sir.