Integrating Authorize.net into Drupal
hook_menu

items['authorize-form'] = array(

  'title' =&gt; t('Pay via Authorize'),

  'page callback' =&gt; 'generate_authorize_form',

  'access arguments' =&gt; array('access content'),

  'type' =&gt; MENU_CALLBACK

);


Callback function to generate authorize form using Authorize.net SDK

function generate_authorize_form(){
    require_once 'anet_php_sdk/AuthorizeNet.php'; // The SDK
    $url = "http://YOUR_DOMAIN.com/index.php";
    $api_login_id = 'xxxxxxxxx';
    $transaction_key = 'xxxxxxxxxxxxxxxx';
    $md5_setting = 'xxxxxxxxx'; // Your MD5 Setting
    $amount = "5.99";

    ob_start();
    AuthorizeNetDPM::directPostDemo($url, $api_login_id, $transaction_key, $amount, $md5_setting);

    $output = ob_get_content();
    ob_end_clean();
    return $output;
}