CustomerLink

Extends \iATS\Core

Class CustomerLink

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

Create ACH/EFT Customer Code. North America clients only.

createACHEFTCustomerCode(array $parameters) : mixed

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client IP address. 'customerCode' => '' // Optional. The iATS Customer Code. 'firstName' => 'Test' // The customer's first name. 'lastName' => 'Account' // The customer's last name. 'companyName' => 'Test Co.' // Optional. The customer's company 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. 'phone' => '555-555-1234' // Optional. The customer's phone number. 'fax' => '555-555-4321' // Optional. The customer's FAX number. 'alternatePhone' => '555-555-5555' // Optional. The customer's alternate phone number. 'email' => 'email@test.co' // Optional. The customer's email address. 'comment' => 'Customer code creation test.' // Optional. A comment describing this transaction. 'recurring' => FALSE // Optional. TRUE if a recurring payment should be created. 'amount' => '5' // Optional. The payment amount. 'beginDate' => '2014-07-23T00:00:00+00:00' // Optional. The begin date of the recurring payment, if used. 'endDate' => '2024-07-23T23:59:59+00:00' // Optional. The end date of the recurring payment, if used. 'scheduleType' => 'Annually' // Optional. The recurring payment schedule. // Options: Weekly, Monthly Quarterly, Annually. 'scheduleDate' => '' // Optional. The recurring payment schedule date. // Options: Monthly: 1-28,29,30 or 31; Weekly: 1-7; Quarterly or Annually: empty string. 'accountCustomerName' => 'Test Account' // Optional. The customer's name as appears on the bank account. 'accountNum' => '999999999' // Optional. The customer's bank account number. 'accountType' => 'CHECKING' // Optional. The customer's bank account type. // Options: CHECKING, SAVING (North America only.) 'title' => 'string' 'country' => 'string' 'item1' => 'string' 'item2' => 'string' 'item3' => 'string' 'item4' => 'string' 'item5' => 'string' 'item6' => 'string'

Response

mixed

Client response array or API error.

Create Credit Card Customer Code.

createCreditCardCustomerCode(array $parameters) : mixed

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // The client IP address. 'customerCode' => '' // Optional. The iATS Customer Code. 'firstName' => 'Test' // The customer's first name. 'lastName' => 'Account' // The customer's last name. 'companyName' => 'Test Co.' // The customer's company 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. 'phone' => '555-555-1234' // The customer's phone number. 'fax' => '555-555-4321' // The customer's FAX number. 'alternatePhone' => '555-555-5555' // The customer's alternate phone number. 'email' => 'email@test.co' // The customer's email address. 'comment' => 'Customer code creation test.' // A comment describing this transaction. 'recurring' => FALSE // TRUE if a recurring payment should be created. 'amount' => '5' // The payment amount. 'beginDate' => '2014-07-23T00:00:00+00:00' // The begin date of the recurring payment, if used. 'endDate' => '2024-07-23T23:59:59+00:00' // The end date of the recurring payment, if used. 'scheduleType' => 'Annually' // The recurring payment schedule. // Options: Weekly, Monthly, Quarterly, Annually. 'scheduleDate' => '' // The recurring payment schedule date. // Options: Monthly: 1-28,29,30 or 31; Weekly: 1-7; Quarterly or Annually: empty string. 'creditCardCustomerName' => 'Test Account' // The customer's name as appears on the credit card. 'creditCardNum' => '4222222222222220' // The customer's credit card number. 'creditCardExpiry' => '12/17' // The customer's credit card expiration date. 'mop' => 'VISA' // Optional. The customer's method of payment. 'title' => 'string' 'country' => 'string' 'item1' => 'string' 'item2' => 'string' 'item3' => 'string' 'item4' => 'string' 'item5' => 'string' 'item6' => 'string'

Response

mixed

Client response array or API error.

Delete Customer Code.

deleteCustomerCode(array $parameters) : mixed

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client IP address. 'customerCode' => '' // The iATS Customer Code.

Response

mixed

Client response array or API error.

Get Customer Code Detail.

getCustomerCodeDetail(array $parameters) : mixed

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client IP address. 'customerCode' => 'A10396688' // The iATS Customer Code.

Response

mixed

Client response array or API error.

Get Customer List By Creation Time CSV.

getCustomerListByCreationTimeCSV(array $parameters) : mixed

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client IP address. 'customerCode' => 'A10396688' // The iATS Customer Code. 'fromDate => '2014-07-23T00:00:00+00:00' // Customer creation start date 'toDate' => '2024-07-23T23:59:59+00:00' // Customer creation to date

Response

mixed

Client response array or API error.

Get Customer List By Creation Time XML.

getCustomerListByCreationTimeXML(array $parameters) : mixed

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client IP address. 'customerCode' => 'A10396688' // The iATS Customer Code. 'fromDate => '2014-07-23T00:00:00+00:00' // Customer creation start date 'toDate' => '2024-07-23T23:59:59+00:00' // Customer creation to date

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

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 CustomerLink calls.

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

Arguments

$response

object

Restriction, error or API result.

$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'.)

Update ACH/EFT Customer Code. North America clients only.

updateACHEFTCustomerCode(array $parameters) : mixed

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client IP address. 'customerCode' => '' // The iATS Customer Code. 'firstName' => 'Test' // Optional. The customer's first name. 'lastName' => 'Account' // Optional. The customer's last name. 'companyName' => 'Test Co.' // Optional. The customer's company 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. 'phone' => '555-555-1234' // Optional. The customer's phone number. 'fax' => '555-555-4321' // Optional. The customer's FAX number. 'alternatePhone' => '555-555-5555' // Optional. The customer's alternate phone number. 'email' => 'email@test.co' // Optional. The customer's email address. 'comment' => 'Customer code creation test.' // Optional. A comment describing this transaction. 'recurring' => FALSE // Optional. TRUE if a recurring payment should be created. 'amount' => '5' // Optional. The payment amount. 'beginDate' => '2014-07-23T00:00:00+00:00' // Optional. The begin date of the recurring payment, if used. 'endDate' => '2024-07-23T23:59:59+00:00' // Optional. The end date of the recurring payment, if used. 'scheduleType' => 'Annually' // Optional. The recurring payment schedule. // Options: Weekly, Monthly Quarterly, Annually. 'scheduleDate' => '' // Optional. The recurring payment schedule date. // Options: Monthly: 1-28,29,30 or 31; Weekly: 1-7; Quarterly or Annually: empty string. 'accountCustomerName' => 'Test Account' // Optional. The customer's name as appears on the bank account. 'accountNum' => '999999999' // Optional. The customer's bank account number. 'accountType' => 'CHECKING' // Optional. The customer's bank account type. // Options: CHECKING, SAVING (North America only.) 'updateAccountNum' => FALSE // Optional. True if the customer's account number should be updated. 'title' => 'string' 'country' => 'string' 'item1' => 'string' 'item2' => 'string' 'item3' => 'string' 'item4' => 'string' 'item5' => 'string' 'item6' => 'string'

Response

mixed

Client response array or API error.

Update Credit Card Customer Code.

updateCreditCardCustomerCode(array $parameters) : mixed

Arguments

$parameters

array

An associative array with the following possible values. 'customerIPAddress' => '' // Optional. The client IP address. 'customerCode' => '' // The iATS Customer Code. 'firstName' => 'Test' // Optional. The customer's first name. 'lastName' => 'Account' // Optional. The customer's last name. 'companyName' => 'Test Co.' // Optional. The customer's company 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. 'phone' => '555-555-1234' // Optional. Optional. The customer's phone number. 'fax' => '555-555-4321' // Optional. The customer's FAX number. 'alternatePhone' => '555-555-5555' // Optional. The customer's alternate phone number. 'email' => 'email@test.co' // Optional. The customer's email address. 'comment' => 'Customer code creation test.' // Optional. A comment describing this transaction. 'recurring' => FALSE // Optional. TRUE if a recurring payment should be created. 'amount' => '5' // Optional. The payment amount. 'beginDate' => '2014-07-23T00:00:00+00:00' // Optional. The begin date of the recurring payment, if used. 'endDate' => '2024-07-23T23:59:59+00:00' // Optional. The end date of the recurring payment, if used. 'scheduleType' => 'Annually' // Optional. The recurring payment schedule. // Options: Weekly, Monthly, Quarterly, Annually. 'scheduleDate' => '' // Optional. The recurring payment schedule date. // Options: Monthly: 1-28,29,30 or 31; Weekly: 1-7; Quarterly or Annually: empty string. 'creditCardCustomerName' => 'Test Account' // Optional. The customer's name as appears on the credit card. 'creditCardNum' => '4222222222222220' // Optional. The customer's credit card number. 'creditCardExpiry' => '12/17' // Optional. The customer's credit card expiration date. 'mop' => 'VISA' // Optional. The customer's method of payment. 'updateCreditCardNum' => FALSE // Optional. TRUE when the customer's credit card number should be updated. 'title' => 'string' 'country' => 'string' 'item1' => 'string' 'item2' => 'string' 'item3' => 'string' 'item4' => 'string' 'item5' => 'string' 'item6' => 'string'

Response

mixed

Client response array or API error.

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