Skip to content

Commit 69a6f15

Browse files
mglamanmglaman
mglaman
authored andcommitted
Issue #2870040 by mglaman: Remove payment method from order if there is a decline exception
1 parent 8f45626 commit 69a6f15

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

modules/payment/src/Plugin/Commerce/CheckoutPane/PaymentProcess.php

+1
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ public function buildPaneForm(array $pane_form, FormStateInterface $form_state,
118118
catch (DeclineException $e) {
119119
$message = $this->t('We encountered an error processing your payment method. Please verify your details and try again.');
120120
drupal_set_message($message, 'error');
121+
$this->order->get('payment_method')->setValue(NULL);
121122
$this->redirectToPreviousStep();
122123
}
123124
catch (PaymentGatewayException $e) {

0 commit comments

Comments
 (0)