Properties

$possibleRejectionErrorCodes

$possibleRejectionErrorCodes : array

Type

array — List of human readable meanings for each error code string from the gateway

$rawTransaction

$rawTransaction : array|null

Type

array|null — the raw transaction details provided by the gateway

$formattedTransaction

$formattedTransaction : array|null

example:

{
   "transactionid":"17728f8f9f82313494043bb7224b2f6c",
   "posid":"#02299991",
   "state":"VEVOOLDAL_VISSZAVONT",
   "responsecode":"VISSZAUTASITOTTFIZETES",
   "shopinformed":"true",
   "startdate":"20161116235449",
   "enddate":"20161117000150",
   "params":{
      "input":{
         "backurl":"http:\/\/www.google.com",
         "exchange":"HUF",
         "zipcodeneeded":"false",
         "narrationneeded":"false",
         "mailaddressneeded":"false",
         "countyneeded":"FALSE",
         "nameneeded":"false",
         "languagecode":"hu",
         "countryneeded":"FALSE",
         "amount":"100",
         "settlementneeded":"false",
         "streetneeded":"false",
         "consumerreceiptneeded":"FALSE",
         "consumerregistrationneeded":"FALSE"
      },
      "output":{

      }
   }
}

Type

array|null — easier to use version of $rawTransaction - only `StdObject`s and `Array`s

Methods

__construct()

__construct(array  $rawTransaction = null) : void

Create a new instance to parse a raw transaction object

Parameters

array $rawTransaction

the transaction details from the gateway

setRawTransaction()

setRawTransaction(array  $rawTransaction = null) : void

set the raw transaction details and parse it into $formattedTransaction

Parameters

array $rawTransaction

the transaction details from the gateway

getRawTransaction()

getRawTransaction() : array

get the raw transaction details

Returns

array —

raw transaction details from the gateway

getStartDate()

getStartDate() : \Carbon\Carbon|null

get the starting date of the first transaction of the results

Returns

\Carbon\Carbon|null —

date instance

getEndDate()

getEndDate() : \Carbon\Carbon|null

get the ending date of the last transaction of the results

Returns

\Carbon\Carbon|null —

date instance

fromXml()

fromXml(string  $xmlString) : \Clapp\OtpHu\Transaction

initialize a new Transaction instance from an xml string provided by the gateway

Parameters

string $xmlString

the xml string provided by the gateway

Returns

\Clapp\OtpHu\Transaction

transaction details instance

getRejectionReasonCode()

getRejectionReasonCode() : string|null

get the rejection code provided by the gateway

Returns

string|null —

rejection code from the gateway

getRejectionReasonMessage()

getRejectionReasonMessage() : string|null

get the human readable version of the rejection reason

Returns

string|null —

human readable version of the rejection reason

getTransactionId()

getTransactionId() : string

get the transaction id

Returns

string —

transaction id

isCompleted()

isCompleted() : boolean

is this transaction completed (not pending)?

Returns

boolean —

whether or not the transaction is completed

isSuccessful()

isSuccessful() : boolean

Is this transaction successful?

Returns

boolean —

whether or not the transaction is completed and successful

isRejected()

isRejected() : boolean

Is this transaction rejected?

Returns

boolean —

whether or not the transaction is completed, but rejected

isCancelled()

isCancelled() : boolean

Is this transaction cancelled by the user?

Returns

boolean —

whether or not the transaction is completed, but cancelled by the user

isPending()

isPending() : boolean

Is this transaction still pending?

Returns

boolean —

whether or not the transaction is not completed and still pending

getDate()

getDate(string  $dateString) : \Carbon\Carbon

parse a date string from the format used in the gateway to a Carbon instance

Parameters

string $dateString

a datetime string in the format used by the gateway

Returns

\Carbon\Carbon —

date instance

translateRejectionCodeToMessage()

translateRejectionCodeToMessage(string  $code) : string

translate a rejection code to a human readable string

Parameters

string $code

rejection code from the gateway

Throws

\InvalidArgumentException

if the $code is not found in $possibleRejectionErrorCodes

Returns

string —

human readable rejection string