Skip to content
Snippets Groups Projects
Commit 15bc3e4f authored by Redwan Jamous's avatar Redwan Jamous Committed by Mohammad Hawwari
Browse files

Issue #3339344 by RedwanJamous: Fix placing the order twice

parent e3524210
No related branches found
No related tags found
No related merge requests found
......@@ -222,7 +222,7 @@ class OffsiteRedirect2C2P extends OffsitePaymentGatewayBase {
$this->getLogger('commerce_2c2p')->debug('2C2P Payload Response notify ' . serialize($pt_res_payload));
/** @var \Drupal\commerce_order\entity\OrderInterface $order */
list(, $order_id) = explode('-', $pt_res_payload->invoiceNo);
$order = $this->entityTypeManager->getStorage('commerce_order')->load($order_id);
$order = $this->entityTypeManager->getStorage('commerce_order')->loadUnchanged($order_id);
if (!$order) {
$this->getLogger('commerce_2c2p')->error('Invalid order ID from gateway: @reference', ['@reference' => $pt_res_payload->invoiceNo]);
throw new PaymentGatewayException('Invalid order ID from gateway.');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment