cvs: pear /Payment_Process package.xml /Payment_Process/Process AuthorizeNet.php Bibit.php LinkPoint.php Type.php /Payment_Process/examples
echeck.php
| From: | Joe Stump | Date: | Thu, 14 Jul 2005 21:54:05 +0000 |
| Subject: | cvs: pear /Payment_Process package.xml /Payment_Process/Process AuthorizeNet.php Bibit.php LinkPoint.php Type.php /Payment_Process/examples echeck.php |
||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-33051@lists.php.net to get a copy of this message | ||
jstump Thu Jul 14 17:54:05 2005 EDT
Modified files:
/pear/Payment_Process package.xml
/pear/Payment_Process/Process AuthorizeNet.php Bibit.php
LinkPoint.php Type.php
/pear/Payment_Process/examples echeck.php
Log:
- Changed Payment_Process_Type::$name to be split into $firstName and $lastName
- Changed all drivers to reflect this change
http://cvs.php.net/diff.php/pear/Payment_Process/package.xml?r1=1.30&r2=1.31&ty=u Index: pear/Payment_Process/package.xml diff -u pear/Payment_Process/package.xml:1.30 pear/Payment_Process/package.xml:1.31 --- pear/Payment_Process/package.xml:1.30 Tue Jul 12 19:35:53 2005 +++ pear/Payment_Process/package.xml Thu Jul 14 17:54:04 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Id: package.xml,v 1.30 2005/07/12 23:35:53 jstump Exp $ --> +<!-- $Id: package.xml,v 1.31 2005/07/14 21:54:04 jstump Exp $ --> <package version="1.0"> <name>Payment_Process</name> <summary>Unified payment processor</summary> @@ -40,6 +40,7 @@ <notes><![CDATA[ * Closed bug #2896 * Moved validation code in Payment_Process_Type_CreditCard to use the new Validate_Finance_CreditCard package (Bug #4765) + * Removed Payment_Process_Type::$name and replaced it with Payment_Process_Type::$firstName and Payment_Process_Type::$lastName respectively * Fixed field encapsulation in AuthorizeNet driver (Bug #2756) * Fixed _prepareQueryString() in AuthorizeNet driver (Bug #3820) * Fixed undefined index in Common.php (Bug #3821) http://cvs.php.net/diff.php/pear/Payment_Process/Process/AuthorizeNet.php?r1=1.30&r2=1.31&ty=u Index: pear/Payment_Process/Process/AuthorizeNet.php diff -u pear/Payment_Process/Process/AuthorizeNet.php:1.30 pear/Payment_Process/Process/AuthorizeNet.php:1.31 --- pear/Payment_Process/Process/AuthorizeNet.php:1.30 Thu Jul 14 16:14:29 2005 +++ pear/Payment_Process/Process/AuthorizeNet.php Thu Jul 14 17:54:05 2005 @@ -19,7 +19,7 @@ * @author Philippe Jausions <Philippe.Jausions@11abacus.com> * @copyright 1997-2005 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Revision: 1.30 $ + * @version CVS: $Revision: 1.31 $ * @link http://pear.php.net/package/Payment_Process */ @@ -56,8 +56,6 @@ * @link http://www.authorize.net/ */ class Payment_Process_AuthorizeNet extends Payment_Process_Common { - - /** * Front-end -> back-end field map. * @@ -102,6 +100,8 @@ var $_typeFieldMap = array( 'CreditCard' => array( + 'firstName' => 'x_first_name', + 'lastName' => 'x_last_name', 'cardNumber' => 'x_card_num', 'cvv' => 'x_card_code', 'expDate' => 'x_exp_date' @@ -111,8 +111,7 @@ 'routingCode' => 'x_bank_aba_code', 'accountNumber' => 'x_bank_acct_num', 'type' => 'x_bank_acct_type', - 'bankName' => 'x_bank_name', - 'name' => 'x_bank_acct_name' + 'bankName' => 'x_bank_name' ) ); @@ -333,14 +332,17 @@ /** * _handleName * + * If it's an eCheck we need to combine firstName and lastName into a + * single account name. + * * @author Joe Stump <joe@joestump.net> * @access private */ function _handleName() { - $parts = explode(' ', $this->_payment->name); - $this->_data['x_first_name'] = array_shift($parts); - $this->_data['x_last_name'] = implode(' ', $parts); + if ($this->_payment->getType() == 'eCheck') { + $this->_data['x_bank_acct_name'] = $this->_payment->firstName.' '.$this->_payment->lastName; + } } } http://cvs.php.net/diff.php/pear/Payment_Process/Process/Bibit.php?r1=1.4&r2=1.5&ty=u Index: pear/Payment_Process/Process/Bibit.php diff -u pear/Payment_Process/Process/Bibit.php:1.4 pear/Payment_Process/Process/Bibit.php:1.5 --- pear/Payment_Process/Process/Bibit.php:1.4 Thu Jul 7 20:13:25 2005 +++ pear/Payment_Process/Process/Bibit.php Thu Jul 14 17:54:05 2005 @@ -16,7 +16,7 @@ // | Authors: Robin Ericsson <lobbin@localhost.nu> | // +----------------------------------------------------------------------+ // -// $Id: Bibit.php,v 1.4 2005/07/08 00:13:25 jstump Exp $ +// $Id: Bibit.php,v 1.5 2005/07/14 21:54:05 jstump Exp $ require_once('Payment/Process.php'); require_once('Payment/Process/Common.php'); @@ -349,8 +349,9 @@ 'year' => substr($data['x_exp_date'], 3, 4))); $doc .= XML_Util::createEndElement('expiryDate'); } - if (isset($this->_payment->name)) { - $doc .= XML_Util::createTag('cardHolderName', null, $this->_payment->name); + if (isset($this->_payment->firstName) && + isset($this->_payment->lastName)) { + $doc .= XML_Util::createTag('cardHolderName', null, $this->_payment->firstName.' '.$this->_payment->lastName); } if (isset($data['x_card_code'])) { $doc .= XML_Util::createTag('cvc', null, $data['x_card_code']); http://cvs.php.net/diff.php/pear/Payment_Process/Process/LinkPoint.php?r1=1.8&r2=1.9&ty=u Index: pear/Payment_Process/Process/LinkPoint.php diff -u pear/Payment_Process/Process/LinkPoint.php:1.8 pear/Payment_Process/Process/LinkPoint.php:1.9 --- pear/Payment_Process/Process/LinkPoint.php:1.8 Thu Jul 7 20:13:26 2005 +++ pear/Payment_Process/Process/LinkPoint.php Thu Jul 14 17:54:05 2005 @@ -16,7 +16,7 @@ // | Authors: Joe Stump <joe@joestump.net> | // +----------------------------------------------------------------------+ // -// $Id: LinkPoint.php,v 1.8 2005/07/08 00:13:26 jstump Exp $ +// $Id: LinkPoint.php,v 1.9 2005/07/14 21:54:05 jstump Exp $ require_once('Payment/Process.php'); require_once('Payment/Process/Common.php'); @@ -291,10 +291,11 @@ $xml .= '</creditcard>'."\n"; } - if (strlen($this->_payment->name)) { + if (isset($this->_payment->firstName) && + isset($this->_payment->lastName)) { $xml .= '<billing>'."\n"; $xml .= ' <userid>'.$this->_payment->customerId.'</userid>'."\n"; - $xml .= ' <name>'.$this->_payment->name.'</name>'."\n"; + $xml .= ' <name>'.$this->_payment->firstName.' '.$this->_payment->lastName.'</name>'."\n"; $xml .= ' <company>'.$this->_payment->company.'</company>'."\n"; $xml .= ' <address1>'.$this->_payment->address.'</address1>'."\n"; $xml .= ' <city>'.$this->_payment->city.'</city>'."\n"; http://cvs.php.net/diff.php/pear/Payment_Process/Process/Type.php?r1=1.18&r2=1.19&ty=u Index: pear/Payment_Process/Process/Type.php diff -u pear/Payment_Process/Process/Type.php:1.18 pear/Payment_Process/Process/Type.php:1.19 --- pear/Payment_Process/Process/Type.php:1.18 Thu Jul 7 19:26:15 2005 +++ pear/Payment_Process/Process/Type.php Thu Jul 14 17:54:05 2005 @@ -17,7 +17,7 @@ // | Joe Stump <joe@joestump.net> | // +----------------------------------------------------------------------+ // -// $Id: Type.php,v 1.18 2005/07/07 23:26:15 jstump Exp $ +// $Id: Type.php,v 1.19 2005/07/14 21:54:05 jstump Exp $ define('PAYMENT_PROCESS_CC_VISA', 100); define('PAYMENT_PROCESS_CC_MASTERCARD', 101); @@ -42,17 +42,95 @@ class Payment_Process_Type { // {{{ properties + /** + * $_type + * + * @var string $type Type of payment (ie. 'CreditCard' or 'eCheck') + */ var $_type = null; - var $name; + + /** + * $firstName + * + * @var string $firstName + */ + var $firstName; + + /** + * $lastName + * + * @var string $lastName + */ + var $lastName; + + /** + * $company + * + * @var string $company + */ var $company; + + /** + * $address + * + * @var string $addres + */ var $address; + + /** + * $city + * + * @var string $city + */ var $city; + + /** + * $state + * + * @var string $state State/Province of customer + */ var $state; + + /** + * $zip + * + * @var string $zip Zip/Postal code of customer + */ var $zip; + + /** + * $country + * + * @var string $country Country code of customer (ie. US) + */ var $country; + + /** + * $phone + * + * @var string $phone Phone number of customer + */ var $phone; + + /** + * $fax + * + * @var string $fax Fax number of customer + */ var $fax; + + /** + * $city + * + * @var string $email Email address of customer + */ var $email; + + /** + * $ipAddress + * + * @var string $ipAddress Remote IP address of customer + */ var $ipAddress; // }}} // {{{ __construct() http://cvs.php.net/diff.php/pear/Payment_Process/examples/echeck.php?r1=1.1&r2=1.2&ty=u Index: pear/Payment_Process/examples/echeck.php diff -u pear/Payment_Process/examples/echeck.php:1.1 pear/Payment_Process/examples/echeck.php:1.2 --- pear/Payment_Process/examples/echeck.php:1.1 Wed Mar 31 14:27:26 2004 +++ pear/Payment_Process/examples/echeck.php Thu Jul 14 17:54:05 2005 @@ -17,7 +17,8 @@ if (!PEAR::isError($check)) { $check->invoiceNumber = 112345145; $check->customerId = 1461264151; - $check->name = 'Jose Perez'; + $check->firstName = 'Jose'; + $check->lastName = 'Perez'; $check->type = PAYMENT_PROCESS_CK_CHECKING; $check->bankName = 'Bank of USA'; $check->accountNumber = '2222222222';
http://cvs.php.net/diff.php/pear/Payment_Process/package.xml?r1=1.30&r2=1.31&ty=u Index: pear/Payment_Process/package.xml diff -u pear/Payment_Process/package.xml:1.30 pear/Payment_Process/package.xml:1.31 --- pear/Payment_Process/package.xml:1.30 Tue Jul 12 19:35:53 2005 +++ pear/Payment_Process/package.xml Thu Jul 14 17:54:04 2005 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Id: package.xml,v 1.30 2005/07/12 23:35:53 jstump Exp $ --> +<!-- $Id: package.xml,v 1.31 2005/07/14 21:54:04 jstump Exp $ --> <package version="1.0"> <name>Payment_Process</name> <summary>Unified payment processor</summary> @@ -40,6 +40,7 @@ <notes><![CDATA[ * Closed bug #2896 * Moved validation code in Payment_Process_Type_CreditCard to use the new Validate_Finance_CreditCard package (Bug #4765) + * Removed Payment_Process_Type::$name and replaced it with Payment_Process_Type::$firstName and Payment_Process_Type::$lastName respectively * Fixed field encapsulation in AuthorizeNet driver (Bug #2756) * Fixed _prepareQueryString() in AuthorizeNet driver (Bug #3820) * Fixed undefined index in Common.php (Bug #3821) http://cvs.php.net/diff.php/pear/Payment_Process/Process/AuthorizeNet.php?r1=1.30&r2=1.31&ty=u Index: pear/Payment_Process/Process/AuthorizeNet.php diff -u pear/Payment_Process/Process/AuthorizeNet.php:1.30 pear/Payment_Process/Process/AuthorizeNet.php:1.31 --- pear/Payment_Process/Process/AuthorizeNet.php:1.30 Thu Jul 14 16:14:29 2005 +++ pear/Payment_Process/Process/AuthorizeNet.php Thu Jul 14 17:54:05 2005 @@ -19,7 +19,7 @@ * @author Philippe Jausions <Philippe.Jausions@11abacus.com> * @copyright 1997-2005 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Revision: 1.30 $ + * @version CVS: $Revision: 1.31 $ * @link http://pear.php.net/package/Payment_Process */ @@ -56,8 +56,6 @@ * @link http://www.authorize.net/ */ class Payment_Process_AuthorizeNet extends Payment_Process_Common { - - /** * Front-end -> back-end field map. * @@ -102,6 +100,8 @@ var $_typeFieldMap = array( 'CreditCard' => array( + 'firstName' => 'x_first_name', + 'lastName' => 'x_last_name', 'cardNumber' => 'x_card_num', 'cvv' => 'x_card_code', 'expDate' => 'x_exp_date' @@ -111,8 +111,7 @@ 'routingCode' => 'x_bank_aba_code', 'accountNumber' => 'x_bank_acct_num', 'type' => 'x_bank_acct_type', - 'bankName' => 'x_bank_name', - 'name' => 'x_bank_acct_name' + 'bankName' => 'x_bank_name' ) ); @@ -333,14 +332,17 @@ /** * _handleName * + * If it's an eCheck we need to combine firstName and lastName into a + * single account name. + * * @author Joe Stump <joe@joestump.net> * @access private */ function _handleName() { - $parts = explode(' ', $this->_payment->name); - $this->_data['x_first_name'] = array_shift($parts); - $this->_data['x_last_name'] = implode(' ', $parts); + if ($this->_payment->getType() == 'eCheck') { + $this->_data['x_bank_acct_name'] = $this->_payment->firstName.' '.$this->_payment->lastName; + } } } http://cvs.php.net/diff.php/pear/Payment_Process/Process/Bibit.php?r1=1.4&r2=1.5&ty=u Index: pear/Payment_Process/Process/Bibit.php diff -u pear/Payment_Process/Process/Bibit.php:1.4 pear/Payment_Process/Process/Bibit.php:1.5 --- pear/Payment_Process/Process/Bibit.php:1.4 Thu Jul 7 20:13:25 2005 +++ pear/Payment_Process/Process/Bibit.php Thu Jul 14 17:54:05 2005 @@ -16,7 +16,7 @@ // | Authors: Robin Ericsson <lobbin@localhost.nu> | // +----------------------------------------------------------------------+ // -// $Id: Bibit.php,v 1.4 2005/07/08 00:13:25 jstump Exp $ +// $Id: Bibit.php,v 1.5 2005/07/14 21:54:05 jstump Exp $ require_once('Payment/Process.php'); require_once('Payment/Process/Common.php'); @@ -349,8 +349,9 @@ 'year' => substr($data['x_exp_date'], 3, 4))); $doc .= XML_Util::createEndElement('expiryDate'); } - if (isset($this->_payment->name)) { - $doc .= XML_Util::createTag('cardHolderName', null, $this->_payment->name); + if (isset($this->_payment->firstName) && + isset($this->_payment->lastName)) { + $doc .= XML_Util::createTag('cardHolderName', null, $this->_payment->firstName.' '.$this->_payment->lastName); } if (isset($data['x_card_code'])) { $doc .= XML_Util::createTag('cvc', null, $data['x_card_code']); http://cvs.php.net/diff.php/pear/Payment_Process/Process/LinkPoint.php?r1=1.8&r2=1.9&ty=u Index: pear/Payment_Process/Process/LinkPoint.php diff -u pear/Payment_Process/Process/LinkPoint.php:1.8 pear/Payment_Process/Process/LinkPoint.php:1.9 --- pear/Payment_Process/Process/LinkPoint.php:1.8 Thu Jul 7 20:13:26 2005 +++ pear/Payment_Process/Process/LinkPoint.php Thu Jul 14 17:54:05 2005 @@ -16,7 +16,7 @@ // | Authors: Joe Stump <joe@joestump.net> | // +----------------------------------------------------------------------+ // -// $Id: LinkPoint.php,v 1.8 2005/07/08 00:13:26 jstump Exp $ +// $Id: LinkPoint.php,v 1.9 2005/07/14 21:54:05 jstump Exp $ require_once('Payment/Process.php'); require_once('Payment/Process/Common.php'); @@ -291,10 +291,11 @@ $xml .= '</creditcard>'."\n"; } - if (strlen($this->_payment->name)) { + if (isset($this->_payment->firstName) && + isset($this->_payment->lastName)) { $xml .= '<billing>'."\n"; $xml .= ' <userid>'.$this->_payment->customerId.'</userid>'."\n"; - $xml .= ' <name>'.$this->_payment->name.'</name>'."\n"; + $xml .= ' <name>'.$this->_payment->firstName.' '.$this->_payment->lastName.'</name>'."\n"; $xml .= ' <company>'.$this->_payment->company.'</company>'."\n"; $xml .= ' <address1>'.$this->_payment->address.'</address1>'."\n"; $xml .= ' <city>'.$this->_payment->city.'</city>'."\n"; http://cvs.php.net/diff.php/pear/Payment_Process/Process/Type.php?r1=1.18&r2=1.19&ty=u Index: pear/Payment_Process/Process/Type.php diff -u pear/Payment_Process/Process/Type.php:1.18 pear/Payment_Process/Process/Type.php:1.19 --- pear/Payment_Process/Process/Type.php:1.18 Thu Jul 7 19:26:15 2005 +++ pear/Payment_Process/Process/Type.php Thu Jul 14 17:54:05 2005 @@ -17,7 +17,7 @@ // | Joe Stump <joe@joestump.net> | // +----------------------------------------------------------------------+ // -// $Id: Type.php,v 1.18 2005/07/07 23:26:15 jstump Exp $ +// $Id: Type.php,v 1.19 2005/07/14 21:54:05 jstump Exp $ define('PAYMENT_PROCESS_CC_VISA', 100); define('PAYMENT_PROCESS_CC_MASTERCARD', 101); @@ -42,17 +42,95 @@ class Payment_Process_Type { // {{{ properties + /** + * $_type + * + * @var string $type Type of payment (ie. 'CreditCard' or 'eCheck') + */ var $_type = null; - var $name; + + /** + * $firstName + * + * @var string $firstName + */ + var $firstName; + + /** + * $lastName + * + * @var string $lastName + */ + var $lastName; + + /** + * $company + * + * @var string $company + */ var $company; + + /** + * $address + * + * @var string $addres + */ var $address; + + /** + * $city + * + * @var string $city + */ var $city; + + /** + * $state + * + * @var string $state State/Province of customer + */ var $state; + + /** + * $zip + * + * @var string $zip Zip/Postal code of customer + */ var $zip; + + /** + * $country + * + * @var string $country Country code of customer (ie. US) + */ var $country; + + /** + * $phone + * + * @var string $phone Phone number of customer + */ var $phone; + + /** + * $fax + * + * @var string $fax Fax number of customer + */ var $fax; + + /** + * $city + * + * @var string $email Email address of customer + */ var $email; + + /** + * $ipAddress + * + * @var string $ipAddress Remote IP address of customer + */ var $ipAddress; // }}} // {{{ __construct() http://cvs.php.net/diff.php/pear/Payment_Process/examples/echeck.php?r1=1.1&r2=1.2&ty=u Index: pear/Payment_Process/examples/echeck.php diff -u pear/Payment_Process/examples/echeck.php:1.1 pear/Payment_Process/examples/echeck.php:1.2 --- pear/Payment_Process/examples/echeck.php:1.1 Wed Mar 31 14:27:26 2004 +++ pear/Payment_Process/examples/echeck.php Thu Jul 14 17:54:05 2005 @@ -17,7 +17,8 @@ if (!PEAR::isError($check)) { $check->invoiceNumber = 112345145; $check->customerId = 1461264151; - $check->name = 'Jose Perez'; + $check->firstName = 'Jose'; + $check->lastName = 'Perez'; $check->type = PAYMENT_PROCESS_CK_CHECKING; $check->bankName = 'Bank of USA'; $check->accountNumber = '2222222222';