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

Class: Payment_Process_Result

Source Location: /Payment_Process-0.6.8/Process.php

Class Overview


Payment_Process_Result


Author(s):

Version:

  • Release: @package_version@

Variables

Methods


Child classes:

Payment_Process_Result_Bibit
Payment_Process_Bibit_Result
Payment_Process_Result_PayPal
Payment_Process_Result
Payment_Process_Result_TrustCommerce
Payment_Process_Result
Payment_Process_Result_Paycom
Payment_Process_Result
Payment_Process_Result_AuthorizeNet
Payment_Process_Result
Payment_Process_Result_Dummy
Dummy response
Payment_Process_Result_LinkPoint
Payment_Process_Result_LinkPoint
Payment_Process_Result_Transfirst
Payment_Process_Result

Inherited Variables

Inherited Methods


Class Details

[line 362]
Payment_Process_Result

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

Authorization/Approval code

Type:   string


[ Top ]

$avsCode =

[line 454]

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

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

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

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

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

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

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

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

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

The raw response (ie. from cURL)

Type:   string


[ Top ]



Method Detail

Payment_Process_Result (Constructor)   [line 526]

Payment_Process_Result Payment_Process_Result( string $rawResponse, mixed $request)

Class constructor

Parameters:

string   $rawResponse   —  Raw response
mixed   $request   —  Request

[ Top ]

accept   [line 742]

boolean accept( object &$object)

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

Parameters:

object   &$object   —  Object to accept

[ Top ]

factory   [line 544]

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

factory

Parameters:

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

[ Top ]

getAVSCode   [line 681]

integer getAVSCode( )

Returns the AVS code
  • Return: one of PAYMENT_PROCESS_AVS_* constants

[ Top ]

getAVSMessage   [line 691]

string getAVSMessage( )

Returns the AVS message

[ Top ]

getCode   [line 646]

integer getCode( )

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

Overridden in child classes as:

Payment_Process_Result_Bibit::getCode()
Return response code
Payment_Process_Result_Transfirst::getCode()

[ Top ]

getCvvCode   [line 702]

integer getCvvCode( )

Return the CVV match code
  • Return: One of PAYMENT_PROCESS_CVV_* constants

[ Top ]

getCvvMessage   [line 712]

string getCvvMessage( )

Returns the CVV match message

[ Top ]

getMessage   [line 665]

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

mixed 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_PayPal::isLegitimate()
Validates the legitimacy of the response
Payment_Process_Result_AuthorizeNet::isLegitimate()
Validates the legitimacy of the response

[ Top ]

log   [line 760]

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

mixed parse( )

parse

Overridden in child classes as:

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

[ Top ]

parseCallback   [line 614]

mixed parseCallback( )

parseCallback

Overridden in child classes as:

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

[ Top ]

validate   [line 563]

mixed validate( )

validate

[ Top ]


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