Drupal 7 site. Using PayPal WPS for checkout on site that is selling premium content access.

For orders with no coupon... the checkout process works. Using Product Express Checkout Buttons to take user to checkout page. When a coupon is not used and a user clicks checkout with PayPal, they are directed to PayPal, a new account is assigned and upon completion of the payment the appropriate user role is assigned to the account.

When a coupon code is entered in on the checkout page, the discount is given, but when the user clicks to checkout with PayPal... they are not redirected to paypal. Instead they are redirected to a page on-site that tells them their order number... An account is set up, however because they did not pay through PayPal, no role is assigned and no money was paid.

Any ideas?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Carlo Satta’s picture

Same problem here.
After I insert a code, if I refresh the page all work well.

Any idea?

Carlo Satta’s picture

I think the problem is caused by Commerce Coupon with Commerce Express Checkout

dpolant’s picture

Is there a consensus that the problem is with Commerce Paypal Express Checkout?

torgosPizza’s picture

For us it has been intermittent. I have some users who have had coupons removed upon returning from PayPal EC. However I have some users who have their coupon still applied and there doesn't appear to be an issue.

One thing I did to try and troubleshoot this was to make sure our Cart block wasn't being displayed on checkout/* pages. To me it felt like the cart order refresh process was contributing to this issue, and as that block inherently gets called everywhere (therefore triggering a bunch of order-related processes) it made logical sense.

However yes it does seem like PayPal Express Checkout (using Commerce PayPal, not Commerce Payment + PayPal) seems to be most prone to this error.

dpolant’s picture

@torgosPizza another question: are you using commerce_express_checkout? I'm trying to identify the common thread in this issue. commerce_express_checkout module seems to be behaving strangely in general so i need to look into that.

So there is definitely a known issue with people hitting the cancel button from paypal EC (and for that matter from any offsite payment method). I've attached a patch to address that. I think this is actually a separate issue.

torgosPizza’s picture

Hey Dan,

Thanks for that patch, I'll take a look. We're using commerce_paypal_ec, not commerce_express_checkout (haven't heard of that one...) but if that's the module you mean then yes we are. It does seem to have some quirks and I'm not wholly sure how to best tackle it, but I am attempting to troubleshoot as we go. It seems to also affect users paying with credit cards as well (we had another person mention it) but so far I am having trouble finding the common denominator. It's most prevalent with PayPal EC but it is not restricted to just that one payment method.

Thanks!

torgosPizza’s picture

So far the results of this patch are really promising. I'm seeing coupon transaction IDs in a lot of order data entries, including users who paid with PayPal EC. This is of course not solid data and it's not a big sample (I just pushed it to production this morning) but so far I am happy. I'l continue to monitor things and will let you know if other users experience losing their coupon discounts.

I will keep you posted! Thanks again.

dpolant’s picture

Sorry, that last patch did not apply to 7.x-2.x. This one will.

@torgos - you'll be ok even though you somehow got the last patch to work. Once I commit this you can just pull from coupons 7.x-2.x.

torgosPizza’s picture

I should've mentioned that I had to apply the first hunk manually. I had been doing some extra work in Coupon so I hadn't yet set this to RTBC. I'll test the new patch as well with the latest dev.

Thanks!

torgosPizza’s picture

I would also suggest anyone else having problems at PayPal due to PayPal errors ("Communication with PayPal failed") should look at the patch in #2238723: Price component not rounded causing line item and order total mismatch Comment #1, because rounding errors were popping up with any orders in which a Percentage (Product) Discount was used in an order, and I suspect many others were seeing that same issue without realizing it.

dpolant’s picture

@torgos

Any feedback on the patch in this issue?

torgosPizza’s picture

Oh yeah, sorry. It seems to work for us! I should probably test it a bit more substantially.

dpolant’s picture

Status: Active » Needs review

The last submitted patch, 5: 2353145-fix-offsite-cancel.patch, failed testing.

torgosPizza’s picture

Status: Needs review » Reviewed & tested by the community

This looks like it is in Dev so setting to Fixed.

torgosPizza’s picture

Status: Reviewed & tested by the community » Fixed

Correct status.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.