This application provides examples of how to use the Authorize.Net Accept products to integrate secure payment acceptance into your applications.
PHP JavaScript HTML CSS
Switch branches/tags
Nothing to show
Clone or download
Latest commit 5a2e48c Jul 11, 2018
Permalink
Failed to load latest commit information.
.well-known Create apple-developer-merchantid-domain-association.html Oct 5, 2016
certs added temp test cert Sep 28, 2016
images merged applepay sample into master Oct 6, 2016
screenshots Add files via upload May 2, 2017
scripts change to better version of image Dec 16, 2016
IFrameCommunicator.html comments and change link to IFrameCommunicator.html Aug 19, 2017
JWT.php added basic Cardinal Cruise implmentation Apr 17, 2017
LICENSE Update LICENSE Sep 27, 2016
README-AcceptCustomer.md Create README-AcceptCustomer.md Feb 10, 2017
README-AcceptHosted.md comments and change link to IFrameCommunicator.html Aug 19, 2017
README-AcceptJS.md Create README-AcceptJS.md Feb 10, 2017
README-ApplePay.md Update README-ApplePay.md Jun 26, 2018
README-CardinalCruise.md Update README-CardinalCruise.md May 2, 2017
README.md Update README.md Feb 22, 2017
acceptJSCaller.js Update acceptJSCaller.js Oct 13, 2017
applePayCaller.js Update applePayCaller.js Feb 15, 2017
chargeProfile.js integrated cruise and accept May 2, 2017
config.txt fix spelling Dec 16, 2016
conversion.js Create conversion.js Jul 11, 2018
createTransactionWithProfile.php Update createTransactionWithProfile.php Mar 2, 2017
generateCardinalJWT.php added basic Cardinal Cruise implmentation Apr 17, 2017
getHostedPaymentForm.php Update getHostedPaymentForm.php Nov 7, 2017
getProfiles.php Update getProfiles.php Mar 2, 2017
getToken.php code formatting and rename iCommunicator.html Aug 19, 2017
index.php Update index.php Oct 26, 2017
login.php move session_start to beginning of the file Dec 27, 2016
payerAuthCaller.js Create payerAuthCaller.js Jun 9, 2017
return.html Updated server variables May 17, 2016
transactionCaller.php merge with current upstream/master Aug 19, 2017
validateApplePayMerchant.php Update validateApplePayMerchant.php Mar 2, 2017
validateJwt.php added basic Cardinal Cruise implmentation Apr 17, 2017
visaCheckoutTransaction.js Updated to demonstrate Visa Checkout Mar 6, 2017

README.md

Accept Sample Application

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.

Accept Screenshots

How to Use the Sample App

  • 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.

Included Examples

Accept Customer

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:

  • Incorporate the Manage Customer hosted page into your application ("Profile" tab).
  • Embed the hosted "Add/Edit Payment" page into your application as an iframe ("Payment Methods" tab).
  • Pop up the hosted "Add/Edit Shipping" page in a light-box mode ("Shipping" tab).

Accept.js

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:

  • Incorporate the Accept.js library into your existing payment flow ("Pay" tab --> "Pay (Accept.js)" button)

Accept Hosted

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:

  • Request an Accept Hosted form token using the Authorize.Net API (GetHostedPaymentForm).
  • Incorporate the Accept Hosted payment form into your existing payment flow ("Pay" tab).
  • Display a custom receipt using the transaction response.

Apple Pay On The Web

Authorize.Net supports Apple Pay on the Web in addition to our in-app Apple Pay Support. See our developer documentation for more details.

Apple Pay Screenshot

In this sample we demonstrate how to:

  • Integrate with the ApplePay.js library.
  • Validate your merchant identity from your server.
  • Complete the transaction by passing the Apple Pay payment data in the Authorize.Net 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.