How to Use Authorize.Net Payment in Drupal 9

Accepting online payments is a crucial component of any e-commerce website, and Drupal 9, a robust content management system, makes it relatively straightforward to integrate payment gateways like Authorize.Net. Authorize.Net is a popular choice for processing online payments, and in this blog post, we'll walk you through the steps to integrate Authorize.Net payment into your Drupal 9 website.

Prerequisites

Before you get started, make sure you have the following:

  1. A Drupal 9 website up and running.
  2. An Authorize.Net account, including the API credentials (API Login ID and Transaction Key).
  3. Appropriate permissions to configure payment methods on your Drupal website.

Step 1: Install and Configure the Commerce Module

To enable e-commerce functionality in Drupal 9, you'll need to install the Commerce module. Here's how you can do it:

  1. Log in to your Drupal admin panel.
  2. Navigate to Extend > Install new module.
  3. Search for "Drupal Commerce" and install it.

Once you have installed the Commerce module, enable the necessary sub-modules like Commerce Core, Commerce Product, and Commerce Cart.

Step 2: Install the Authorize.Net Module

Now that you have Drupal Commerce up and running, you'll need to install the Authorize.Net module:

  1. Go to Extend in your Drupal admin panel.
  2. Search for the "Commerce Authorize.Net" module and install it.

Step 3: Configure the Authorize.Net Payment Method

After installing the module, you need to configure it to use your Authorize.Net API credentials:

  1. Navigate to Configuration > Commerce > Configuration.
  2. Under "Payment Gateways," click on "Payment methods."
  3. Click "Add payment method" and select "Authorize.Net."
  4. Enter your API Login ID and Transaction Key provided by Authorize.Net.
  5. Configure other settings like payment method title, description, and payment gateway mode (test or live).
  6. Save your settings.

Step 4: Create and Configure a Payment Gateway Mode

In the configuration for the Authorize.Net payment method, you can set up payment gateway modes. Here's how you can configure a mode for testing and production:

  1. Navigate to Configuration > Commerce > Configuration.
  2. Under "Payment Gateways," click on "Payment gateway modes."
  3. Create a new mode, e.g., "Test Mode" or "Live Mode."
  4. Configure the mode settings, including transaction type (Authorize and Capture), accepted credit card types, and allowed countries.
  5. Save your settings.

Step 5: Test the Payment Gateway

Before going live, it's essential to test your Authorize.Net payment gateway. To do this, you can switch the payment gateway mode to "Test Mode" and use the provided Authorize.Net test credit card information.

  1. Go back to the payment method configuration (Step 3) and choose the "Test Mode."
  2. Use the test credit card number, expiration date, and CVV provided by Authorize.Net for testing purposes.
  3. Make a test purchase to ensure that the payment gateway is working correctly.

Step 6: Go Live

Once you have tested the payment gateway successfully and are ready to accept real payments, you can switch the payment gateway mode to "Live Mode." Be sure to replace the test API credentials with your live Authorize.Net credentials.

Conclusion

Integrating Authorize.Net payment into your Drupal 9 website is a fundamental step in building a functional e-commerce platform. By following the steps outlined in this guide, you can set up and configure the Authorize.Net payment gateway seamlessly. Drupal Commerce and the Authorize.Net module work together to ensure that your website is capable of processing online payments securely and efficiently. Now, you're ready to start accepting payments and running your e-commerce business on Drupal 9.

Share on social media

Add new comment