Skip navigation


7 uc_payment.api.php hook_uc_payment_method()

Registers callbacks for payment methods.

Payment methods are different ways to collect payment. By default, Ubercart comes with support for check, credit card, and generic payments. Payment methods show up at checkout or on the order administration screens, and they collect different sorts of information from the user that is used to process or track the payment.

Return value

An array of payment methods. The array contains a sub-array for each payment method, with the machine-readable type name as the key. Required attributes:

  • "name": the human-readable name of the payment method.
  • "title": the human-readable title of the payment method, displayed during checkout.
  • "desc": a human-readable description of the payment method.
  • "callback": a callback function that handles operations that the method may need to perform. See hook_uc_payment_method_callback()
  • "weight": the default weight of the payment method.
  • "checkout": if TRUE, the payment method will be enabled by default.
  • "no_gateway": should be set to TRUE, except for uc_credit which uses payment gateways.
  • "redirect": if set, this payment method redirects off site; this key specifies a callback function which will be used to generate the form that redirects the user to the payment gateway pages.

See also


Related topics

5 functions implement hook_uc_payment_method()

1 invocation of hook_uc_payment_method()


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


function hook_uc_payment_method() {
  $methods['check'] = array(
    'name' => t('Check'), 
    'title' => t('Check or money order'), 
    'desc' => t('Pay by mailing a check or money order.'), 
    'callback' => 'uc_payment_method_callback', 
    'weight' => 1, 
    'checkout' => TRUE,
  return $methods;