Payment_Process2
[ class tree: Payment_Process2 ] [ index: Payment_Process2 ] [ all elements ]

Class: Payment_Process2_Result

Source Location: /Payment_Process2-0.3.1/Payment/Process2/Result.php

Class Overview


Payment_Process2_Result


Author(s):

Version:

  • Release: @package_version@

Variables

Methods


Child classes:

Payment_Process2_Result_Bibit
Payment_Process2_Bibit_Result
Payment_Process2_Result_ANZ
Driver for the ANZ Bank's eGate Payment Web Service (Merchant-Hosted)
Payment_Process2_Result_PayPal
Payment_Process2_Result
Payment_Process2_Result_TrustCommerce
Payment_Process2_Result
Payment_Process2_Result_AuthorizeNet
Payment_Process2_Result
Payment_Process2_Result_Dummy
Dummy response
Payment_Process2_Result_LinkPoint
Payment_Process2_Result_LinkPoint
Payment_Process2_Result_Transfirst
Payment_Process2_Result

Inherited Variables

Inherited Methods


Class Details

[line 26]
Payment_Process2_Result

The core result class that should be returned from each driver's process() function. This should be exte33nded as Payment_Process2_Result_DriverName and then have the appropriate fields mapped out accordingly.

Take special care to appropriately create a parse() function in your result class. You can then call _mapFields() with a resultArray (ie. exploded result) to map your results from parse() into the member variables.

Please note that this class keeps your original codes intact so they can be accessed directly and then uses the function wrappers to return uniform Payment_Process codes.



[ Top ]


Class Variables

$approvalCode =

[line 101]

Authorization/Approval code

Type:   string


[ Top ]

$avsCode =

[line 118]

Address verification code

The AVS code returned from your gateway. This should then be mapped to the appropriate Payment_Process2::AVS_* code using $_avsCodeMap. This value should also be mapped to the appropriate textual message via the $_avsCodeMessages array.


Type:   string


[ Top ]

$code =

[line 63]

The approval/decline code

The value returned by your gateway as approved/declined should be mapped into this variable. Valid results should then be mapped into the appropriate Payment_Process2::RESULT_* code using the $_statusCodeMap array. Values returned into $code should be mapped as keys in the map with Payment_Process2::RESULT_* as the values.


Type:   mixed


[ Top ]

$customerId =

[line 156]

Customer ID

Unique internal customer ID (ie. your company's customer ID used to track individual customers).


Type:   string


[ Top ]

$cvvCode =  Payment_Process2::CVV_NOAPPLY

[line 169]

CVV Code

The CVV code is the 3-4 digit number on the back of most credit cards. This value should be mapped via the $_cvvCodeMap variable to the appropriate Payment_Process2::CVV_* values.


Type:   string


[ Top ]

$cvvMessage =  'No CVV message from gateway'

[line 182]

CVV Message

Your cvvCode value should be mapped to appropriate messages via the $_cvvCodeMessage array. This value is merely here to hold the value returned from the gateway (if any).


Type:   string


[ Top ]

$invoiceNumber =

[line 144]

Invoice Number

Unique internal invoiceNumber (ie. your company's order/invoice number that you assign each order as it is processed). It is always a good idea to pass this to the gateway (which is usually then echo'd back).


Type:   string


[ Top ]

$message =

[line 92]

Message from gateway

Map the textual message from the gateway into this variable. It is not currently returned or used (in favor of the $_statusCodeMessages map, but can be accessed directly for debugging purposes.


Type:   string


[ Top ]

$messageCode =

[line 78]

Message/Response Code

Along with the response (yes/no) you usually get a response/message code that translates into why it was approved/declined. This is where you map that code into. Your $_statusCodeMessages would then be keyed by valid messageCode values.


Type:   mixed


[ Top ]

$transactionId =

[line 131]

Transaction ID

This is the unique transaction ID, which is used by gateways to modify transactions (credit, update, etc.). Map the appropriate value into this variable.


Type:   string


[ Top ]

$_rawResponse =  null

[line 46]

The raw response

Type:   string


[ Top ]



Method Detail

__construct (Constructor)   [line 195]

Payment_Process2_Result __construct( string $rawResponse, Payment_Process2_Common $request)

Class constructor

Overridden in child classes as:

Payment_Process2_Result_Bibit::__construct()
Class constructor
Payment_Process2_Result_ANZ::__construct()
Class constructor
Payment_Process2_Result_Transfirst::__construct()
Constructor.

Parameters:

string   $rawResponse   —  Raw response
Payment_Process2_Common   $request   —  Request

[ Top ]

accept   [line 375]

boolean accept( object $object)

Accept an object
  • Return: TRUE if accepted, FALSE otherwise

Parameters:

object   $object   —  Object to accept

[ Top ]

factory   [line 214]

Payment_Process2_Result factory( string $type, string $rawResponse, Payment_Process2_Common $request)

factory

Parameters:

string   $type   —  Type
string   $rawResponse   —  Raw response
Payment_Process2_Common   $request   —  Request

[ Top ]

getAVSCode   [line 312]

integer getAVSCode( )

Returns the AVS code
  • Return: one of Payment_Process2::AVS_* constants

[ Top ]

getAVSMessage   [line 322]

string getAVSMessage( )

Returns the AVS message

[ Top ]

getCode   [line 277]

integer getCode( )

getCode
  • Return: one of Payment_Process2::RESULT_* constant
  • Author: Joe Stump <joe@joestump.net>
  • Access: public

Overridden in child classes as:

Payment_Process2_Result_Bibit::getCode()
Return response code
Payment_Process2_Result_Transfirst::getCode()

[ Top ]

getCvvCode   [line 335]

integer getCvvCode( )

Return the CVV match code
  • Return: One of Payment_Process2::CVV_* constants or null
  • Todo: Think if this should raise exceptions for unknown cvvcode?

[ Top ]

getCvvMessage   [line 345]

string getCvvMessage( )

Returns the CVV match message

[ Top ]

getMessage   [line 296]

string getMessage( )

getMessage

Return the message from the code map, or return the raw message if there is one. Otherwise, return a worthless message.


[ Top ]

log   [line 393]

mixed log( string $message, [string $priority = null])

Log a message
  • Return: Return value of Log::log(), or false if no Log instance has been accepted.

Parameters:

string   $message   —  Message to log
string   $priority   —  Message priority

[ Top ]

validate   [line 240]

mixed validate( )

validate

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:40:37 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.