Skip to main content
Version: 1.28 (Current)

Add a Simple Checkout to a button

Audience: Low-code Engineers

Skill Prerequisites: Actions, Authorize.Net account

Sends the user to an Authorize.Net Simple Checkout page to pay for an item. You create a Simple Checkout button for the item in your Authorize.Net account, with its name, price and, if needed, shipping options. Then you paste the button's HTML code into this action.

When the action runs, the browser is redirected to Authorize.Net, and the user pays there. Card details never reach your site.

This action is only available in Forms and Listings.

note

This action is part of the Authorize.Net add-on (DnnSharp.Authorize.Net). The add-on is installed separately and needs the AUTHORIZE feature in your license. If it isn't licensed, the action fails with a "not licensed" error. If you don't see the Authorize.Net actions, the add-on isn't installed.

Typical Use Cases​

  • Add a Buy Now button for a product, a ticket or a donation
  • Take payments without handling card data on your site
  • Send the user to pay after they fill in a registration form

Don't use it to​

Action NameDescription
Make a payment with Credit CardCharges a card on your site and runs actions based on the result.
Make a payment with Electronic CheckTakes a payment from a bank account on your site.
Redirect to URLSends the user to any other page.
Stripe CheckoutTakes a payment through Stripe instead.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
Button CodeThe HTML code that Authorize.Net gives you for the button. Paste it as it is. See Button code requirements.Yesempty stringYes

How it works​

  1. The action saves the button code on the server for three days and redirects the browser to a page on your site (/DesktopModules/DnnSharp/Common/WebHandlers/AuthorizeNetSimpleCheckoutFwd.aspx).
  2. That page writes out the button's form, without its image or submit button, and a script that submits the form right away.
  3. The browser posts the form to Authorize.Net, which shows its checkout page for the item.

The redirect ends execution. Actions after this one don't run. Put any actions that should run first, such as saving the form data, before it.

Button code requirements​

The code is read as XML, so it has to follow a few rules. The code that Authorize.Net generates usually does.

  • One <form> element. The whole code must be a single <form> element with valid XML. For example, every <input> must be closed (<input ... />).
  • A name attribute on the form. The script submits the form by its name. Without one, the page loads but nothing is submitted.
  • Inputs directly inside the form. The image or submit input is removed before the form is submitted. It must be a direct child of <form>, not inside another element.

If the code can't be read, the page shows Error occurred: with the reason, instead of going to Authorize.Net.

Considerations​

  • Nothing comes back. The action doesn't wait for the payment, and there are no tokens or action lists for the result. Set up any receipt or return page, and payment notifications, in your Authorize.Net account.
  • Check that Simple Checkout is available. Simple Checkout is an older Authorize.Net feature. Make sure your account can still create Simple Checkout buttons before you build on it.
  • The link expires. The saved button code is kept for three days. If the user opens the redirect page after that, the page is empty.
  • Tokens in the code. Tokens in the button code are replaced before it's saved. Don't change the values that identify the button, or Authorize.Net won't recognize it.

Examples​

tip

To understand how to use the below examples, please see Running Examples.

1. Send the user to pay for an item​

This action sends the user to the Authorize.Net checkout page for a button. The button code is a placeholder. Replace the whole AuthorizeNetButtonCode value with the code from your Authorize.Net account.

{
"Title": "Add a Simple Checkout to a button",
"ActionType": "Simple Checkout",
"Description": "Go to Authorize.Net to pay for the workshop ticket",
"Parameters": {
"AuthorizeNetButtonCode": "<form name=\"PrePage\" method=\"post\" action=\"PASTE-THE-FORM-ACTION-FROM-AUTHORIZE-NET\"><input type=\"hidden\" name=\"PASTE-THE-HIDDEN-FIELD-NAME\" value=\"PASTE-THE-HIDDEN-FIELD-VALUE\" /><input type=\"image\" src=\"PASTE-THE-IMAGE-URL\" /></form>"
}
}

Revised 09/27/2026