ProcessLink

Extends \iATS\Core

Class ProcessLink

package

iATS

Methods

IATS class constructor.

__construct(string $agentcode, string $password, string $serverid = 'NA') 
inherited
see \iATS\Core::setServer()

For options

Arguments

$agentcode

string

iATS account agent code.

$password

string

iATS account password.

$serverid

string

Server identifier. (Defaults to 'NA')

Make web service requests to the iATS API.

apiCall(string $method, array $parameters) : object
inherited
throws

Arguments

$method

string

The name of the method to call.

$parameters

array

Parameters to pass the API.

Response

object

XML object or boolean.

Check Method of Payment (MOP) is available based on server and currency.

checkMOPCurrencyRestrictions(string $serverid, string $currency, string $mop) : boolean
inherited

Arguments

$serverid

string

Server identifier

$currency

string

Currency

$mop

string

Method of Payment

Response

boolean

Result of check

Check restrictions for service.

checkRestrictions(array $parameters, boolean $forceCurrencyCheck = FALSE) : boolean|string
inherited

Arguments

$parameters

array

Request parameters.

$forceCurrencyCheck

boolean

True to force a currency check even when currency or method of payment are missing.

Response

boolean|string

FALSE if no restrictions. Message if restricted.

Check server restrictions.

checkServerRestrictions(string $serverid, array $restrictedservers) : boolean
inherited

Arguments

$serverid

string

Server identifier

$restrictedservers

array

Restricted servers array

Response

boolean

Result of server restricted check

Process an ACH / EFT transaction and return Customer Code.

createCustomerCodeAndProcessACHEFT(array $parameters) : mixed

North America clients only.

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client IP address. 'firstName' => 'Test' // The customer's first name. 'lastName' => 'Account' // The customer's last name. 'address' => '1234 Any Street' // The customer's address. 'city' => 'Schenectady' // The customer's city. 'state' => 'NY' // The customer's state or province. 'zipCode' => '12345' // The customer's ZIP code. 'accountNum' => '02100002100000000000000001' // The customer's bank account number. 'accountType' => 'CHECKING' // The customer's bank account type. // Options: CHECKING, SAVING (North America only.) 'invoiceNum' => '00000001' // Optional. The invoice number for this transaction. 'total' => '5' // The total payment amount. 'comment' => 'Process ACH / EFT test.' // Optional. A comment describing this transaction. 'title' => 'string' 'phone' => '1234567890' 'phone2' => '1234567890' 'fax' => '1234567890' 'email' => 'email@example.com' 'country' => 'string' 'item1' => 'string' 'item2' => 'string' 'item3' => 'string' 'item4' => 'string' 'item5' => 'string' 'item6' => 'string'

Response

mixed

Client response array or API error.

Process a credit card transaction and return Customer Code.

createCustomerCodeAndProcessCreditCard(array $parameters) : mixed

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client IP address. 'invoiceNum' => '00000001' // Optional. The invoice number for this transaction. 'ccNum' => '4222222222222220' // The customer's credit card number. 'ccExp' => '12/17' // The customer's credit card expiration date. 'firstName' => 'Test' // The customer's first name. 'lastName' => 'Account' // The customer's last name. 'address' => '1234 Any Street' // The customer's address. 'city' => 'Schenectady' // The customer's city. 'state' => 'NY' // The customer's state or province. 'zipCode' => '12345' // The customer's ZIP code. 'cvv2' => '000' // Optional. The customer's credit card CVV2 code. 'total' => '5' // The total payment amount. 'comment' => 'string' 'title' => 'string' 'phone' => '1234567890' 'phone2' => '1234567890' 'fax' => '1234567890' 'email' => 'email@example.com' 'country' => 'string' 'item1' => 'string' 'item2' => 'string' 'item3' => 'string' 'item4' => 'string' 'item5' => 'string' 'item6' => 'string'

Response

mixed

Client response array or API error.

Get the results of a preview batch request.

getBatchProcessResultFile(array $parameters) : mixed

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client IP address. 'batchId' => '1' // The ID of the existing iATS batch process.

Response

mixed

Client response array or API error.

Converts a UNIX timestamp to a date string formatted for SOAP requests.

getFormattedDate(integer $timestamp) : string
inherited

Arguments

$timestamp

integer

The timestamp to convert.

Response

string

The formatted date string.

MOP Currency matrix.

getMOPCurrencyMatrix() : array
inherited

Response

array

Array of Server/Currency/MOP

Create SoapClient object.

getSoapClient(string $endpoint, array $options = array()) : \SoapClient
inherited

Arguments

$endpoint

string

Service endpoint

$options

array

SoapClient options @see http://www.php.net/manual/en/soapclient.soapclient.php

Response

\SoapClient

Returns IATS SoapClient object

Process an ACH / EFT transaction using an existing account, without using a Customer Code.

processACHEFT(array $parameters) : mixed

North America clients only.

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client IP address. 'invoiceNum' => '00000001' // Optional. The invoice number for this transaction. 'accountNum' => '02100002100000000000000001' // The customer's bank account number. 'accountType' => 'CHECKING' // The customer's bank account type. // Options: CHECKING, SAVING (North America only.) 'firstName' => 'Test' // Optional. The customer's first name. 'lastName' => 'Account' // Optional. The customer's last name. 'address' => '1234 Any Street' // Optional. The customer's address. 'city' => 'Schenectady' // Optional. The customer's city. 'state' => 'NY' // Optional. The customer's state or province. 'zipCode' => '12345' // Optional. The customer's ZIP code. 'total' => '5' // The total payment amount. 'comment' => 'Process ACH / EFT test.' // Optional. A comment describing this transaction. 'title' => 'string' 'phone' => '1234567890' 'phone2' => '1234567890' 'fax' => '1234567890' 'email' => 'email@example.com' 'country' => 'string' 'item1' => 'string' 'item2' => 'string' 'item3' => 'string' 'item4' => 'string' 'item5' => 'string' 'item6' => 'string'

Response

mixed

Client response array or API error.

Process a number of ACH / EFT transactions from a batch file.

processACHEFTChargeBatch(array $parameters) : mixed

North America clients only.

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client IP address. 'batchFile' => {base64Binary file} // CSV file encoded using base64_encode. // File format without Customer Codes: // Invoice #, First Name, Last Name, Account Type, Account # (no spaces or dashes), Amount (no $), Comment // File format with Customer Codes: // Invoice #, Customer Code, Amount, Comment

Response

mixed

Client response array or API error.

Process a number of ACH / EFT refund transactions from a batch file.

processACHEFTRefundBatch(array $parameters) : mixed

North America clients only.

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client IP address. 'batchFile' => {base64Binary file} // CSV file encoded using base64_encode. // File format without Customer Codes: // Invoice #, First Name, Last Name, Account Type, Account # (no spaces or dashes), Amount (no $), Comment // File format with Customer Codes: // Invoice #, Customer Code, Amount, Comment

Response

mixed

Client response array or API error.

Refund a specific ACH / EFT transaction.

processACHEFTRefundWithTransactionId(array $parameters) : mixed

Partial refunds are valid. North America clients only.

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client IP address. 'transactionId' => '0000001' // The ID of the transaction to refund. 'total' => '-10' // The amount to refund. Must be a negative number. 'comment' => 'ACH / EFT refund test.' // Optional. A comment describing this transaction.

Response

mixed

Client response array or API error.

Process an ACH / EFT transaction using an existing account using a Customer Code.

processACHEFTWithCustomerCode(array $parameters) : mixed

North America clients only.

endcode

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client's IP address. 'customerCode' => '' // The iATS Customer Code. 'invoiceNum' => '00000001' // Optional. The invoice number for this transaction. 'total' => '5' // The total payment amount. 'comment' => 'Process ACH / EFT test.' // Optional. A comment describing this transaction. 'item1' => 'string' 'item2' => 'string' 'item3' => 'string' 'item4' => 'string' 'item5' => 'string' 'item6' => 'string'

Response

mixed

Client response array or API error.

Process a credit card transaction.

processCreditCard(array $parameters) : mixed

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client's IP address. 'invoiceNum' => '00000001' // Optional. The invoice number for this transaction. 'creditCardNum' => '4222222222222220' // The customer's credit card number. 'creditCardExpiry' => '12/17' // The customer's credit card expiration date. MM/YY. 'cvv2' => '000' // The customer's credit card CVV2 code. 'mop' => 'VISA' // The customer's method of payment. // North America options: VISA, MC, AMX, DSC // UK options: VISA, MC, AMX, MAESTR 'firstName' => 'Test' // The customer's first name. 'lastName' => 'Account' // The customer's last name. 'address' => '1234 Any Street' // The customer's address. 'city' => 'Schenectady' // The customer's city. 'state' => 'NY' // The customer's state or province. 'zipCode' => '12345' // The customer's ZIP code. 'total' => '5' // The total payment amount. 'comment' => 'Process credit card test.' // Optional. A comment describing this transaction. 'title' => 'string' 'phone' => '1234567890' 'phone2' => '1234567890' 'fax' => '1234567890' 'email' => 'email@example.com' 'country' => 'string' 'item1' => 'string' 'item2' => 'string' 'item3' => 'string' 'item4' => 'string' 'item5' => 'string' 'item6' => 'string'

Response

mixed

Client response array or API error.

Process multiple credit card transactions from a batch file.

processCreditCardBatch(array $parameters) : mixed

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client's IP address. 'batchFile' => {base64Binary file} // CSV file encoded using base64_encode. // File format without Customer Codes for US and UK clients: // Date, Invoice #, First Name, Last Name, Street, City, State, Zip Code, Amount, MOP, Credit Card #, Expiry // File format without Customer Codes for Canadian clients: // Date, Invoice #, Full Name, Amount, MOP, Credit Card #, Expiry // File format with Customer Codes: // Invoice #, Customer Code, Amount, Comment

Response

mixed

Client response array or API error.

Refund a specific credit card transaction.

processCreditCardRefundWithTransactionId(array $parameters) : mixed

Partial refunds are valid.

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client's IP address. 'transactionId' => '0000001' // The ID of the transaction to refund. 'total' => '-10' // The total amount to refund. Must be a negative number. 'comment' => 'Credit card refund test.' // Optional. A comment describing this transaction.

Response

mixed

Client response array or API error.

Process a credit card transaction with Customer Code.

processCreditCardWithCustomerCode(array $parameters) : mixed

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client's IP address. 'customerCode' => '' // The iATS Customer Code. 'invoiceNum' => '00000001' // Optional. The invoice number for this transaction. 'cvv2' => '000' // Optional. The customer's credit card CVV2 code. 'total' => '5' // The total payment amount. 'comment' => 'Process credit card test with Customer Code.' // Optional. A comment describing this transaction. 'item1' => 'string' 'item2' => 'string' 'item3' => 'string' 'item4' => 'string' 'item5' => 'string' 'item6' => 'string'

Response

mixed

Client response array or API error.

Return a rejection message for a given code.

rejectMessage(integer $reject_code) : array
inherited

Arguments

$reject_code

integer

iATS rejection code.

Response

array

Rejection code and message as in array in the format: [ 'code' => 19, 'message' => 'Incorrect CVV2 security code', ]

Response Handler for ProcessLink calls.

responseHandler(object $response, string $result_name) : mixed

Arguments

$response

object

SOAP response.

$result_name

string

API result name.

Response

mixed

Restriction, error or API result.

Set the server to use based on a server id.

setServer(string $serverid) 
inherited
throws

Arguments

$serverid

string

Server identifier ('UK' or 'NA'.)

Convert an XML string to an array.

xml2array(string $xmlstring) : array
inherited

Arguments

$xmlstring

string

An XML string to be processed.

Response

array

Array.

Properties

North America server url.

na_server : string
inherited
var

North America server url.

Type(s)

string

UK server url.

uk_server : string
inherited
var

UK server url.

Type(s)

string

iATS account agent code.

agentcode : string
inherited
var

iATS account agent code.

Type(s)

string

iATS account password.

password : string
inherited
var

iATS account password.

Type(s)

string

Server identifier. @see Core::setServer()

serverid : string
inherited
var

Server identifier.

@see Core::setServer()

Type(s)

string

Server url.

server : string
inherited
var

Server url.

Type(s)

string

Service endpoint

endpoint : string
inherited
var

Service endpoint

Type(s)

string

Requrest parameters

params : string
inherited
var

Requrest parameters

Type(s)

string

The result name

resultname : string
inherited
var

The result name

Type(s)

string

Format

format : string
inherited
var

Format

Type(s)

string

Restricted servers array

restrictedservers : array
inherited
var

Restricted servers array

Type(s)

array