Commit bad0cc28 authored by Jonathan Sacksick's avatar Jonathan Sacksick Committed by Jonathan Sacksick
Browse files

Issue #3133063 by jsacksick, mau18nm@gmail.com: Cannot change payment method...

Issue #3133063 by jsacksick, mau18nm@gmail.com: Cannot change payment method anymore after choosing PayPal.
parent 11cd93c8
Loading
Loading
Loading
Loading
+15 −2
Original line number Diff line number Diff line
@@ -42,13 +42,26 @@ class PayPalCheckout extends CheckoutFlowWithPanesBase {
   */
  public function getPanes() {
    $panes = parent::getPanes();
    // Create a blacklist of panes we disallow adding to steps.
    // Specify the list of panes to disable by default.
    // Once the payment is approved, the customer shouldn't go through the
    // payment gateway selection again, but hiding these panes by default
    // instead of removing them still allows the merchant to use them if needed.
    $black_list = [
      'contact_information',
      'payment_information',
      'payment_process',
    ];
    return array_diff_key($panes, array_combine($black_list, $black_list));
    foreach ($panes as $id => $pane) {
      if (!in_array($id, $black_list, TRUE)) {
        continue;
      }
      // Ensure we don't override existing configuration for these panes.
      if (!isset($this->configuration['panes'][$id])) {
        $pane->setStepId('_disabled');
      }
    }

    return $panes;
  }

  /**