Skip to content
OpenCart · User manual

Authorize.net Accept Hosted

Version 1.3.9 Product page
Chapter 5

Webhook

Authorize.net notifies your store of each payment through a webhook. This chapter explains what it does, how to create and check it, and how to create it by hand.

What the webhook does

A webhook is a message that Authorize.net sends to your store when a payment is created. The extension registers one webhook in your Authorize.net account, named danah_webhook, for these events:

  • net.authorize.payment.authcapture.created
  • net.authorize.payment.authorization.created
  • net.authorize.payment.capture.created

The messages are delivered to the file devman_authorize_net_ah_webhook.php in the root of your store, for example https://www.yourshop.com/devman_authorize_net_ah_webhook.php. The settings show the exact address for your store.

When a message arrives, the extension:

  1. checks its signature with your Signature Key and rejects it if it does not match;
  2. asks Authorize.net for the details of the transaction;
  3. if the order has not been confirmed yet, confirms it with the paid status, or with the held status when the payment is held for review or the amount does not match the order total;
  4. adds a comment Updated via WebHook with the transaction details to the order history.

An order that already has a status is not changed again. In redirect mode the webhook is what confirms the order. In embedded mode the order is normally confirmed as soon as the payment is made, and the webhook covers the cases where the customer's browser does not complete that step.

OpenCart 1.5 to 3.x

The Webhook section at the end of the General tab shows the webhook address of your store and two buttons:

ButtonWhat it does
Check webhookAsks Authorize.net whether an active webhook exists for your store address. The answer is Webhook active and URL verified. or No active webhook exists for this store URL.
Recreate webhookDeletes the webhooks named danah_webhook in your Authorize.net account and creates a new, active one for your store address. The answer is Webhook recreated successfully.

Each time you press Apply changes, the extension also checks the webhook: it creates it if it is missing, removes duplicates, and replaces a webhook that is inactive or points to another address. If this fails, the settings are still saved and a message gives the reason. Press Check webhook to confirm.

"Active and URL verified" confirms the registration only. It cannot tell whether the Signature Key is correct; the first real payment shows that. When you change the credentials, the Transaction Server or the address of your store, apply the changes again; Recreate webhook remains available to replace the webhook at any time.

OpenCart 4

The Webhook Status card above Status on the General tab shows:

FieldMeaning
Current StatusActive, Inactive, Not Found or Error.
Webhook IDThe identifier of the webhook in Authorize.net.
Registered URLThe address the webhook delivers to.
Subscribed Event TypesThe events the webhook listens to.

A details line explains problems, for example Multiple webhooks with the extension name were found. or Expected webhook URL: … when the registered address is not the one of your store.

  • Re-check reads the status again from Authorize.net.
  • Recreate deletes the existing webhooks of the extension and creates a new one.

Each time you press Apply changes, the extension also checks the webhook: it creates it if it is missing, removes duplicates, and replaces a webhook that points to another address. If this fails, the error message explains how to create the webhook by hand.

Creating the webhook by hand

If your store cannot create the webhook automatically, create it in the Authorize.net Merchant Interface under Account > Webhooks:

FieldValue
Namedanah_webhook
URLThe webhook address shown in the extension settings
StatusActive
Eventsnet.authorize.payment.authcapture.created, net.authorize.payment.authorization.created and net.authorize.payment.capture.created

Then check it with Check webhook or Re-check.

Sandbox and live

The webhook is created in the Authorize.net environment selected in Transaction Server: the sandbox for Test, production for Live. When you switch from test to live, enter the live credentials and Signature Key, apply the changes and make sure an active webhook exists in the live account.

Still need help?

Open a support ticket from your account and our team will look at your store with you.