Authorize.net Payment Terminal

Overview

Our payment terminal script provides a quick, user-friendly solution for your clients to pay with major credit cards (Visa, MasterCard, American Express, Discover) directly on your website without redirecting to an external site. It also supports PayPal payments through the PayPal gateway. Installation and configuration take less than 5 minutes, though an SSL certificate and an Authorize.net account are required.

With this script, you have three flexible payment options:

  1. Allow clients to enter a custom amount and add a description
  2. Enable pre-defined services for selection from a dropdown menu
  3. Offer recurring services from a dropdown for automatic repeat payments

You can also optionally enable PayPal Website Payments Standard for both one-time and recurring payments and integrate eCheck to accept payments via eCheck within the US.

Server Requirements

1) PHP 5.0 or later (tested on 5.0, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 8.0, 8.1, 8.2)

2) cURL must be enabled to accept payments (contact your hosting provider if unsure).

Installation

Fresh installation is pretty simple. 

1) Unzip the contents of the file which you downloaded from codecanyon.net.
You will find 2 folders: “authorize-payment-terminal” and “documentation”

2) open authorize-payment-terminal/includes/config.php and edit all needed variables (see explanation below)

3) Upload “authorize-payment-terminal” folder to your FTP server. 

Configuration

Below you will find all editable variables from includes/config.php and their meaning.

Basic Configuration
$title – Set the title displayed on pages.
$admin_email – Notification email address for “new payment received” emails. Can be multiple emails, comma separated.

Theme Customization
$theme – Set the website theme. Options include:
grey-blue-theme, grey-green-theme, black-white-theme

Service Configuration
$services – Define non-recurring services. Each entry includes service name, price, and an optional custom thank-you URL.
$show_services – If set to true, displays a dropdown of services on the payment page; otherwise, a fillable amount box appears.

Payment Mode
$payment_mode – Set to ONETIME for single payments, or RECUR for recurring payments. Recurring services are defined below.

Recurring Payment Configuration
Define recurring services with these parameters:

  • Service name
  • Price
  • Billing period: Day, Week, Month, Year
  • Frequency (e.g., 3 with Month bills every 3 months)
  • Trial period in days
  • Trial price

Environment Configuration
$redirect_non_https – Redirects non-HTTPS traffic to HTTPS if set to true. Make sure SSL is configured.
$liveMode – Set to true for live transactions, false for testing.
MERCHANT_LOGIN and MERCHANT_TRAN_KEY – Enter these for both test and live environments.

Additional Payment Options
$enableCustomerID – Allows tracking of customer IDs.
$enableReCaptcha – Enables Google reCAPTCHA for spam protection; specify $reCaptcha_siteKey and $reCaptcha_secretKey for setup.

Post-Payment Redirect
$redirectAfterSuccessPayment – Redirects customers to a specific URL after successful payment. Set $redirectAfterSuccessPayment to true and provide the $redirectURL.

Enable eCheck Payments
$enable_echeck – Shows or hides the eCheck payment option on the form.

PayPal Express Checkout
$enable_paypal – Shows or hides PayPal as a payment option.
$sandbox – Set to true for testing with the PayPal sandbox.

Coupon Configuration
$enableCoupons – Enables coupon functionality.
$coupons – Configure discounts per service or globally.
$coupon_usage_file – Uses a JSON file to track usage and limit coupon applications.

Important Notes
Ensure SSL is configured for secure redirection.
Update date_default_timezone_set to match your local timezone.

Error Codes

Below error codes were taken from http://www.authorize.net/support/ARB_guide.pdf

API Error Code: E00001
Error Code Text: An error occurred during processing. Please try again.
Description: An unexpected system error occurred while processing this request.

 

API Error Code: E00002
Error Code Text: The content-type specified is not supported.
Description: The only supported content-types are text/xml and application/xml.

 

API Error Code: E00003
Error Code Text: An error occurred while parsing the XML request.
Description: This is the result of an XML parser error.

 

API Error Code: E00004
Error Code Text: The name of the requested API method is invalid.
Description: The name of the root node of the XML request is the API method being called. It is not valid.

 

API Error Code: E00005
Error Code Text: The merchantAuthentication.transactionKey is invalid or not present.
Description: Merchant authentication requires a valid value for transaction key.

 

API Error Code: E00006
Error Code Text: The merchantAuthentication.name is invalid or not present.
Description: Merchant authentication requires a valid value for name.

 

API Error Code: E00007
Error Code Text: User authentication failed due to invalid authentication values.
Description: The name/and or transaction key is invalid.
Other Tips: Try switching between production and developer test URL’s. The test URL requires a separate developer test account, which can be set up by filling out the following form: http://developer.authorize.net/testaccount.

 

API Error Code: E00008
Error Code Text: User authentication failed. The payment gateway account or user is inactive.
Description: The payment gateway or user account is not currently active.

 

API Error Code: E00009
Error Code Text: The payment gateway account is in Test Mode. The request cannot be processed.
Description: The requested API method cannot be executed while the payment gateway account is in Test Mode.
Other Tips: Testing ARB and developer test URLs requires a separate developer test account, which can be set up by filling out the following form: http://developer.authorize.net/testaccount.

 

API Error Code: E00010
Error Code Text: User authentication failed. You do not have the appropriate permissions.
Description: The user does not have permission to call the API.

 

API Error Code: E00011
Error Code Text: Access denied. You do not have the appropriate permissions.
Description: The user does not have permission to call the API method.

 

API Error Code: E00012
Error Code Text: A duplicate subscription already exists.
Description: A duplicate of the subscription was already submitted. The duplicate check looks at several fields including payment information, billing information and, specifically for subscriptions, Start Date, Interval and Unit.

 

API Error Code: E00013
Error Code Text: The field is invalid.
Description: One of the field values is not valid.

 

API Error Code: E00014
Error Code Text: A required field is not present.
Description: One of the required fields was not present.

 

API Error Code: E00015
Error Code Text: The field length is invalid.
Description: One of the fields has an invalid length.

 

API Error Code: E00016
Error Code Text: The field type is invalid.
Description: The field type is not valid.

 

API Error Code: E00017
Error Code Text: The startDate cannot occur in the past.
Description: The subscription start date cannot occur before the subscription submission date. (Note: validation is performed against local server date, which is Mountain Time.)

 

API Error Code: E00018
Error Code Text: The credit card expires before the subscription startDate.
Description: The credit card is not valid as of the start date of the subscription.

 

API Error Code: E00019
Error Code Text: The customer taxId or driversLicense information is required.
Description: The customer tax ID or driver’s license information (driver’s license number, driver’s license state, driver’s license DOB) is required for the subscription.

 

API Error Code: E00020
Error Code Text: The payment gateway account is not enabled for eCheck.Net subscriptions.
Description: This payment gateway account is not set up to process eCheck.Net subscriptions.

 

API Error Code: E00021
Error Code Text: The payment gateway account is not enabled for credit card subscriptions.
Description: This payment gateway account is not set up to process credit card subscriptions.

 

API Error Code: E00022
Error Code Text: The interval length cannot exceed 365 days or 12 months.
Description: The interval length must be 7 to 365 days or 1 to 12 months.

 

API Error Code: E00024
Error Code Text: The trialOccurrences is required when trialAmount is specified.
Description: The number of trial occurrences cannot be zero if a valid trial amount is submitted.

 

API Error Code: E00025
Error Code Text: Automated Recurring Billing is not enabled.
Description: The payment gateway account is not enabled for Automated Recurring Billing.

 

API Error Code: E00026
Error Code Text: Both trialAmount and trialOccurrences are required.
Description: If either a trial amount or number of trial occurrences is specified then values for both must be submitted.

 

API Error Code: E00027
Error Code Text: The test transaction was unsuccessful.
Description: An approval was not returned for the test transaction.

 

API Error Code: E00028
Error Code Text: The trialOccurrences must be less than totalOccurrences.
Description: The number of trial occurrences specified must be less than the number of total occurrences specified.

 

API Error Code: E00029
Error Code Text: Payment information is required.
Description: Payment information is required when creating a subscription or payment profile.

 

API Error Code: E00030
Error Code Text: A paymentSchedule is required.
Description: A payment schedule is required when creating a subscription.

 

API Error Code: E00031
Error Code Text: The amount is required.
Description: The subscription amount is required when creating a subscription.

 

API Error Code: E00032
Error Code Text: The startDate is required.
Description: The subscription start date is required to create a subscription.

 

API Error Code: E00033
Error Code Text: The subscription Start Date cannot be changed.
Description: Once a subscription is created the Start Date cannot be changed.

 

API Error Code: E00034
Error Code Text: The interval information cannot be changed.
Description: Once a subscription is created the subscription interval cannot be changed.

 

API Error Code: E00035
Error Code Text: The subscription cannot be found.
Description: The subscription ID for this request is not valid for this merchant.

 

API Error Code: E00036
Error Code Text: The payment type cannot be changed.
Description: Changing the subscription payment type between credit card and eCheck.Net is not currently supported.

 

API Error Code: E00037
Error Code Text: The subscription cannot be updated.
Description: Subscriptions that are expired, canceled or terminated cannot be updated.

 

API Error Code: E00038
Error Code Text: The subscription cannot be canceled.
Description: Subscriptions that are expired or terminated cannot be canceled.

 

API Error Code: E00045
Error Code Text: The root node does not reference a valid XML namespace.
Description: An error exists in the XML namespace. This error is similar to E00003.

 

API Error Code: I00001
Error Code Text: Successful
Description: The request was processed successfully.

PayPal Configuration

In order to enable PayPal payments (Website Payments Standard), set $enable_paypal in config.php to true. Additional PayPal settings are detailed below:

$paypal_merchant_email – Your PayPal merchant email address.
$paypal_success_url – URL where customers are directed after a successful PayPal payment.
$paypal_cancel_url – URL where customers are directed if they cancel their PayPal payment.
$paypal_ipn_listener_url – URL for the IPN listener file that handles PayPal’s payment responses. This listener can be used to update your database with new payment notifications.
$paypal_custom_variable – Optional custom variable to pass customer-specific information, which can be used for updating the database later in the IPN listener.
$paypal_currency – The currency used for PayPal transactions (e.g., USD).
$sandbox – Set to true for PayPal Sandbox (test) mode, or false for live transactions. If set to true, ensure you have a PayPal Developer account and are logged in at https://developer.paypal.com.

Beyond these variables, no additional changes are required for PayPal integration.

PayPal Recurring Parameters (for paypal website payments standard recurring functionality, taken from paypal.com)

Name

Required or Optional

Description

Character Length

business

Required

Your PayPal ID or an email address associated with your PayPal account. Email addresses must be confirmed.

 

item_name

Optional

Description of item being sold. If you are collecting aggregate payments, the value can be a summary of all items purchased, a tracking number, or a generic term such as “subscription.” If this variable is omitted, buyers see a field in which they can enter the item name.

127

currency_code

Optional

The currency of prices for trial periods and the subscription. The default is USD.

For allowable values, see Currencies Supported by PayPal.

3

a1

Optional

Trial period 1 price. For a free trial period, specify 0.

 

p1

See description.

Trial period 1 duration. Required if you specify a1. Specify an integer value in the allowable range for the units of duration that you specify with t1.

2

t1

See description.

Trial period 1 units of duration. Required if you specify a1.

Allowable values are:

  • D – for days; allowable range for p2 is 1 to 90

  • W – for weeks; allowable range for p2 is 1 to 52

  • M – for months; allowable range for p2 is 1 to 24

  • Y – for years; allowable range for p2 is 1 to 5

1

a2

Optional

Trial period 2 price. Can be specified only if you also specify a1.

 

p2

See description.

Trial period 2 duration. Required if you specify a2. Specify an integer value in the allowable range for the units of duration that you specify with t2.

2

t2

See description.

Trial period 2 units of duration.

Allowable values are:

  • D – for days; allowable range for p2 is 1 to 90

  • W – for weeks; allowable range for p2 is 1 to 52

  • M – for months; allowable range for p2 is 1 to 24

  • Y – for years; allowable range for p2 is 1 to 5

1

a3

Required

Regular subscription price.

 

p3

Required

Subscription duration. Specify an integer value in the allowable range for the units of duration that you specify with t3.

2

t3

Required

Regular subscription units of duration.

Allowable values are:

  • D – for days; allowable range for p3 is 1 to 90

  • W – for weeks; allowable range for p3 is 1 to 52

  • M – for months; allowable range for p3 is 1 to 24

  • Y – for years; allowable range for p3 is 1 to 5

1

src

Optional

Recurring payments. Subscription payments recur unless subscribers cancel their subscriptions before the end of the current billing cycle or you limit the number of times that payments recur with the value that you specify for srt.

Allowable values are:

  • 0 – subscription payments do not recur

  • 1 – subscription payments recur

The default is 0.

1

srt

Optional

Recurring times. Number of times that subscription payments recur. Specify an integer with a minimum value of 1 and a maximum value of 52. Valid only if you specify src=”1″.

1

sra

Optional

Reattempt on failure. If a recurring payment fails, PayPal attempts to collect the payment two more times before canceling the subscription.

Allowable values are:

  • 0 – do not reattempt failed recurring payments

  • 1 – reattempt failed recurring payments before canceling

The default is 1.

For more information, see Reattempting Failed Recurring Payments with Subscribe Buttons.

1

no_note

Required

Do not prompt buyers to include a note with their payments. Allowable values for Subscribe buttons:

  • 1 – hide the text box and the prompt

For Subscribe buttons, always include no_note set to 1. )

1

custom

Optional

User-defined field which PayPal passes through the system and returns to you in your merchant payment notification email. Subscribers do not see this field.

255

invoice

Optional

User-defined field which must be unique with each subscription. The invoice number is shown to subscribers with the other details of their payments

127

modify

Optional

Modification behavior.

Allowable values are:

  • 0 – allows subscribers only to sign up for new subscriptions

  • 1 – allows subscribers to sign up for new subscriptions and modify their current subscriptions

  • 2 – allows subscribers to modify only their current subscriptions

The default value is 0.

For more information, see Working with Modify Subscription Buttons.

1

usr_manage

Optional

Set to 1 to have PayPal generate usernames and initial passwords for subscribers.

For more information, see Generating Usernames and Passwords with Subscribe Buttons.

1

Link to Database

In order to connect Authorize.net payment terminal with your existing website database, to insert new orders or update existing upon successful payment you need to place your “update order” or “insert new order” code into following places:
For regular payments (and non-recuring payments): includes/form.processing.php – between line 203 and line 205
For recurring payments: includes/form.processing.php – between line 419 and 421
For paypal payments standard : paypal_listener.php – between line 61 and 63

Live / Test Modes

You need to set variable on line 52 and 53 in includes/config.php to TRUE to use LIVE MODE and switch to FALSE to use TEST MODE 

Also don’t forget to set sandbox mode to false for paypal on line 82 in same file (if paypal payments are enabled on line 82).

Another point brought to our attention by our customer (jayhughes): even if you’re using live api credentials – you must turn off TEST MODE in your LIVE authorize.net account. Otherwise all LIVE transactions will still be in TEST MODE.

For test purposes you can use 4683075410516684 VISA credit card with any cvv (3 numbers) and any future expiry date.

You will need to create authorize.net developer account in order to run the script in test mode

Technical Support

We provide courtesy support for all our products to our valued customers within 48-72 hours after receiving the request through our support ticketing system. Each purchase comes with 6 months support time. After that – you may either purchase extended support through the marketplace or purchase premium support with us.

If you need any help regarding the installation of the script or any other question please read through respective product documentation first and if solution is not found – open support ticket (please note, you will need to register account and you will be required to provide your license key (item purchase code) during the registration process, which will then be validated through CodeCanyon API. If your support period has expired you may either extend it with Envato or purchasepremium support from us).

Please note that we do not provide support by email. Any email related to support and not to pre-sales questions will be replied to after any other support tickets are resolved and in general will be directed to open a ticket, since we need to validate your purchase/support period validity.

For more details about our support policy and terms of service (including what is and is not included in Basic Support) click here.

Our business hours are Monday – Friday: 9:00am – 6:00pm (EST), and support is provided only at that time. Upon opening a ticket, we make it our goal to respond within 48-72 hours, however depending on the issue you’re having it may take a bit longer, but in any case we will address the issue within specified period of time with at least “resolution time” in reply.

Changelog

v2.5.0 – 11 November 2024

  • This is a major update with numerous enhancements and new features.
  • – New Design: Completely redesigned interface for a modern look and improved user experience.
  • – Themes: Added themes functionality with three color schemes to choose from (grey-blue, grey-green, black-white).
  • – Mobile Support: Improved mobile responsiveness for optimal display on all devices.
  • – eCheck Payment Option: Added eCheck support for US-based Authorize.net accounts.
  • – reCaptcha Version Switch: Option to toggle between reCaptcha v2 and v3 for enhanced security options.
  • – PHP Syntax Fixes: Corrected minor PHP syntax errors.
  • – SSL Certificate Update: Updated SSL certificate handling per the latest Authorize.net requirements.
  • – Coupons Functionality: Added support for percentage and fixed-amount coupons, configurable by individual service or globally, with an option to limit the maximum number of uses.
  • – Customer Number Field: Added optional field for collecting customer-specific data, such as invoice or customer ID.
  • – PHP 8.2 Compatibility: Enhanced compatibility with PHP 8.2.
  • – Integrated cleave.js: For proper input formatting across fields like date, phone number, and credit card.
  • – Improved Country/State Selection: Dynamic state/province options now update based on the selected country.

v2.4.1 – 12 April 2021

  • – Improvement: disabled autocomplete on the payment form;
    – Bug: fixed recurring transaction error message processing;

v2.4.0 – 11 May 2020

  • – Improvement: replaced deprecated AIM method with new Authorize.net API
    – Improvement: added option to redirect customer after payment (config file)

v2.2 – 13 November 2015
– added google recaptcha

v2.1 – 04 August 2014
– fixed issue with paypal URL listener
– added customer fields to ARB processing
– fixed issue with mktime() error
– added default timezone (US/Eastern) in config.php
– removed all eregi statements
– fixed issue with amounts containing “,”
– adjusted paypal ssl call

v2.0 – 14 November 2012
– added credit card type guesser
– added paypal payments standard as payment option
– added recurring billing (Authorize.net ARB and PayPal Website Payments Standard “Recurring”)
– added option to set trial periods (both authorize.net and paypal payments)
– added subscription cancellation functionality for authorize.net
– added subscription cancellation and payment refunds email notifications for paypal website payments standard
– fixed some other minor bugs & issues
– overall code improvements

v1.0 – 24 April 2011
initial release

Sources and Credits

We’ve used the following images, icons or other files as listed.

 

  • jQuery UI Library – http://www.jqueryui.com
  • jQuery Library – http://www.jquery.com
  • jQuery Colorbox – http://www.jacklmoore.com/colorbox
  • jQuery Tools – http://jquerytools.org/

 

Once again, thank you so much for purchasing our product. 

Is this document useful? 0 0

Published: March 5, 2016 Updated: November 8, 2024

« back to all manuals