0

I am using PayPal express checkout on my Magento 2.2.6 website. Steps to reproduce the issue that is

  1. Add product to cart
  2. From the cart page click Paypal express checkout button
  3. Add the details on PayPal
  4. On the PayPal review page, apply the discount coupon and it will redirect to the cart page
  5. Click on the express checkout button again, add the details on PayPal again
  6. and now instead of redirecting to the PayPal review page, I am redirecting to the cart page.

Can anyone suggest to me how to debug this issue in more detail?

Contents of the payment.log file are

  'url' => 'https://api-3t.sandbox.paypal.com/nvp',
  'GetExpressCheckoutDetails' => 
  array (
    'TOKEN' => 'xxxxxxxxxxxxxxxxxxxx',
    'METHOD' => 'GetExpressCheckoutDetails',
    'VERSION' => '72.0',
    'USER' => '****',
    'PWD' => '****',
    'SIGNATURE' => '****',
    'BUTTONSOURCE' => 'Magento_Cart_Community',
  ),
  'response' => 
  array (
    'TOKEN' => 'xxxxxxxxxxxxxxxxxxxxx',
    'BILLINGAGREEMENTACCEPTEDSTATUS' => '0',
    'CHECKOUTSTATUS' => 'PaymentActionNotInitiated',
    'TIMESTAMP' => '2019-12-05T09:56:40Z',
    'CORRELATIONID' => xxxxxxxxxxx
    'ACK' => 'Success',
    'VERSION' => '72.0',
    'BUILD' => '53842365',
    'EMAIL' => 'xxxxxxxxxxxxxxxxx',
    'PAYERID' => '76QH8A6BV9GWC',
    'PAYERSTATUS' => 'unverified',
    'FIRSTNAME' => 'Naveed',
    'LASTNAME' => 'Abbas',
    'COUNTRYCODE' => 'US',
    'SHIPTONAME' => 'Naveed Abbas',
    'SHIPTOSTREET' => 'street 123',
    'SHIPTOCITY' => 'huntsville',
    'SHIPTOSTATE' => 'AL',
    'SHIPTOZIP' => '35801',
    'SHIPTOCOUNTRYCODE' => 'US',
    'SHIPTOCOUNTRYNAME' => 'United States',
    'BILLINGNAME' => 'Naveed Abbas',
    'STREET' => 'street 123',
    'CITY' => 'huntsville',
    'STATE' => 'AL',
    'ZIP' => '35801',
    'COUNTRY' => 'US',
    'COUNTRYNAME' => 'United States',
    'ADDRESSID' => 'PayPal',
    'ADDRESSSTATUS' => 'Confirmed',
    'CURRENCYCODE' => 'USD',
    'AMT' => '67.97',
    'ITEMAMT' => '67.97',
    'SHIPPINGAMT' => '0.00',
    'HANDLINGAMT' => '0.00',
    'TAXAMT' => '0.00',
    'INVNUM' => '600313',
    'INSURANCEAMT' => '0.00',
    'SHIPDISCAMT' => '0.00',
    'INSURANCEOPTIONOFFERED' => 'false',
    'L_NAME0' => 'Newspaper Holder in Met. Bronze for Gaines Mailbox',
    'L_QTY0' => '1',
    'L_TAXAMT0' => '0.00',
    'L_AMT0' => '67.97',
    'PAYMENTREQUEST_0_CURRENCYCODE' => 'USD',
    'PAYMENTREQUEST_0_AMT' => '67.97',
    'PAYMENTREQUEST_0_ITEMAMT' => '67.97',
    'PAYMENTREQUEST_0_SHIPPINGAMT' => '0.00',
    'PAYMENTREQUEST_0_HANDLINGAMT' => '0.00',
    'PAYMENTREQUEST_0_TAXAMT' => '0.00',
    'PAYMENTREQUEST_0_INVNUM' => '600313',
    'PAYMENTREQUEST_0_INSURANCEAMT' => '0.00',
    'PAYMENTREQUEST_0_SHIPDISCAMT' => '0.00',
    'PAYMENTREQUEST_0_SELLERPAYPALACCOUNTID' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    'PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED' => 'false',
    'PAYMENTREQUEST_0_SHIPTONAME' => 'Naveed Abbas',
    'PAYMENTREQUEST_0_SHIPTOSTREET' => 'street 123',
    'PAYMENTREQUEST_0_SHIPTOCITY' => 'huntsville',
    'PAYMENTREQUEST_0_SHIPTOSTATE' => 'AL',
    'PAYMENTREQUEST_0_SHIPTOZIP' => '35801',
    'PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE' => 'US',
    'PAYMENTREQUEST_0_SHIPTOCOUNTRYNAME' => 'United States',
    'PAYMENTREQUEST_0_ADDRESSSTATUS' => 'Confirmed',
    'L_PAYMENTREQUEST_0_NAME0' => 'Newspaper Holder in Met. Bronze for Gaines Mailbox',
    'L_PAYMENTREQUEST_0_QTY0' => '1',
    'L_PAYMENTREQUEST_0_TAXAMT0' => '0.00',
    'L_PAYMENTREQUEST_0_AMT0' => '67.97',
    'PAYMENTREQUESTINFO_0_ERRORCODE' => '0',
  ),
) [] []
[2019-12-05 09:56:44] main.DEBUG: array (
  'url' => 'https://api-3t.sandbox.paypal.com/nvp',
  'getPalDetails' => 
  array (
    'METHOD' => 'getPalDetails',
    'VERSION' => '72.0',
    'USER' => '****',
    'PWD' => '****',
    'SIGNATURE' => '****',
    'BUTTONSOURCE' => 'Magento_Cart_Community',
  ),
  'response' => 
  array (
    'PAL' => 'RGZTJUM7RDV9C',
    'LOCALE' => 'en_US',
    'TIMESTAMP' => '2019-12-05T09:56:43Z',
    'CORRELATIONID' => 'd3619b72ea406',
    'ACK' => 'Success',
    'VERSION' => '72.0',
    'BUILD' => '53802284',
  ),
) [] []

in file vendor/magento/module-paypal/Controller/Express/AbstractExpress/ReturnAction.php there is a condition

if ($this->_checkout->canSkipOrderReviewStep()) {
    $this->_forward('placeOrder');
} else {
    $this->_redirect('*/*/review');
}
return;```
in 2nd attempt it goes into else part, but without redirecting, control shipts outside of the if, else block and the cart page remains there.
  • have you enable debug mode from backend payment method configuration ? – Pradip Garchar Dec 5 '19 at 9:50
  • Yes debug mode is enabled – Naveed Abbas Dec 5 '19 at 9:51
  • so any payment.log file in log folder ?if yes then please share that logs – Pradip Garchar Dec 5 '19 at 9:56
  • Edited the question and added the payment.log contents. Tokens and emails etc are converted to xxxxxxxxxxxx – Naveed Abbas Dec 5 '19 at 10:06
  • I have done some debugging and found that the PayPal API is stuck after GetExpressCheckoutDetails, and it is not calling getPalDetails. Now trying to find out why it is happening. – Naveed Abbas Dec 5 '19 at 12:48
0

Please Set Yes into "Transfer Cart Line Items" from PayPal advanced settings, see the below image for your reference.

Hope it helps you !

enter image description here

  • These settings are alread applied. The issue occurs when we move to cart page from review page and click on PayPal express checkout button again. – Naveed Abbas Dec 9 '19 at 9:26
  • did you add extra cost or fee to cart? – Dhrumin Dec 9 '19 at 12:23
  • No extra cost, and this issue mainly occur in case if you apply a coupon code with 100% discount and then remove it. – Naveed Abbas Dec 9 '19 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.