Midtrans / Midtrans-Magento2

Official Midtrans Payment Module for Magento 2 | https://midtrans.com
MIT License
2 stars 7 forks source link

Can not place an order #34

Closed cowell-manhnt7190 closed 2 years ago

cowell-manhnt7190 commented 2 years ago

Preconditions and environment

Steps to reproduce

Expected result

Actual result

Other

Midtrans error log: The entity that was requested doesn't exist. Verify the entity and try again

Hint maybe:

Xaxxis commented 2 years ago

Hi @cowell-manhnt7190 will check on this and get back to you. Thanks for reaching out to us

Xaxxis commented 2 years ago

Hi @cowell-manhnt7190 after testing on our side, I can't replicate this, the feature is working fine using Magento 2.4.4 version. The plugins work fine after clicking the button place order & pay. Do you mind to share your PHP version on this. I'm using PHP 8.1.9

Thank you

cowell-manhnt7190 commented 2 years ago

Hi @Xaxxis I try to debug on our side and I see that the issue happens if the order increment_id starts with a number other than 0 or the prefix is text, for example OT00000015.

Case 1: Order increment id 000000015 -> works fine if there exists order with entity_id is 15.

Case 2: Order increment id 400000015 -> works fine if there exists an order with entity_id of 400000015, but does not work if there is no order with entity_id of 400000015

Case 3: Order increment id OT00000015 -> does not work because order entity_id does not exist text

Step debug: Midtrans/Snap/Controller/Payment/Redirect.php line 16 -> this is the root cause of issue $paymentCode = $this->paymentOrderRepository->getPaymentCode($incrementId);

Midtrans/Snap/Model/Order/OrderRepository.php line 145 public function getPaymentCode($incrementId)

Midtrans/Snap/Model/Order/OrderRepository.php line 134 public function getOrderByIncrementId($realOrderId)

Xaxxis commented 2 years ago

Hi @cowell-manhnt7190 After digging and re-replicate this, found the issue. will fix this soon and get back to you. Thanks

Xaxxis commented 2 years ago

Hi @cowell-manhnt7190 the fix has already been released in a new version v2.7.1. Kindly try using the latest version. Thank you

cowell-manhnt7190 commented 2 years ago

Hi @Xaxxis thank you for your update, this issue fixed.