Magento2: Payment done at paypal but order are not getting generated in Magento 2.3.2

Created on 11 Nov 2019  路  8Comments  路  Source: magento/magento2

Preconditions (*)

  1. Magento 2 upgrade from Magento 2.2.6 to 2.3.2
  2. Paypal express method

Steps to reproduce (*)

  1. create any customer with Magento 2.2.*
  2. upgrade the Magento 2.2.* to Magento 2.3.2
  3. enable Paypal express checkout

Expected result (*)

  1. order should be recorded in Magento 2.3.2 backend

Actual result (*)

  1. customer is charged properly.
  2. payment deducted from their account and deposited to client's account
  3. No order found in the backend and that order id skip

This is a very terrible case, The version upgrade should ease the user experience and of course the developer but it shouldn't introduce a new bug or errors.

I had made a dip dive into the code base and here is the process of how PayPal checkout happen.

  1. SetExpressCheckout
  2. GetExpressCheckoutDetails
  3. DoExpressCheckoutPayment

I suspect the following from the core file and log files that.

  1. GetExpressCheckoutDetails doesn't get a SHIPTOPHONENUM when order are recorded in the backend but charged

In addition to this, I have also come to know that 3. DoExpressCheckoutPayment is not sending an email and phone number data in the array and sending null instead.

The following exception might be the cause of the above

We can't save the address: Email has a wrong format

We are getting a lot of orders through PayPal express too and it's not a constant issue but we are having a problem with 1 to 2 orders a day and mostly happen with old customer account ( which was done while with Magento 2.2.6)

I am looking for any thoughts on this from an expert developer and Magento core team what potential causes would be there apart from my analysis.

Let me know your thought and any quick help will be highly appreciated.

Regards,
Sam

Format is valid

All 8 comments

Hi @samumaretiya. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [ ] Summary of the issue
  • [ ] Information on your environment
  • [ ] Steps to reproduce
  • [ ] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@samumaretiya do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [ ] yes
  • [ ] no

Hi @m2-assistant,

Thanks for your reply. yeah, I have already provided the step to reproduce the issue. well, yea, This issue is in vanilla Magento too. Fyi, We have upgraded Magento from 2.2.6 to Magento 2.3.2. I have also noticed that there are other people have also same issue but it's still on the table.

We are using a PayPal express checkout and I believe the address data being set from the following files where something needs to be done with core files but I am waiting for core team comment before I would go further to fix it.

vendor/magento/module-paypal/Model/Api/Nvp.php and yea let me know if there will be other files where I need to look so I will check with them too.

` protected function _importAddresses(array $to)
{
$billingAddress = $this->getBillingAddress() ? $this->getBillingAddress() : $this->getAddress();
$shippingAddress = $this->getAddress();

    $to = \Magento\Framework\DataObject\Mapper::accumulateByMap(
        $billingAddress,
        $to,
        array_merge(array_flip($this->_billingAddressMap), $this->_billingAddressMapRequest)
    );
    $regionCode = $this->_lookupRegionCodeFromAddress($billingAddress);
    if ($regionCode) {
        $to['STATE'] = $regionCode;
    }
    if (!$this->getSuppressShipping()) {
        $to = \Magento\Framework\DataObject\Mapper::accumulateByMap(
            $shippingAddress,
            $to,
            array_flip($this->_shippingAddressMap)
        );
        $regionCode = $this->_lookupRegionCodeFromAddress($shippingAddress);
        if ($regionCode) {
            $to['SHIPTOSTATE'] = $regionCode;
        }
        $this->_importStreetFromAddress($shippingAddress, $to, 'SHIPTOSTREET', 'SHIPTOSTREET2');
        $this->_importStreetFromAddress($billingAddress, $to, 'STREET', 'STREET2');
        $to['SHIPTONAME'] = $shippingAddress->getName();
    }
    return $to;
}`

I think we need to make a check here after a billing address object whether there is an email or phone number are exists or not in the address if not then we need to write a script to obtain it.

I will keep update here and meanwhile let me know if there will be any quick fix.

Regards, sam

Hi @engcom-Charlie. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 5. Add label Issue: Confirmed once verification is complete.

  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

Hello @samumaretiya
We are not able to reproduce this issue on the Magento 2.3.3 by provided steps.

Testing scenario:

  1. Install Magento 2.2.10
  2. Create any customer
  3. Enable Paypal express checkout
  4. Upgrade the Magento to Magento 2.3.3
  5. Place order via Paypal express checkout from customer created before upgrade

Result:
All orders recorded
Screenshot from 2019-11-14 18-50-12

So i have to close this issue.

Please refer to the Community Forums or the Magento Stack Exchange, for advice or general discussion about this issue.

Thanks for your report!

Hi @engcom-Charlie,

It's very sad that without proper testing you closed this ticket.

I had clearly mentioned that we are running into an issue with Magento 2.3.2 then what is the meaning of your upgrade with Magento 2.3.3.

I have posted this thread on Linkedin and many other developers have the same issue with 2.3.2 but they don't have any solution.

I had made a fix by myself which is not completely okay to avoid the problem but at least we don't have emails from the client for this payment cut issue, however, we are losing sales due to this issue but sometimes customer too. we can go ahead with Magento 2.3.3 but I am not seeing any leverage because Magento 2 core introduce a more bug instead of fixing the existing one with the new version.

Totally agreed with @samumaretiya .. We recently released our new store's version (2.3.3) and we still suffering the same since 2.2.3 with PP Express and the "missing" quoted orders.

Hi @engcom-Charlie The same issue exist in Magento 2.3.4. Payment is captured but no order is created in Magento.

After some hours debug and check files debug.log, exception.log, payment.log, I found the issue is Numeric value out of range: 167 Out of range value for column 'sequence_value' at row 1, query was: INSERT INTOsequence_invoice_1() VALUES ()

Then I go to table sequence_invoice_1 and have changed type of "sequence_value" from int(10) to bigint(20). Now, it works fine.

Our customer have a lot order migration from Magento 1 to Magento 2. That is an issue. Hope it can help someone.

Alothemes - Happy Coding!

Was this page helpful?
0 / 5 - 0 ratings