-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue #2870040 by mglaman: Remove payment method from order if there … #719
base: 8.x-2.x
Are you sure you want to change the base?
Issue #2870040 by mglaman: Remove payment method from order if there … #719
Conversation
1028fc1
to
005e904
Compare
69a6f15
to
a0d6592
Compare
The test failures have to do with orders which have have payment gateway reference but no payment method. |
…is a decline exception
a0d6592
to
d705c25
Compare
@@ -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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bojanz If we do not remove this.. then the chain of logic here fails, which is another bug. Not sure if I should fix here or not.
$default_option = NULL;
if ($order_payment_method) {
$default_option = $order_payment_method->id();
}
elseif ($order_payment_gateway && !($order_payment_gateway instanceof SupportsStoredPaymentMethodsInterface)) {
$default_option = $order_payment_gateway->id();
}
Returns payment gateway... which is not a method.
$selected_option = $pane_form['payment_method'][$default_option];
$payment_gateway = $payment_gateways[$selected_option['#payment_gateway']];
if ($payment_gateway->getPlugin() instanceof SupportsStoredPaymentMethodsInterface) {
This supports no reconciliation for the fact we have a gateway ID. So I suppose the thing to do is remove returning gateway ID?
6be1d5c
to
b8a7444
Compare
# Conflicts: # modules/payment/src/Plugin/Commerce/CheckoutPane/PaymentProcess.php
…is a decline exception