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 Sandbox Account.

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

  • Step 2:Import the SDK

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

    Our PHP SDK is available as a composer package on Packagist.

    If you are configured to use composer, you can include our package by adding the following code to your composer.json file and running composer update.

    "require": { "php": ">=5.2.0", "ext-curl": "*", "authorizenet/authorizenet": "1.8.0" }

    You can also access or download our SDK from Github.

  • Step 3:Create a new PHP file for your sample transaction

    The PHP SDK includes a method called "directPostDemo". This method uses the existing SIM functionality to provide an example of how to run a transaction using the Direct Post Method. To see this demo in action, you can create a new php file and add the following code:

    <?php $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); ?>

    This demo is not intended to be used as is and only works with sandbox accounts. It is recommended that you review the Direct Post Method documentation for a better understanding of how DPM functions and review the SDK code for the directPostDemo method itself.

  • Step 4:Try it out!

    Run this new file from your web browser and review the result.

  • Learn More

  • Step 1:Sign up for a Sandbox Account.

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

  • Step 2:Import the SDK

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

    Our PHP SDK is available as a composer package on Packagist.

    If you are configured to use composer, you can include our package by adding the following code to your composer.json file and running composer update.

    "require": { "php": ">=5.2.0", "ext-curl": "*", "authorizenet/authorizenet": "1.8.0" }

    You can also access or download our SDK from Github.

  • Step 3:Create a new PHP file for your sample transaction

    Copy the code snippet below into a new PHP file on your web server. Add your credentials and make sure you are using the correct form action URL.

    Sandbox: https://test.authorize.net/gateway/transact.dll

    Production: https://secure.authorize.net/gateway/transact.dll

    <?php $api_login_id = 'YOUR_API_LOGIN_ID'; $transaction_key = 'YOUR_TRANSACTION_KEY'; $amount = "5.99"; $fp_timestamp = time(); $fp_sequence = "123" . time(); // Can be changed to 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>

    This is a minimal example of how to create and submit a transaction using the SDK. For more advance options, review the SDK properties and the Server Integration Method documentation.

  • Step 4:Try it out!

    Run this new file from your web browser and review the result.

  • Learn More

  • Step 1:Sign up for a Sandbox Account.

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

  • Step 2:Import the SDK

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

    Our PHP SDK is available as a composer package on Packagist.

    If you are configured to use composer, you can include our package by adding the following code to your composer.json file and running composer update.

    "require": { "php": ">=5.2.0", "ext-curl": "*", "authorizenet/authorizenet": "1.8.0" }

    You can also access or download our SDK from Github.

  • Step 3:Create a new PHP file for your sample transaction

    Copy the code snippet below into a new PHP file on your web server. Add your credentials and make sure you are using the correct sandbox setting (true for sandbox, false for production).

    <?php require_once 'anet_php_sdk/AuthorizeNet.php'; // API credentials only need to be defined once define("AUTHORIZENET_API_LOGIN_ID", "YOURLOGIN"); define("AUTHORIZENET_TRANSACTION_KEY", "YOURKEY"); define("AUTHORIZENET_SANDBOX", true); $sale = new AuthorizeNetAIM; $sale->amount = "5.99"; $sale->card_num = '4111111111111111'; $sale->exp_date = '0418'; $response = $sale->authorizeAndCapture(); if ($response->approved) { echo "Success! Transaction ID:" . $response->transaction_id; } else { echo "ERROR:" . $response->error_message; } ?>

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

  • Learn More