Quick Start Guide

Time is money. Integrate payments in your site in 15 minutes or less.

Simply create a test account and your site accepts payments in 15 minutes or less. No matter what language you're working in.

  • Direct Post MethodNew!

    • Fully control the appearance of the entire payment flow.
    • Simplify PCI Compliance.
    • Learn more about DPM
    • Activetabbottom
  • Server Integration Method

    • Provides a customizable, secure hosted payment form.
    • Authorize.Net handles all the steps in the secure transaction process.
    • Learn more about SIM
    • Activetabbottom
  • Advanced Integration Method

    • The most flexible integration.
    • Control all phases of the customer's experience.
    • Learn more about AIM
    • Activetabbottom
  • These steps assume that your web server is on the public internet and can be accessed via a domain name or IP address.

  • Step 1:Sign up for a Test Account.

    Sign up for a test account to obtain an API Login ID and Transaction Key. These keys will authenticate requests to the payment gateway.

  • Step 2:Download the Authorize.Net PHP SDK and include it in your project.

    The Authorize.Net PHP SDK gives you access to the full suite of APIs.

    Download the SDK

    You'll need to include the file "anet_php_sdk/AuthorizeNet.php" in your project so make sure you save the SDK into a folder that your web server can access such as your var/www folder or your htdocs folder.

  • Step 3:Create a new PHP file that implements the Direct Post Method.

    The PHP SDK contains a helper function that implements a demonstration of the Direct Post Method in one line of code. Copy and paste the code below into a new file named "direct_post.php" and fill in any incomplete variables. Make sure your server is publicly accessible and that the $url variable points to this new file.

    <?php require_once 'anet_php_sdk/AuthorizeNet.php'; // The SDK $url = "http://YOUR_DOMAIN.com/direct_post.php"; $api_login_id = 'YOUR_API_LOGIN_ID'; $transaction_key = 'YOUR_TRANSACTION_KEY'; $md5_setting = 'YOUR_API_LOGIN_ID'; // Your MD5 Setting $amount = "5.99"; AuthorizeNetDPM::directPostDemo($url, $api_login_id, $transaction_key, $amount, $md5_setting); ?>

  • Step 4:Review and try it out!

    Go to http://YOUR_DOMAIN.com/direct_post.php in your web browser and click the "Buy" button.

    Verify payment transaction success on your transaction report.

  • Learn More

  • Step 1:Sign up for a Test Account.

    Sign up for a test account to obtain an API Login ID and Transaction Key. These keys will authenticate requests to the payment gateway.

  • Step 2:Download the Authorize.Net PHP SDK and include it in your project.

    The Authorize.Net PHP SDK gives you access to the full suite of APIs.

    Download the SDK

    You'll need to include the file "anet_php_sdk/AuthorizeNet.php" in your project so make sure you save the SDK into a folder that your web server can access such as your var/www folder or your htdocs folder.

  • Step 3:Create a checkout form.

    Create a new file named "sim.php". Cut and paste the code below into this new file.

    Add your API credentials and then load the page in your browser.

    <?php require_once 'anet_php_sdk/AuthorizeNet.php'; // Include the SDK you downloaded in Step 2 $api_login_id = 'YOUR_API_LOGIN_ID'; $transaction_key = 'YOUR_TRANSACTION_KEY'; $amount = "5.99"; $fp_timestamp = time(); $fp_sequence = "123" . time(); // Enter an invoice or other unique number. $fingerprint = AuthorizeNetSIM_Form::getFingerprint($api_login_id,   $transaction_key, $amount, $fp_sequence, $fp_timestamp) ?> <form method='post' action="https://test.authorize.net/gateway/transact.dll"> <input type='hidden' name="x_login" value="<?php echo $api_login_id?>" /> <input type='hidden' name="x_fp_hash" value="<?php echo $fingerprint?>" /> <input type='hidden' name="x_amount" value="<?php echo $amount?>" /> <input type='hidden' name="x_fp_timestamp" value="<?php echo $fp_timestamp?>" /> <input type='hidden' name="x_fp_sequence" value="<?php echo $fp_sequence?>" /> <input type='hidden' name="x_version" value="3.1"> <input type='hidden' name="x_show_form" value="payment_form"> <input type='hidden' name="x_test_request" value="false" /> <input type='hidden' name="x_method" value="cc"> <input type='submit' value="Click here for the secure payment form"> </form>

  • Step 4:Test your HTML form and verify the transaction.

    Screenshot Transaction

    Visit the new payment experience you've just built. Go to this new sim.php file in your browser, click the payment button and complete the payment form that appears on the hosted payment page.

    Select "Visa" and enter the test credit card number 4111111111111111, any expiration date (MMYY) in the future (such as "1120"), and hit "Submit".

    Verify payment transaction success on your transaction report.

  • Learn More

  • Step 1:Sign up for a Test Account.

    Sign up for a test account to obtain an API Login ID and Transaction Key. These keys will authenticate requests to the payment gateway.

  • Step 2:Download the Authorize.Net PHP SDK and include it in your project.

    The Authorize.Net PHP SDK gives you access to the full suite of APIs.

    Download the SDK

    You'll need to include the file "anet_php_sdk/AuthorizeNet.php" in your project so make sure you save the SDK into a folder that your web server can access such as your var/www folder or your htdocs folder.

  • Step 3:Create a new PHP file that sends a transaction to the payment gateway.

    Copy the code snippet below into a new PHP file named "aim_test.php" on your web server. Add your test credentials and make sure the path to the PHP SDK is correct.

    The example below is a minimal example of how to create and submit a transaction using the SDK. For more advanced options, see the Advanced Integration Method.

    <?php require_once 'anet_php_sdk/AuthorizeNet.php'; // Make sure this path is correct. $transaction = new AuthorizeNetAIM('YOUR_API_LOGIN_ID', 'YOUR_TRANSACTION_KEY'); $transaction->amount = '9.99'; $transaction->card_num = '4007000000027'; $transaction->exp_date = '10/16'; $response = $transaction->authorizeAndCapture(); if ($response->approved) {   echo "<h1>Success! The test credit card has been charged!</h1>";   echo "Transaction ID: " . $response->transaction_id; } else {   echo $response->error_message; } ?>

    Now run this file via your web browser and verify payment transaction success on your transaction report.

  • Learn More