You are here

function hook_uc_payment_method in Ubercart 7.3

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

hook_uc_payment_method_callback()

5 functions implement hook_uc_payment_method()

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

uc_2checkout_uc_payment_method in payment/uc_2checkout/uc_2checkout.module
Implements hook_uc_payment_method().
uc_credit_uc_payment_method in payment/uc_credit/uc_credit.module
Implements hook_uc_payment_method().
uc_payment_pack_uc_payment_method in payment/uc_payment_pack/uc_payment_pack.module
Implements hook_uc_payment_method().
uc_payment_uc_payment_method in payment/uc_payment/uc_payment.module
Implements hook_uc_payment_method().
uc_paypal_uc_payment_method in payment/uc_paypal/uc_paypal.module
Implements hook_uc_payment_method().
1 invocation of hook_uc_payment_method()
_uc_payment_method_list in payment/uc_payment/uc_payment.module
Builds a list of payment methods defined in the enabled modules.

File

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

Code

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;
}