You are here

public function PayPalExpressCheckout::getExpressButton in Ubercart 8.4

Form constructor.

Return value

array A Form API button element that will bypass standard checkout.

Overrides ExpressPaymentMethodPluginInterface::getExpressButton

File

payment/uc_paypal/src/Plugin/Ubercart/PaymentMethod/PayPalExpressCheckout.php, line 257

Class

PayPalExpressCheckout
Defines the PayPal Express Checkout payment method.

Namespace

Drupal\uc_paypal\Plugin\Ubercart\PaymentMethod

Code

public function getExpressButton($method_id) {
  $this->methodId = $method_id;
  return [
    '#type' => 'image_button',
    '#name' => 'paypal_ec',
    '#src' => 'https://www.paypal.com/en_US/i/btn/btn_xpressCheckoutsm.gif',
    '#title' => $this
      ->t('Checkout with PayPal.'),
    '#submit' => [
      '::submitForm',
      [
        $this,
        'submitExpressForm',
      ],
    ],
  ];
}