PHP Class Pop\Payment\Payment

Author: Nick Sagona, III ([email protected])
显示文件 Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Property Type Description
$adapter mixed Payment adapter
$fields array These are the common transaction fields that will be normalized to the proper field names by the adapter. You can also add direct adapter-specific fields to the payment transaction object that won't be affected by the field normalization, for example: (Authorize.net) $payment->x_invoice_num = '12345'; (UsaEPay) $payment->UMinvoice = '12345';

Public Methods

Method Description
__construct ( AbstractAdapter $adapter ) : Payment Constructor
__get ( string $name ) : mixed Get method to return the value of fields[$name].
__isset ( string $name ) : boolean Return the isset value of fields[$name].
__set ( string $name, mixed $value ) : void Set method to set the property to the value of fields[$name].
__unset ( string $name ) : void Unset fields[$name].
adapter ( ) : AbstractAdapter Access the adapter
getCode ( string $key ) : string Get specific response code from a field in the array
getMessage ( ) : string 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 the transaction is in test mode
isValid ( ) : boolean Validate transaction data
send ( boolean $verifyPeer = true ) : void Send transaction data
shippingSameAsBilling ( ) : Payment Set the shipping data fields to the same as billing data fields

Method Details

__construct() public method

Instantiate the payment object
public __construct ( AbstractAdapter $adapter ) : Payment
$adapter Pop\Payment\Adapter\AbstractAdapter
return Payment

__get() public method

Get method to return the value of fields[$name].
public __get ( string $name ) : mixed
$name string
return mixed

__isset() public method

Return the isset value of fields[$name].
public __isset ( string $name ) : boolean
$name string
return boolean

__set() public method

Set method to set the property to the value of fields[$name].
public __set ( string $name, mixed $value ) : void
$name string
$value mixed
return void

__unset() public method

Unset fields[$name].
public __unset ( string $name ) : void
$name string
return void

adapter() public method

Access the adapter
public adapter ( ) : AbstractAdapter
return Pop\Payment\Adapter\AbstractAdapter

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 ( ) : string
return string

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 the transaction is in test mode
public isTest ( ) : boolean
return boolean

isValid() public method

Validate transaction data
public isValid ( ) : boolean
return boolean

send() public method

Send transaction data
public send ( boolean $verifyPeer = true ) : void
$verifyPeer boolean
return void

shippingSameAsBilling() public method

Set the shipping data fields to the same as billing data fields
public shippingSameAsBilling ( ) : Payment
return Payment

Property Details

$adapter protected_oe property

Payment adapter
protected mixed $adapter
return mixed

$fields protected_oe property

These are the common transaction fields that will be normalized to the proper field names by the adapter. You can also add direct adapter-specific fields to the payment transaction object that won't be affected by the field normalization, for example: (Authorize.net) $payment->x_invoice_num = '12345'; (UsaEPay) $payment->UMinvoice = '12345';
protected array $fields
return array