Properties

$transaction

$transaction : array

Transaction data

Type

array

$fields

$fields : array

Transaction fields for normalization purposes

Type

array

$requiredFields

$requiredFields : array

Required fields

Type

array

$test

$test : boolean

Boolean flag to use test environment or not

Type

boolean

$approved

$approved : boolean

Boolean flag for approved transaction

Type

boolean

$declined

$declined : boolean

Boolean flag for declined transaction

Type

boolean

$error

$error : boolean

Boolean flag for error transaction

Type

boolean

$response

$response : string

Response string

Type

string

$responseCodes

$responseCodes : array

Response codes

Type

array

$responseCode

$responseCode : string

Response code

Type

string

$message

$message : string

Response message

Type

string

$custId

$custId : string

Customer ID

Type

string

$password

$password : string

Password

Type

string

$url

$url : string

URL

Type

string

Methods

send()

send(boolean  $verifyPeer = true) : void

Send transaction

Parameters

boolean $verifyPeer

Throws

\Pop\Payment\Adapter\Exception

getResponse()

getResponse() : string

Get raw response

Returns

string

getResponseCodes()

getResponseCodes() : array

Get response codes

Returns

array

getCode()

getCode(string  $key) : string

Get specific response code from a field in the array

Parameters

string $key

Returns

string

getResponseCode()

getResponseCode() : string

Get response code

Returns

string

getMessage()

getMessage() : integer

Get response message

Returns

integer

isTest()

isTest() : boolean

Return whether currently set to test environment

Returns

boolean

isApproved()

isApproved() : boolean

Return whether the transaction is approved

Returns

boolean

isDeclined()

isDeclined() : boolean

Return whether the transaction is declined

Returns

boolean

isError()

isError() : boolean

Return whether the transaction is an error

Returns

boolean

isValid()

isValid() : boolean

Return whether the required transaction data is valid

Returns

boolean

set()

set(array|string  $data, string  $value = null) : mixed

Set transaction data

Parameters

array|string $data
string $value

Returns

mixed

__construct()

__construct(string  $custId, string  $password, boolean  $test = false) : \Pop\Payment\Adapter\TrustCommerce

Constructor

Instantiate an TrustCommerce payment adapter object

Parameters

string $custId
string $password
boolean $test

Returns

\Pop\Payment\Adapter\TrustCommerce

validate()

validate() : boolean

Validate that the required transaction data is set

Returns

boolean

filterCardNum()

filterCardNum(string  $ccNum) : string

Filter the card num to remove dashes or spaces

Parameters

string $ccNum

Returns

string

filterExpDate()

filterExpDate(string  $date, integer  $length = 4) : string

Filter the exp date

Parameters

string $date
integer $length

Returns

string

parseResponse()

parseResponse(resource  $curl) : string

Parse the curl response

Parameters

resource $curl

Returns

string

buildPostString()

buildPostString() : string

Build the POST string

Returns

string

parseResponseCodes()

parseResponseCodes() : array

Parse the response codes

Returns

array