Properties

Methods

toJson()

toJson(integer  $options) : string

Returns a json representation of itself.

Parameters

integer $options

Returns

string

toArray()

toArray(boolean  $doSort = false) : array

Returns an array that represents the object instance.

Uses uppercase keys to be compatible with the heidelpay POST Payment API.

Parameters

boolean $doSort

sort the keys in alphabetical order

Returns

array

jsonSerialize()

jsonSerialize() 

fromJson()

fromJson(string  $json) : \Heidelpay\PhpPaymentApi\AbstractMethod

Takes a JSON representation of an instance and returns a PHP object instance representation of it.

Parameters

string $json

Returns

\Heidelpay\PhpPaymentApi\AbstractMethod

fromPost()

fromPost(array  $post) : \Heidelpay\PhpPaymentApi\AbstractMethod

Takes an array, e.g. a POST response and returns a PHP object instance representation of it.

Parameters

array $post

Returns

\Heidelpay\PhpPaymentApi\AbstractMethod

__construct()

__construct(array  $rawResponse = null) 

The constructor will take a given response in post format and convert it to a response object

Parameters

array $rawResponse

splitArray()

splitArray(array  $rawResponse) : \Heidelpay\PhpPaymentApi\Response

Splits post array parameters and converts it to a response object

Parameters

array $rawResponse

Returns

\Heidelpay\PhpPaymentApi\Response

isSuccess()

isSuccess() : boolean

Response was successfull

Returns

boolean

isPending()

isPending() : boolean

Response is pending

Returns

boolean

isError()

isError() : boolean

Response has an error

Returns

boolean

getError()

getError() : array

Get the error code and message

Returns

array —

error code and message

getPaymentReferenceId()

getPaymentReferenceId() : string

Get payment reference id or uniqe id

Returns

string —

payment uniqe id

getPaymentFormUrl()

getPaymentFormUrl() : string

Payment from url

Used to create the payment form. In case of credit/debit card it will be the iframe url.

Throws

\Heidelpay\PhpPaymentApi\Exceptions\PaymentFormUrlException

Returns

string —

PaymentFormUrl

verifySecurityHash()

verifySecurityHash(string  $secret = null, string  $identificationTransactionId = null) : boolean

Verify that the response secret hash matches the one given by initial request

A mismatch can be a indication, that someone tries to send fake payment response to your system. Please verify the source of the response. If it is a legal one, it can be some kind of misconfiguration.

Parameters

string $secret

your application's secret hash

string $identificationTransactionId

basket or order reference id

Throws

\Heidelpay\PhpPaymentApi\Exceptions\HashVerificationException

Returns

boolean

mapFromJson()

mapFromJson(string  $json) 

Maps a JSON string into single ParameterGroup instances.

Parameters

string $json

Throws

\Heidelpay\PhpPaymentApi\Exceptions\JsonParserException

mapFromPost()

mapFromPost(array  $post) 

Maps a POST array into single ParameterGroup instances.

Parameters

array $post