The Accept sample application provides examples of how to use the Authorize.Net Accept suite of tools to integrate secure payment acceptance into your applications.
Clone or download this repository.
Host the sample app in any web server supporting PHP, for example IIS or XAMPP (Apache). HTTPS (SSL) must be enabled for your website.
Set the authentication credentials in the application so that it uses your Authorize.Net sandbox (test) account. If you haven't yet signed up for a sandbox account, you can create a sandbox account at our [Developer Center] (https://developer.authorize.net/hello_world/sandbox/). Set environment variables for API_LOGIN_ID
and TRANSACTION_KEY
using the credentials for your Authorize.Net sandbox account. For example, in httpd.conf, you would add the following lines:
SetEnv API_LOGIN_ID your_id
SetEnv TRANSACTION_KEY your_key
For IIS, you could set these environment variables in FastCGI Settings -> Environment Variables.
Set the authentication credentials that Accept.js uses. Edit the acceptJSCaller()
function in acceptJSCaller.js to use your API login ID and public client key for the values of authData.apiLoginID
and authData.clientKey
. A public client key can be created by logging into the Merchant Interface and navigating to Account --> Security Settings --> Manage Public Client Key.
Browse the application (index.php) over HTTPS connection.
To "log in", use a customer profile ID that already exists within your account or create a new one by using the Create a Customer Profile API.
In these examples, payment forms are shown in the same page and Shipping forms are handled in a separate modal popup. However, any of the types of display can be chosen to display any type of form.
Accept Customer is the new name for Hosted CIM, part of our Customer Profiles API. See our developer documentation for more details.
The sample application shows how to:
Accept.js is a new integration option which allows you to leverage the full power of the Authorize.Net API while avoiding the PCI compliance burden of credit card information hitting your servers. See our developer documentation for more details.
The sample application shows how to:
Accept Hosted provides a fully hosted payment transaction solution. Authorize.Net takes care of the payment form, the transaction itself, and the receipt generation (optional). We have a Step-by-Step guide to the sample implementation here: README-AcceptHosted.md. See our developer documentation for more details.
The sample application shows how to:
Authorize.Net supports Apple Pay on the Web in addition to our in-app Apple Pay Support. See our developer documentation for more details.
In this sample we demonstrate how to:
createTransactionRequest
API call. Please note that you will need to have a merchant ID set up with Apple as described in their Apple Pay documentation.