Commit 4c766a81 authored by Vadym Abramchuk's avatar Vadym Abramchuk Committed by Vadym Abramchuk
Browse files

Issue #3270758 by abramm: Rename $plugin variable to make it more obvious what plugin is

parent 6273210c
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -22,12 +22,14 @@ class PaymentMethodAddForm extends BasePaymentMethodAddForm {
    // Alter the form with Omise specific needs.
    $element['#attributes']['class'][] = 'omise-form';

    // Set our key to settings array.
    if (!($this->plugin instanceof OmiseInterface)) {
    $paymentGatewayPlugin = $this->plugin;
    if (!($paymentGatewayPlugin instanceof OmiseInterface)) {
      throw new \InvalidArgumentException('Omise payment method required.');
    }

    // Set our key to settings array.
    $element['#attached']['drupalSettings']['commerceOmise'] = [
      'publicKey' => $this->plugin->getPublicKey(),
      'publicKey' => $paymentGatewayPlugin->getPublicKey(),
    ];

    // To display validation errors.