Skip to content
Snippets Groups Projects
Commit e0319921 authored by jose's avatar jose
Browse files

Issue #3343420 by Redwan Jamous: Always respond to 2c2p notification request

parent a28a860d
No related branches found
No related tags found
No related merge requests found
......@@ -227,7 +227,7 @@ class OffsiteRedirect2C2P extends OffsitePaymentGatewayBase {
$this->getLogger('commerce_2c2p')->error('Invalid order ID from gateway: @reference', ['@reference' => $pt_res_payload->invoiceNo]);
throw new PaymentGatewayException('Invalid order ID from gateway.');
}
if ($pt_res_payload->respCode === "0000") {
if ($pt_res_payload->respCode === "0000" && $order->getState()->getId() !== 'completed') {
// Trigger payment success event.
$event = new PaymentSuccessEvent($pt_res_payload, $order);
$this->eventDispatcher->dispatch($event, Commerce2C2PPaymentEvents::PAYMENT_SUCCESS);
......@@ -246,7 +246,7 @@ class OffsiteRedirect2C2P extends OffsitePaymentGatewayBase {
throw new PaymentGatewayException('Payment failed.');
}
}
catch (\UnexpectedValueException $e) {
catch (\UnexpectedValueException|PaymentGatewayException) {
return new Response('', 200);
}
}
......
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