Add-ons and ModulesAuthorize.Net PSP Module

Authorize.Net PSP Module

Sana Commerce 8.1
Your provider

Configure a Test Authorize.Net Payment Module

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

Step 1: Copy the 'Sana.Commerce.Payment. AuthorizeNet.dll', 'Sana.Commerce.Payment.AuthorizeNet.pdb' and 'Sana.Commerce.Payment.AuthorizeNet.xml' files from the Authorize.Net release to the 'Frontend/Bin' folder of Sana Commerce.

Step 2: Add a new payment module configuration entry in the <payment-configuration> node of the Starter Site's 'web.config' to the Authorize.Net module. This entry should contain the following values: 

<module name="Authorize.Net" type="Sana.Commerce.Payment.AuthorizeNet.AuthorizeNetPaymentModule, Sana.Commerce.Payment.AuthorizeNet">
          <settings>
            <clear />
            <add name="IpCheck" value="64.94.*.*|127.0.0.1" isRequestParameter="false" />
            <add name="IsFramed" value="true" 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="https://test.authorize.net/gateway/transact.dll" 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" />
          </settings>
</module>

Step 3: Add a new HttpHandler configuration entry in the <httpHandlers> node of the Starter Site's 'web.config'.
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. This entry should contain the following value:

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

For an explanation of these configuration values, please read this chapter and the chapter 'Authorize.Net Specific Configuration Values' below.

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

  • Configure the Authorize.Net payment methods in the 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 running the 'ConfigureAuthorizeNetInDB.sql' SQL script in the Sana Commerce database.

    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 run, all fields should be checked for the correct values.

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

Step 5: Request a test account from Authorize.Net and modify the x_login and x_transaction_key to the login name and transaction key you have received from Authorize.Net.

Step 6: 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 7: When all the changes are made, the 'Refresh site cache' button in the 'Sana Commerce - Backoffice' should be clicked.

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

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.

If there are problems with the Authorize.Net payment module 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.
Add-ons and ModulesAuthorize.Net PSP Module