Skip to content

Commit

Permalink
Issue #2870040 by mglaman: Remove payment method from order if there …
Browse files Browse the repository at this point in the history
…is a decline exception
  • Loading branch information
mglaman authored and mglaman committed Apr 23, 2017
1 parent 5ebb309 commit d705c25
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ public function buildPaneForm(array $pane_form, FormStateInterface $form_state,
catch (DeclineException $e) {
$message = $this->t('We encountered an error processing your payment method. Please verify your details and try again.');
drupal_set_message($message, 'error');
$this->order->get('payment_gateway')->setValue(NULL);
$this->order->get('payment_method')->setValue(NULL);
$this->redirectToPreviousStep();
}
catch (PaymentGatewayException $e) {
Expand Down

0 comments on commit d705c25

Please sign in to comment.