Core

Class Core

package

iATS

Methods

IATS class constructor.

__construct(string $agentcode, string $password, string $serverid = 'NA') 
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
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

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

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

Arguments

$serverid

string

Server identifier

$restrictedservers

array

Restricted servers array

Response

boolean

Result of server restricted check

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

getFormattedDate(integer $timestamp) : string

Arguments

$timestamp

integer

The timestamp to convert.

Response

string

The formatted date string.

MOP Currency matrix.

getMOPCurrencyMatrix() : array

Response

array

Array of Server/Currency/MOP

Create SoapClient object.

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

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

Return a rejection message for a given code.

rejectMessage(integer $reject_code) : array

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', ]

Set the server to use based on a server id.

setServer(string $serverid) 
throws

Arguments

$serverid

string

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

Convert an XML string to an array.

xml2array(string $xmlstring) : array

Arguments

$xmlstring

string

An XML string to be processed.

Response

array

Array.

Properties

North America server url.

na_server : string
var

North America server url.

Type(s)

string

UK server url.

uk_server : string
var

UK server url.

Type(s)

string

iATS account agent code.

agentcode : string
var

iATS account agent code.

Type(s)

string

iATS account password.

password : string
var

iATS account password.

Type(s)

string

Server identifier. @see Core::setServer()

serverid : string
var

Server identifier.

@see Core::setServer()

Type(s)

string

Server url.

server : string
var

Server url.

Type(s)

string

Service endpoint

endpoint : string
var

Service endpoint

Type(s)

string

Requrest parameters

params : string
var

Requrest parameters

Type(s)

string

The result name

resultname : string
var

The result name

Type(s)

string

Format

format : string
var

Format

Type(s)

string

Restricted servers array

restrictedservers : array
var

Restricted servers array

Type(s)

array