Documentation Home
This version of the framework is no longer supported. View the latest documentation.

Authorize.net Environment Setup

Prerequisites

Configure your Authorize.net Account*

  1. Login to your Authorize.net account (https://account.authorize.net/ or https://sandbox.authorize.net/) and navigate to your Account Settings. Authorize.net Console
  2. Create a new Transaction Key by navigating to Account > Settings > API Login ID and Transaction Key. Fill out the form to generate a new key Authorize.net Console
  3. Create an MD5Hash (e.g. 12345) by navigating to Account > Settings > MD5Hash Authorize.net Console
  4. Finally, configure the Relay Response URL by navigating to Account > Settings > Response/Receipt URLs. This is the public URL that Authorize.net will send the response of the transaction to. Authorize.net Console
  • Note all of these values down as you will need to enter them in your environment properties files.

Download and Install the Authorize.net Java SDK

The Authorize.net SDK is not available on any public maven repository, so you must download and install it manually.
You can do that here: https://developer.authorize.net/downloads/

Once downloaded, you can install this dependency into your local or shared maven repository

mvn install:install-file -Dfile=anet-java-sdk-1.4.6.jar -DgroupId=net.authorize -DartifactId=anet-java-sdk -Dversion=1.4.6 -Dpackaging=jar

Alternatively, you can install it in a nexus proxy that the local development build is configured to point to.

Next, include both the Authorize.net Java SDK and the Broadleaf Authorize.net Module dependency to your pom.xml.

<!-- Authorize.net Dependencies -->
<dependency>
    <groupId>net.authorize</groupId>
    <artifactId>anet-java-sdk</artifactId>
    <version>1.4.6</version>
    <type>jar</type>
    <scope>compile</scope>
</dependency>
<dependency>
    <groupId>org.broadleafcommerce</groupId>
    <artifactId>broadleaf-authorizenet</artifactId>
    <version>${blc.thirdparty.version}</version>
    <type>jar</type>
    <scope>compile</scope>
</dependency>

Make sure to include the dependency in your site pom.xml as well:

<!-- Authorize.net Dependencies -->
<dependency>
    <groupId>net.authorize</groupId>
    <artifactId>anet-java-sdk</artifactId>
</dependency>
<dependency>
    <groupId>org.broadleafcommerce</groupId>
    <artifactId>broadleaf-authorizenet</artifactId>
</dependency>

You should now begin to setup your environment to work with Broadleaf Commerce Authorize.net support.
The first step is to make Broadleaf Commerce aware of your Authorize.net account credentials.
This is accomplished through environment configuration (see Runtime Environment Configuration).

Broadleaf allows you to create your own property files per environment (e.g. common.properties, local.properties, development.properties, integrationdev.properties, integrationqa.properties, staging.properties, and production.properties)
You will need to enter the following key/value pairs in the appropriate locations:

common.properties

authorizenet.merchant.transaction.version=3.1

local.properties, development.properties, integrationdev.properties, integrationqa.properties

authorizenet.api.login.id=?
authorizenet.transaction.key=?
authorizenet.merchant.md5.key=?

authorizenet.relay.response.url=? (e.g. http://localhost:8080/authorizenet/process)
authorizenet.confirm.url=? (e.g. http://localhost:8080/confirmation)
authorizenet.error.url=? (e.g. http://localhost:8080/authorizenet/error)
authorizenet.server.url=https://test.authorize.net/gateway/transact.dll
authorizenet.x_test_request=FALSE

staging.properties

authorizenet.api.login.id=?
authorizenet.transaction.key=?
authorizenet.merchant.md5.key=?

authorizenet.relay.response.url=? (e.g. http://staging.mycompany.com/authorizenet/process)
authorizenet.confirm.url=? (e.g. http://staging.mycompany.com/confirmation)
authorizenet.error.url=? (e.g. http://staging.mycompany.com/authorizenet/error)
authorizenet.server.url=https://secure.authorize.net/gateway/transact.dll
authorizenet.x_test_request=TRUE

production.properties

authorizenet.api.login.id=?
authorizenet.transaction.key=?
authorizenet.merchant.md5.key=?
authorizenet.relay.response.url=? (e.g. http://mycompany.com/authorizenet/process)
authorizenet.confirm.url=? (e.g. http://mycompany.com/confirmation)
authorizenet.error.url=? (e.g. http://mycompany.com/authorizenet/error)
authorizenet.server.url=https://secure.authorize.net/gateway/transact.dll
authorizenet.x_test_request=FALSE

Now that you have your environment set up, let's begin setting up the Authorize.net Module.