You are here

function hook_commerce_payment_methods in Commerce Core 7

Populates an order's data array with payment methods available in checkout.

The Payment module primarily depends on Rules to populate the payment method checkout pane with options using an action that enables a particular payment method for use. The action adds payment method instance information to the order's data array that is used by the pane form to add options to the radio select element. This hook may be used to do the same thing, meaning it should not return any information but update the order object's data array just like the payment method enabling action.

It should be noted that using Rules is the preferred method, as this hook is being made available secondarily through the use of rules_invoke_all().

Parameters

$order: The order object represented on the checkout form.

See also

commerce_payment_pane_checkout_form()

commerce_payment_enable_method()

rules_invoke_all()

File

modules/payment/commerce_payment.api.php, line 341
Hooks provided by the Payment module.

Code

function hook_commerce_payment_methods($order) {

  // No example. See commerce_payment_enable_method() for a guide to what you
  // must add to the order's data array.
}