PHP Classes

File: sdk/doc/CP.markdown

Recommend this page to a friend!
  Classes of Samuel Adeshina   PHP Authorize.net SIM   sdk/doc/CP.markdown   Download  
File: sdk/doc/CP.markdown
Role: Auxiliary data
Content type: text/markdown
Description: First Commit
Class: PHP Authorize.net SIM
Generate payment forms for Authorize.net SIM API
Author: By
Last change:
Date: 9 years ago
Size: 1,205 bytes
 

Contents

Class file image Download

Card Present API

Basic Overview

The AuthorizeNetCP class creates a request object for submitting transactions to the AuthorizeNetCP API. The AuthorizeNetCP class extends the AuthorizeNetAIM class. See the AIM.markdown for help with the basics. This document contains information regarding the special features of the AuthorizeNetCP class.

Merchant Credentials

Please note that if you are using both the CNP and CP APIs your merchant credentials will be different.

Setting Track Data

To set Track 1 and/or Track 2 data, use the respective methods like so:

$sale = new AuthorizeNetCP(CP_API_LOGIN_ID, CP_TRANSACTION_KEY);
$sale->setFields(
    array(
    'amount' => rand(1, 1000),
    'device_type' => '4',
    )
);
$sale->setTrack1Data('%B4111111111111111^CARDUSER/JOHN^1803101000000000020000831000000?');
$response = $sale->authorizeAndCapture();

$sale = new AuthorizeNetCP(CP_API_LOGIN_ID, CP_TRANSACTION_KEY);
$sale->setFields(
    array(
    'amount' => rand(1, 1000),
    'device_type' => '4',
    )
);
$sale->setTrack2Data('4111111111111111=1803101000020000831?');
$response = $sale->authorizeAndCapture();