AuthorizeNetAIM

Extends \AuthorizeNetRequest

Builds and sends an AuthorizeNet AIM Request.

package

AuthorizeNet

subpackage

AuthorizeNetAIM

Methods

Do an AUTH_CAPTURE transaction.

authorizeAndCapture(string $amount = false, string $card_num = false, string $exp_date = false) : \AuthorizeNetAIM_Response

Required "x_" fields: card_num, exp_date, amount

Arguments

$amount

string

The dollar amount to charge

$card_num

string

The credit card number

$exp_date

string

CC expiration date

Response

\AuthorizeNetAIM_Response

Do a PRIOR_AUTH_CAPTURE transaction.

priorAuthCapture(string $trans_id = false, string $amount = false) : \AuthorizeNetAIM_Response

Required "x_" field: trans_id(The transaction id of the prior auth, unless split tender, then set x_split_tender_id manually.) amount (only if lesser than original auth)

Arguments

$trans_id

string

Transaction id to charge

$amount

string

Dollar amount to charge if lesser than auth

Response

\AuthorizeNetAIM_Response

Do an AUTH_ONLY transaction.

authorizeOnly(string $amount = false, string $card_num = false, string $exp_date = false) : \AuthorizeNetAIM_Response

Required "x_" fields: card_num, exp_date, amount

Arguments

$amount

string

The dollar amount to charge

$card_num

string

The credit card number

$exp_date

string

CC expiration date

Response

\AuthorizeNetAIM_Response

Do a VOID transaction.

void(string $trans_id = false) : \AuthorizeNetAIM_Response

Required "x_" field: trans_id(The transaction id of the prior auth, unless split tender, then set x_split_tender_id manually.)

Arguments

$trans_id

string

Transaction id to void

Response

\AuthorizeNetAIM_Response

Do a CAPTURE_ONLY transaction.

captureOnly(string $auth_code = false, string $amount = false, string $card_num = false, string $exp_date = false) : \AuthorizeNetAIM_Response

Required "x_" fields: auth_code, amount, card_num , exp_date

Arguments

$auth_code

string

The auth code

$amount

string

The dollar amount to charge

$card_num

string

The last 4 of credit card number

$exp_date

string

CC expiration date

Response

\AuthorizeNetAIM_Response

Do a CREDIT transaction.

credit(string $trans_id = false, string $amount = false, string $card_num = false) : \AuthorizeNetAIM_Response

Required "x_" fields: trans_id, amount, card_num (just the last 4)

Arguments

$trans_id

string

Transaction id to credit

$amount

string

The dollar amount to credit

$card_num

string

The last 4 of credit card number

Response

\AuthorizeNetAIM_Response

Alternative syntax for setting x_ fields.

__set(string $name, string $value) 

Usage: $sale->method = "echeck";

Arguments

$name

string

$value

string

Quickly set multiple fields.

setFields(array $fields) 

Note: The prefix x_ will be added to all fields. If you want to set a custom field without the x_ prefix, use setCustomField or setCustomFields.

Arguments

$fields

array

Takes an array or object.

Quickly set multiple custom fields.

setCustomFields(array $fields) 

Arguments

$fields

array

Add a line item.

addLineItem(string $item_id, string $item_name, string $item_description, string $item_quantity, string $item_unit_price, string $item_taxable) 

Arguments

$item_id

string

$item_name

string

$item_description

string

$item_quantity

string

$item_unit_price

string

$item_taxable

string

Use ECHECK as payment type.

setECheck($bank_aba_code, $bank_acct_num, $bank_acct_type, $bank_name, $bank_acct_name, $echeck_type = 'WEB') 

Arguments

$bank_aba_code

$bank_acct_num

$bank_acct_type

$bank_name

$bank_acct_name

$echeck_type

Set an individual name/value pair. This will append x_ to the name before posting.

setField(string $name, string $value) 

Arguments

$name

string

$value

string

Set a custom field. Note: the x_ prefix will not be added to your custom field if you use this method.

setCustomField(string $name, string $value) 

Arguments

$name

string

$value

string

Unset an x_ field.

unsetField(string $name) 

Arguments

$name

string

Field to unset.

_handleResponse

_handleResponse(string $response) : \AuthorizeNetAIM_Response

Arguments

$response

string

Response

\AuthorizeNetAIM_Response

_getPostUrl

_getPostUrl() : string

Response

string

Converts the x_post_fields array into a string suitable for posting.

_setPostString() 

Constructor.

__construct(string $api_login_id = false, string $transaction_key = false) 
inherited

Arguments

$api_login_id

string

The Merchant's API Login ID.

$transaction_key

string

The Merchant's Transaction Key.

Alter the gateway url.

setSandbox(bool $bool) 
inherited

Arguments

$bool

bool

Use the Sandbox.

Set a log file.

setLogFile(string $filepath) 
inherited

Arguments

$filepath

string

Path to log file.

Return the post string.

getPostString() : string
inherited

Response

string

Posts the request to AuthorizeNet & returns response.

_sendRequest() : \AuthorizeNetARB_Response
inherited

Response

\AuthorizeNetARB_Response

The response.

Constants

LIVE_URL

LIVE_URL

SANDBOX_URL

SANDBOX_URL

Properties

Holds all the x_* name/values that will be posted in the request.

_x_post_fields

Default values are provided for best practice fields.

Only used if merchant wants to send multiple line items about the charge.

_additional_line_items

Only used if merchant wants to send custom fields.

_custom_fields

Checks to make sure a field is actually in the API before setting.

verify_x_fields

Set to false to skip this check.

A list of all fields in the AIM API.

_all_aim_fields

Used to warn user if they try to set a field not offered in the API.

_transaction_key

_transaction_key
inherited

_post_string

_post_string
inherited

VERIFY_PEER

VERIFY_PEER
inherited

_sandbox

_sandbox
inherited

_log_file

_log_file
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited


                                
inherited