hook_receipt_info

Definition

hook_receipt_info()
ecommerce-5--4/docs/developer/hooks/ec_receipt.php, line 29

Description

Register payments gateways to the e-Commerce Receipts system

Return value

Return an array or receipt info blocks to the system.

Related topics

Namesort iconDescription
HooksAllow modules to interact with the Drupal core.

Code

<?php
function hook_receipt_info() {
  // Because you can create a module what provides several
  // payment gateways, we ask for a array containing
  // info about each of them.
  return array(
    'cod' => array(
      // Description
      'name'                 => t('Gateway example'),
      'description'          => t('Clients pay when they receive their products.'),

      // (Optional). The payment icon
      'icon' => array(
        'src' => drupal_get_path('module', 'example') .'/example.gif',
        'attributes' => array(
          'title' => t('Example Logo'),
          'class' => 'example-logo',
        ),
      ),

      // List only the currencies supported by your
      // payment gateway
      'currencies_supported' => array('AUD', 'USD'),

      // Remember to set the 'module' attribute
      // differently to each payment gateway
      'module'               => array('example'),

      // (Optional). All money operations that this method allow.
      // For payment gateways, use "allow_payments".
      'allow_payments'       => TRUE,
      'allow_admin_payments' => TRUE,
      'allow_refunds'        => TRUE,
      'allow_payto'          => TRUE,
      'allow_recurring'      => TRUE,

      // (Optional). Extra third party requirements. You should include all
      // restrictions and notices.
      'gateway_requirements' => NULL,
    ),
  );
}
?>