cvs: pear /Payment_Process/Process Transfirst.php

From: Date: Thu, 14 Jul 2005 20:54:03 +0000
Subject: cvs: pear /Payment_Process/Process Transfirst.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-33049@lists.php.net to get a copy of this message
ieure Thu Jul 14 16:54:03 2005 EDT Modified files: /pear/Payment_Process/Process Transfirst.php Log: Handle new firstName/lastName fields correctly. http://cvs.php.net/diff.php/pear/Payment_Process/Process/Transfirst.php?r1=1.2&r2=1.3&ty=u Index: pear/Payment_Process/Process/Transfirst.php diff -u pear/Payment_Process/Process/Transfirst.php:1.2 pear/Payment_Process/Process/Transfirst.php:1.3 --- pear/Payment_Process/Process/Transfirst.php:1.2 Thu Jul 7 20:13:25 2005 +++ pear/Payment_Process/Process/Transfirst.php Thu Jul 14 16:54:00 2005 @@ -16,7 +16,7 @@ // | Authors: Ian Eure <ieure@php.net> | // +----------------------------------------------------------------------+ // -// $Id: Transfirst.php,v 1.2 2005/07/08 00:13:25 jstump Exp $ +// $Id: Transfirst.php,v 1.3 2005/07/14 20:54:00 ieure Exp $ require_once('Payment/Process/Common.php'); require_once('Net/Curl.php'); @@ -85,7 +85,7 @@ 'expDate' => "expirationDate", 'zip' => "cardHolderZip", // Common Type - 'name' => "cardHolderName", +// 'name' => "cardHolderName", 'address' => "cardHolderAddress", 'city' => "cardHolderCity", 'state' => "cardHolderState", @@ -136,7 +136,7 @@ { $this->__construct($options); } - + /** * Prepare the data. * @@ -148,6 +148,7 @@ if ($this->_options['testTransaction']) { $this->_data['testTransaction'] = $this->_options['testTransaction']; } + $this->_handleCardHolderName(); return parent::_prepare(); } @@ -183,7 +184,7 @@ PEAR::popErrorHandling(); return $res; } - + $this->_processed = true; // Restore error handling @@ -293,6 +294,19 @@ } /** + * Map firstName & lastName + * + * P_P now has split firstName/lastName fields, instead of 'name.' This + * handles concatenating them into the Transfirst cardHolderName field. + * + * @return void + */ + function _handleCardHolderName() + { + $this->_data['cardHolderName'] = $this->firstName . ' ' . $this->lastName; + } + + /** * Validate the merchant account login. * * The Transfirst docs specify that the login is exactly eight digits. @@ -358,7 +372,7 @@ 'max_length' => 15 )); } - + /** * Validate the zip code. * @@ -451,7 +465,7 @@ 'Y' => "Address and 5-digit zip match", 'Z' => "5-digit zip match" ); - + /** * Status code map * @@ -486,7 +500,7 @@ '5' => "Response provided by issuer", '9' => "Automated referral service (ARS) stand-in" ); - + var $_fieldMap = array( 0 => '_null', // TF Internal Message Format 1 => '_acctNo', // TF Account number @@ -502,15 +516,15 @@ 11 => 'customerId', // The Customer Number passed by the original request 12 => 'invoiceNumber', // The Order Number passed by the original request. 13 => '_urn', // A number that uniquely identifies an individual transaction. Assigned by TF and can be used when referencing a specific transaction. - 14 => '_authResponse', // A number provided by the issuing bank indicating the authorization is valid and funds have been reserved for transfer to the merchant’s account at a later time. + 14 => '_authResponse', // A number provided by the issuing bank indicating the authorization is valid and funds have been reserved for transfer to the merchants account at a later time. 15 => '_authSource', // A code that defines the source where an authorization was captured. 16 => '_authCharacteristic', // A code that defines the qualification level for the authorized transaction. 17 => 'approvalCode', // Assigned by Visa or MasterCard, used to uniquely identify and link together all related information and used to authorize and clear a transaction. 18 => '_validationCode', // Assigned by V.I.P. System that is used to determine the accuracy of the authorization data. - 19 => '_sicCatCode', // A merchant’s industry classification. Example - Mail Order/Phone Order Merchants (Direct Market) = 5969. + 19 => '_sicCatCode', // A merchants industry classification. Example - Mail Order/Phone Order Merchants (Direct Market) = 5969. 20 => '_currencyCode', // 840 indicate US Currency to date this is the only valid value. 21 => 'avsCode', // A value that indicates the level of Address Verification that was validated. - 22 => '_merchantStoreNo', // Identifies the specific terminal used at a location – 1-4 Merchant store #, 5-8 specific terminal at store. + 22 => '_merchantStoreNo', // Identifies the specific terminal used at a location 1-4 Merchant store #, 5-8 specific terminal at store. 23 => 'cvvCode' // A two-digit value, indicating the result of the card verification based on the CVV2 code provided by the cardholder. );

« previous php.pear.cvs (#33049) next »