Hi everyone,
Over the past couple of weeks I have been getting some anomalies with express checkout and the orders getting set to processing (paid - and/or whatever you have yours set to) when the actual order has not been paid and/or the "payment" may be in authorized mode but not captured (Payment tab has no transaction id and state is Authorization - Operations button is "Capture").
I have just begun debugging this (adding logging for each return and response) and here are my observations so far -

When an order like this comes through (I am getting "good/really paid for" orders, just the ones that meet the criteria above), I get 4 errors in in my log messages -
Message Notice: Undefined index: PAYMENTINFO_0_PAYMENTSTATUS in Drupal\commerce_paypal\Plugin\Commerce\PaymentGateway\ExpressCheckout->onReturn() (line 305

Message Notice: Undefined index: PAYMENTINFO_0_TRANSACTIONID in Drupal\commerce_paypal\Plugin\Commerce\PaymentGateway\ExpressCheckout->onReturn() (line 315

Message Notice: Undefined index: PAYMENTINFO_0_PAYMENTSTATUS in Drupal\commerce_paypal\Plugin\Commerce\PaymentGateway\ExpressCheckout->onReturn() (line 316

Message Notice: Undefined index: PAYMENTINFO_0_PAYMENTSTATUS in Drupal\commerce_paypal\Plugin\Commerce\PaymentGateway\ExpressCheckout->onReturn() (line 322

In the error case the Url its requesting is -

https://www.example.com/checkout/orderId/payment/return?PayerID=BlahBlah&token=EC-MoreBlahBlah

The referrer is -

https://www.paypal.com/webapps/hermes?flow=1-P&ulReturn=true&token=EC-MoreBlahBlah&return=https://www.example.com/checkout/orderId/payment/return&cancel=https://www.example.com/checkout/orderId/payment/cancel&total=someTotal&country.x=US&locale.x=en_US

Im a little concerned about onReturn() function not checking for integral/"set" variables in the array plus the 'PAYERID' and 'payerid' within the code wherein the query string is PayerID, but I havent fully gotten into it.

I am running this in production and am an experienced programmer so if you need any help/testing/etc. with this module let me know.
Any thoughts/insight would be much appreciated (especially on how/where the order gets set to processing when the payment has not completed).

Thanks.

Comments

Vision Scaler created an issue. See original summary.

Vision Scaler’s picture

Issue summary: View changes
Vision Scaler’s picture

Issue summary: View changes
Vision Scaler’s picture

Issue summary: View changes

Sorry, trying to get the urls to fully show :).

bojanz’s picture

I am running this in production and am an experienced programmer so if you need any help/testing/etc. with this module let me know.

We need patches! We only run Braintree on production (since it has a more modern Express Checkout implementation), which has left the PayPal module lingering in beta.

s.messaris’s picture

Hi, we just tried to add this module on a client side and came upon these errors during testing with a sandbox account. @Vision Scaler did your debugging turn up anything?

pajor’s picture

Hi! We also encountered with this issue when the buyer exceeds his/her card limit. After checking out to paypal we were instantly dropped back to drupal with a completed order, however the payment status was 'authorization' and basically it was bought for free. I made a small patch to handle paypal error response.

kala4ek’s picture

Status: Active » Needs review

We faced with this problem on the latest project.
The issue was solved almost the same way as #7.

Do not setting RTBC, because I can not test #7 patch right now, but it looks like the right patch.

mglaman’s picture

We are reviewing this at DrupalCon

mglaman’s picture

+++ b/src/Plugin/Commerce/PaymentGateway/ExpressCheckout.php
@@ -302,10 +302,19 @@ class ExpressCheckout extends OffsitePaymentGatewayBase implements ExpressChecko
+      if (isset($paypal_response['L_ERRORCODE0']) && $paypal_response['L_ERRORCODE0'] == "10486") {

We should document this error code. Link to https://developer.paypal.com/docs/classic/express-checkout/ht_ec_funding..., will do on commit.

mglaman’s picture

Tagging aestigarribia who helped me QA at DrupalCon

  • mglaman committed 6d52d40 on 8.x-1.x authored by pajor
    Issue #2941933 by pajor, aestigarribia, kala4ek: EC onReturn() errors...
mglaman’s picture

Status: Needs review » Fixed

Thank you, everyone! Committed! A new beta will be rolled out post DrupalCon

Status: Fixed » Closed (fixed)

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