You are here

function hook_uc_payment_method_checkout_alter in Ubercart 8.4

Same name and namespace in other branches
  1. 7.3 payment/uc_payment/uc_payment.api.php \hook_uc_payment_method_checkout_alter()

Alter payment methods available at checkout.

Parameters

$methods: Array of payment methods passed by reference. Keys are payment method IDs, strings are payment method titles.

$order: The order that is being checked out.

1 function implements hook_uc_payment_method_checkout_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

uc_payment_uc_payment_method_checkout_alter in payment/uc_payment/uc_payment.module
Implements hook_uc_payment_method_checkout_alter().
1 invocation of hook_uc_payment_method_checkout_alter()
PaymentMethodPane::view in payment/uc_payment/src/Plugin/Ubercart/CheckoutPane/PaymentMethodPane.php
Returns the contents of a checkout pane.

File

payment/uc_payment/uc_payment.api.php, line 33
Hooks provided by the Payment module.

Code

function hook_uc_payment_method_checkout_alter(&$methods, $order) {

  // Remove the Check payment method for orders under $100.
  if ($order
    ->getTotal() < 100) {
    unset($methods['check']);
  }
}