You are here

function hook_payment_line_item_info in Payment 7

Defines line item types.

Return value

array An array with PaymentLineItemInfo objects.

See also

Payment::getLineItems()

2 functions implement hook_payment_line_item_info()

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

payment_payment_line_item_info in ./payment.payment.inc
Implements hook_payment_line_item_info().
payment_test_payment_line_item_info in tests/payment_test/payment_test.module
Implements hook_payment_line_item_info().
1 invocation of hook_payment_line_item_info()
payment_line_items_info in ./payment.module
Returns information about all line item types.

File

./payment.api.php, line 78
Hook documentation.

Code

function hook_payment_line_item_info() {
  return array(
    new PaymentLineItemInfo(array(
      'name' => 'foo_fee_credit_card',
      'title' => t('Credit card fee'),
    )),
    new PaymentLineItemInfo(array(
      'name' => 'foo_fee_wire_transfer',
      'title' => t('Wire transfer fee'),
    )),
    new PaymentLineItemInfo(array(
      // Use a custom callback, so we can get any/all line items we need
      // simultaneously.
      'callback' => 'foo_payment_line_item_get_fee',
      'name' => 'foo_fee',
      'title' => t('Any payment method fee'),
    )),
  );
}