function hook_payment_method in Ubercart 6.2
Same name and namespace in other branches
- 5 docs/hooks.php \hook_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. Required attributes:
- "id": the machine-readable name of the payment method.
- "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.
See also
hook_payment_method_callback()
6 functions implement hook_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_payment_method in payment/
uc_2checkout/ uc_2checkout.module - Implements hook_payment_method().
- uc_credit_payment_method in payment/
uc_credit/ uc_credit.module - Implements hook_payment_method().
- uc_cybersource_payment_method in payment/
uc_cybersource/ uc_cybersource.module - Defines payment method properties.
- uc_order_condition_payment_method in payment/
uc_payment/ uc_payment.ca.inc - Check the order payment method.
- uc_payment_pack_payment_method in payment/
uc_payment_pack/ uc_payment_pack.module - Implements hook_payment_method().
1 invocation of hook_payment_method()
- _payment_method_list in payment/
uc_payment/ uc_payment.module - Builds a list of payment methods defined in the enabled modules.
File
- docs/
hooks.php, line 1050 - These are the hooks that are invoked by the Ubercart core.
Code
function hook_payment_method() {
$methods[] = array(
'id' => 'check',
'name' => t('Check'),
'title' => t('Check or Money Order'),
'desc' => t('Pay by mailing a check or money order.'),
'callback' => 'hook_payment_method_callback',
'weight' => 1,
'checkout' => TRUE,
);
return $methods;
}