PHP Class Pop\Payment\Adapter\AbstractAdapter

Author: Nick Sagona, III ([email protected])
Inheritance: implements Pop\Payment\Adapter\AdapterInterface
Show file Open project: nicksagona/PopPHP

Protected Properties

Property Type Description
$approved boolean Boolean flag for approved transaction
$declined boolean Boolean flag for declined transaction
$error boolean Boolean flag for error transaction
$fields array Transaction fields for normalization purposes
$message string Response message
$requiredFields array Required fields
$response string Response string
$responseCode string Response code
$responseCodes array Response codes
$test boolean Boolean flag to use test environment or not
$transaction array Transaction data

Public Methods

Method Description
getCode ( string $key ) : string Get specific response code from a field in the array
getMessage ( ) : integer Get response message
getResponse ( ) : string Get raw response
getResponseCode ( ) : string Get response code
getResponseCodes ( ) : array Get response codes
isApproved ( ) : boolean Return whether the transaction is approved
isDeclined ( ) : boolean Return whether the transaction is declined
isError ( ) : boolean Return whether the transaction is an error
isTest ( ) : boolean Return whether currently set to test environment
isValid ( ) : boolean Return whether the required transaction data is valid
send ( boolean $verifyPeer = true ) : mixed Send transaction
set ( array | string $data, string $value = null ) : mixed Set transaction data

Protected Methods

Method Description
filterCardNum ( string $ccNum ) : string Filter the card num to remove dashes or spaces
filterExpDate ( string $date, integer $length = 4 ) : string Filter the exp date
validate ( ) : boolean Validate that the required transaction data is set

Method Details

filterCardNum() protected method

Filter the card num to remove dashes or spaces
protected filterCardNum ( string $ccNum ) : string
$ccNum string
return string

filterExpDate() protected method

Filter the exp date
protected filterExpDate ( string $date, integer $length = 4 ) : string
$date string
$length integer
return string

getCode() public method

Get specific response code from a field in the array
public getCode ( string $key ) : string
$key string
return string

getMessage() public method

Get response message
public getMessage ( ) : integer
return integer

getResponse() public method

Get raw response
public getResponse ( ) : string
return string

getResponseCode() public method

Get response code
public getResponseCode ( ) : string
return string

getResponseCodes() public method

Get response codes
public getResponseCodes ( ) : array
return array

isApproved() public method

Return whether the transaction is approved
public isApproved ( ) : boolean
return boolean

isDeclined() public method

Return whether the transaction is declined
public isDeclined ( ) : boolean
return boolean

isError() public method

Return whether the transaction is an error
public isError ( ) : boolean
return boolean

isTest() public method

Return whether currently set to test environment
public isTest ( ) : boolean
return boolean

isValid() public method

Return whether the required transaction data is valid
public isValid ( ) : boolean
return boolean

send() abstract public method

Send transaction
abstract public send ( boolean $verifyPeer = true ) : mixed
$verifyPeer boolean
return mixed

set() public method

Set transaction data
public set ( array | string $data, string $value = null ) : mixed
$data array | string
$value string
return mixed

validate() protected method

Validate that the required transaction data is set
protected validate ( ) : boolean
return boolean

Property Details

$approved protected property

Boolean flag for approved transaction
protected bool $approved
return boolean

$declined protected property

Boolean flag for declined transaction
protected bool $declined
return boolean

$error protected property

Boolean flag for error transaction
protected bool $error
return boolean

$fields protected property

Transaction fields for normalization purposes
protected array $fields
return array

$message protected property

Response message
protected string $message
return string

$requiredFields protected property

Required fields
protected array $requiredFields
return array

$response protected property

Response string
protected string $response
return string

$responseCode protected property

Response code
protected string $responseCode
return string

$responseCodes protected property

Response codes
protected array $responseCodes
return array

$test protected property

Boolean flag to use test environment or not
protected bool $test
return boolean

$transaction protected property

Transaction data
protected array $transaction
return array