Add-ons and ModulesAuthorize.Net PSP Module

Authorize.Net PSP Module

Sana Commerce 8.2
Your provider

Configure a Test Authorize.Net Payment Module

In order to add the Authorize.Net Payment Module to a project with a test account, please undertake the following steps:

Step 1: Request the Authorize.Net test account at

Step 2: Copy the 'Sana.Commerce.Payment. AuthorizeNet.dll', 'Sana.Commerce.Payment.AuthorizeNet.pdb' and 'Sana.Commerce.Payment.AuthorizeNet.xml' files from the 'bin' folder of the Authorize.Net add-on package to the 'Frontend/bin' folder of Sana Commerce.

Step 3: Configure the Sana Commerce frontend to use the Authorize.Net payment module. This configuration is performed in the 'web.config' file of the Sana Commerce frontend:

  • Locate the 'AuthorizeNet configuration section.txt' file in the 'configuration' folder, which contains the Authorize.Net payment module configuration section;

  • Copy the whole text of this file into the <payment-configuration> section of the 'web.config' file, it will look as follows: 
<module name="Authorize.Net" type="Sana.Commerce.Payment.AuthorizeNet.AuthorizeNetPaymentModule, Sana.Commerce.Payment.AuthorizeNet">
            <clear />
            <add name="IpCheck" value="64.94.*.*|" isRequestParameter="false" />
            <add name="x_login" value="..." isRequestParameter="true" />
            <add name="x_transaction_key" value="..." isRequestParameter="false" />
            <add name="x_delim_data" value="FALSE" isRequestParameter="true" />
            <add name="x_show_form" value="PAYMENT_FORM" isRequestParameter="true" />
            <add name="x_MD5_HashKey" value="" isRequestParameter="false" />
            <add name="x_version" value="3.1" isRequestParameter="true" />
            <add name="x_test_request" value="true" isRequestParameter="true" />          
            <add name="ResponseUsePost" value="true" isRequestParameter="false" />
            <add name="PaymentPage" value="" isRequestParameter="true" />
            <add name="x_relay_response" value="TRUE" isRequestParameter="true" />
            <add name="x_relay_url" value="RelayResponse.aspx" isRequestParameter="true" />          
            <add name="return_url_success" value="checkout/ordersubmit.aspx?id=" isRequestParameter="true" />
            <add name="return_url_error" value="checkout/orderfailed.aspx?id=" isRequestParameter="true" />

Step 4: Specify the x_login and x_transaction_key values which you have received from Authorize.Net.

Step 5: In the Sana Commerce frontend directory create the 'confirm' folder. In IIS set anonymous access rights on the 'confirm' folder.

Note, that this folder is needed only for the test environment.

Step 6: In the 'web.config' file of the Sana Commerce frontend add the following HttpHandler configuration entry to the <httpHandlers> node:

<add verb="*" path="confirm/RelayResponse.aspx" type="Sana.Commerce.Payment.AuthorizeNet.RelayResponseHttpHandler, Sana.Commerce.Payment.AuthorizeNet" />

The link to this handler is posted to Authorize.Net as a value of such parameter x_relay_url. Authorize.Net returns transaction results to the merchant using the HTML form POST in order to process Relay Response by this handler.

Make sure that URL which you use as a Relay Response URL (x_relay_url parameter) is on port 80 (or port 443 if you have an SSL certificate installed) and is publically accessible and exists within a firewall that does not prevent Authorize.Net from connecting with it.

For testing Authorize.Net payment module the web page address which is posted to Authorize.Net as a value of x_relay_url parameter must be available from outside because it will be called by Authorize.Net.

For an explanation of the Authorize.Net configuration values, please read this chapter and the chapter 'Authorize.Net Specific Configuration Values' and the chapter 'General External Payment Method Configuration Values'.

Step 7: Configure the Authorize.Net payment methods. There are two ways to do this:

  • Configure the Authorize.Net payment methods in the Sana Commerce backoffice. For more information read this chapter.

    The 'PSP code' value for the 'Authorize.Net Credit Card' payment method is 'CC'.
    The 'PSP code' value for the 'Authorize.Net ECheck' payment method is 'ECHECK'.

  • Configure the Authorize.Net payment methods by executing the 'ConfigureAuthorizeNetInDB.sql' SQL script on the Sana Commerce database, from the 'scripts' folder.

    Before running the script make sure that you have changed the '@siteId' variable (if needed) to match the appropriate website identifier and check whether the currency is correct.

    The 'ConfigureAuthorizeNetInDB.sql' SQL script will add the 'Authorize.Net Credit Card' and 'Authorize.Net ECheck' payment methods.

    These payment methods will be available for all countries configured in the system. No translations for the payment methods will be set by this script - this should be done manually. After the script has been executed, all fields should be checked for the correct values.

Step 8: Find the 'files' folder, where the Authorize.Net payment method icons are stored. Copy the 'files' folder to 'Frontend\content\'. These icons will be displayed on the frontend in the payment method selection control.

Step 9: When all the changes are made, in the Sana Commerce backoffice click the 'Refresh site cache' button.

Step 10: Test the payment/checkout flow to see if everything works fine, using the newly configured payment methods and the correct payment statuses that are set.

Add-ons and ModulesAuthorize.Net PSP Module