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

Class: Payment_Process_Result

Source Location: /Payment_Process-0.6.4/Process.php

Class Overview


Payment_Process_Result


Author(s):

Version:

  • @version@

Variables

Methods


Child classes:

Payment_Process_Result_Bibit
Payment_Process_Bibit_Result
Payment_Process_Result_TrustCommerce
Payment_Process_Result
Payment_Process_Result_AuthorizeNet
Payment_Process_Result
Payment_Process_Result_Dummy
Payment_Process_Result
Payment_Process_Result_LinkPoint
Payment_Process_Result_LinkPoint
Payment_Process_Result_Transfirst
Payment_Process_Result

Inherited Variables

Inherited Methods


Class Details

[line 307]
Payment_Process_Result

The core result class that should be returned from each driver's process() function. This should be extended as Payment_Process_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 381]

Authorization/Approval code

Type:   string


[ Top ]

$avsCode =

[line 398]

Address verification code

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


Type:   string


[ Top ]

$code =

[line 343]

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_PROCESS_RESULT_* code using the $_statusCodeMap array. Values returned into $code should be mapped as keys in the map with PAYMENT_PROCESS_RESULT_* as the values.


Type:   mixed


[ Top ]

$customerId =

[line 436]

Customer ID

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


Type:   string


[ Top ]

$cvvCode =  PAYMENT_PROCESS_CVV_NOAPPLY

[line 449]

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_PROCESS_CVV_* values.


Type:   string


[ Top ]

$cvvMessage =  'No CVV message from gateway'

[line 462]

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 424]

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 =  'No message from gateway'

[line 372]

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 358]

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 411]

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 326]

The raw response (ie. from cURL)

Type:   string


[ Top ]



Method Detail

Payment_Process_Result (Constructor)   [line 464]

Payment_Process_Result Payment_Process_Result( $rawResponse, $request)


Parameters:

   $rawResponse   — 
   $request   — 

[ Top ]

accept   [line 645]

boolean accept( &$object, object $object)

Accept an object
  • Return: true if accepted, false otherwise

Parameters:

object   $object   —  Object to accept
   &$object   — 

[ Top ]

factory   [line 480]

mixed &factory( string $type, string $rawResponse, mixed $request)

factory

Parameters:

string   $type   — 
string   $rawResponse   — 
mixed   $request   — 

[ Top ]

getAVSCode   [line 606]

void getAVSCode( )


[ Top ]

getAVSMessage   [line 611]

void getAVSMessage( )


[ Top ]

getCode   [line 576]

void getCode( )

getCode

Overridden in child classes as:

Payment_Process_Result_Bibit::getCode()
Payment_Process_Result_Transfirst::getCode()

[ Top ]

getCvvCode   [line 616]

void getCvvCode( )


[ Top ]

getCvvMessage   [line 621]

void getCvvMessage( )


[ Top ]

getMessage   [line 595]

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 ]

isLegitimate   [line 564]

void isLegitimate( )

isLegitimate

Some gateways allow you to validate the response to make sure it's actually them that are sending the response. Override this in the driver result class and implement this if your gateway provides such a mechanism. Any information required should be passed via $options.


Overridden in child classes as:

Payment_Process_Result_AuthorizeNet::isLegitimate()
Validates the legitimacy of the response

[ Top ]

log   [line 662]

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 ]

parse   [line 532]

void parse( )

parse

Overridden in child classes as:

Payment_Process_Result_Bibit::parse()
Payment_Process_Result_TrustCommerce::parse()
Payment_Process_Result_AuthorizeNet::parse()
Parses the data received from the payment gateway
Payment_Process_Result_LinkPoint::parse()
parse

[ Top ]

parseCallback   [line 546]

void parseCallback( )

parseCallback
  • Author: Joe Stump <joe@joestump.net>
  • See: Payment_Process_Common::processCallback()
  • Abstract:
  • Access: public

Overridden in child classes as:

Payment_Process_Result_AuthorizeNet::parseCallback()
Parses the data received from the payment gateway callback

[ Top ]

validate   [line 497]

mixed validate( )

validate

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:00:20 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.