diff -rupN Kohana_v2.3.4.orig/modules/payment/libraries/Payment.php Kohana_v2.3.4/modules/payment/libraries/Payment.php
--- Kohana_v2.3.4.orig/modules/payment/libraries/Payment.php	2008-12-14 18:48:56.000000000 -0700
+++ Kohana_v2.3.4/modules/payment/libraries/Payment.php	2009-10-14 01:20:52.000000000 -0700
@@ -27,6 +27,7 @@ class Payment_Core {
 	 * The driver will translate these into the specific format for the provider.
 	 * Standard fields are (Providers may have additional or different fields):
 	 *
+	 * card_type
 	 * card_num
 	 * exp_date
 	 * cvv
@@ -35,22 +36,30 @@ class Payment_Core {
 	 * tax
 	 * shipping
 	 * first_name
+	 * middle_name
 	 * last_name
 	 * company
 	 * address
+	 * address2
 	 * city
 	 * state
 	 * zip
+	 * country
 	 * email
 	 * phone
+	 * mobile
 	 * fax
 	 * ship_to_first_name
 	 * ship_to_last_name
 	 * ship_to_company
 	 * ship_to_address
+	 * ship_to_address2
 	 * ship_to_city
 	 * ship_to_state
 	 * ship_to_zip
+	 * ship_to_country
+	 * ship_to_phone
+	 * ship_to_email
 	 *
 	 * @param  array  the driver string
 	 */
diff -rupN Kohana_v2.3.4.orig/modules/payment/libraries/drivers/Payment/Paypalpro.php Kohana_v2.3.4/modules/payment/libraries/drivers/Payment/Paypalpro.php
--- Kohana_v2.3.4.orig/modules/payment/libraries/drivers/Payment/Paypalpro.php	2008-12-14 18:48:56.000000000 -0700
+++ Kohana_v2.3.4/modules/payment/libraries/drivers/Payment/Paypalpro.php	2009-10-14 01:47:54.000000000 -0700
@@ -12,15 +12,172 @@
 class Payment_Paypalpro_Driver implements Payment_Driver
 {
 	// Fields required to do a transaction
+	
+	/**
+	 *	Paypal Websites Payment Pro NVP API Field List 
+	 *	https://www.paypal.com/en_US/ebook/PP_NVPAPI_DeveloperGuide/Appx_fieldreference.html
+	 *
+	 *	METHOD => DoDirectPayment
+	 *	PAYMENTACTION => 13 bytes: Authorization, Sale
+	 *	IPADDRESS => 15 bytes: (ex:255.255.255.255)
+	 *	RETURNFMFDETAILS => 0 = (default) do not return FMF details, 1 = return FMF details
+	 *	CREDITCARDTYPE => 10 bytes: Visa, MasterCard, Discover, Amex, Maestro*, Solo* (* see API docs)
+	 *	ACCT => numeric only, no spaces or punctuation: 
+	 *	EXPDATE => 6 bytes, format MMYYYY
+	 *	CVV2 => Visa, MasterCard, Discover-3 bytes, Amex-4 bytes
+	 *	STARTDATE => MMYYYY month and year Maestro or Solo card issued
+	 *	ISSUENUMBER => 2 digits, Issue number of Maestro or Solor card.
+	 *	EMAIL => 127 bytes
+	 *	PAYERID => 13 bytes: Unique PayPal customer account id number
+	 *	PAYERSTATUS => 10 bytes: Verified, unverified
+	 *	COUNTRYCODE => 2 bytes: ISO3166 2 character country code of Payer
+	 *	BUSINESS => 127 bytes: Payer's Business Name
+	 *	SALUTATION => 20 bytes
+	 *	FIRSTNAME => 25 bytes
+	 *	MIDDLENAME => 25 bytes
+	 *	LASTNAME => 25 bytes
+	 *	SUFFIX => 12 bytes
+	 *	STREET => 100 bytes
+	 *	STREET2 => 100 bytes
+	 *	CITY => 40 bytes
+	 *	STATE => 40 bytes
+	 *	COUNTRYCODE => 2 bytes, ISO 3166
+	 *	ZIP => 20 bytes
+	 *	PHONENUM => 20 bytes
+	 *	AMT => less than 10000.00, no currency symbol, must have 2 decimals
+	 *	CURRENCYCODE => 3 bytes, default USD
+	 *	ITEMAMT => sum of cost of all items in order (required if L_AMTn used)
+	 *	SHIPPINGAMT  => shipping costs for order (requires ITEMAMT if specified)
+	 *	INSURANCEOPTIONOFFERED => true or false, if true shipping insurance must be positive number
+	 *	HANDLINGAMT => total handling for order (requires ITEMAMT if specified)
+	 *	TAXAMT => sum of tax for all items in order
+	 *	DESC => 127 bytes, description of items purchased
+	 *	CUSTOM => 256 bytes: free-form field for use
+	 *	INVNUM => 127 bytes: invoice or tracking number
+	 *	BUTTONSOURCE => 32 bytes, id code for use by 3rd party apps to id transactions
+	 *	NOTIFYURL => 2048 bytes, URL for IPN about this transaction (only for DoExpressCheckoutPayment)
+	 *	SHIPTONAME => 32 bytes, name with address (required if shipping address used)
+	 *	SHIPTOSTREET => 100 bytes (required if shipping address used)
+	 *	SHIPTOSTREET2 => 100 bytes
+	 *	SHIPTOCITY => 40 bytes (required if shipping address used)
+	 *	SHIPTOSTATE => 40 bytes (required if shipping address used)
+	 *	SHIPTOZIP => 20 bytes (required if US shipping address used, possibly other countries too)
+	 *	SHIPTOCOUNTRY => 2 bytes (required if shipping address used)
+	 *	SHIPTOPHONENUM => 20 bytes
+	 *	
+	 *	NOTE: L_* fields not included, see NVPAPI Developer Guide for details
+	 *	
+	 *	AUTHORIZATIONID => 19 bytes: The transaction id returned from DoDirectPayment or DoExpressCheckoutPayment
+	 *	COMPLETETYPE => 12 bytes: Complete or NotComplete
+	 *	NOTE => 255 bytes, inofrmation note displayed to payer in email
+	 *	SOFTDESCRIPTOR => 22 bytes, see API docs for more
+	 *	
+	 *	TRANSACTIONID => 19 bytes: Value of order's transaction id returned by PayPal
+	 *	TRANSACTIONENTITY => Only allowable value is Order
+	 *	
+	 *	NETAMT => less than 10000.00
+	 *	
+	 *	REFUNDTYPE => One of: Other, Full, or Partial - if Full do NOT set AMT
+	 */
+	
+	// Identifies required fields based on value of METHOD
+	
+	private $method_required_fields = array
+	(
+	 	'AddressVerify' => array
+		(
+		 	'METHOD', 'EMAIL', 'STREET', 'ZIP'
+		),
+		'DoCapture' => array
+		(
+		 	'METHOD', 'AUTHORIZATIONID', 'AMT', 'COMPLETETYPE'
+		),
+		'DoAuthorization' => array
+		(
+		 	'METHOD', 'TRANSACTIONID', 'AMT'
+		),
+		'DoReauthorization' => array
+		(
+		 	'METHOD', 'AUTHORIZATIONID', 'AMT'
+		),
+		'DoVoid' => array
+		(
+		 	'METHOD', 'AUTHORIZATIONID'
+		),
+		'DoNonReferencedCredit' => array
+		(
+		 	'METHOD', 
+			'AMT', 'CURRENCYCODE', 
+			'CREDITCARDTYPE', 'ACCT', 'EXPDATE', 
+			'FIRSTNAME', 'LASTNAME',
+			'STREET', 'CITY', 'COUNTRYCODE', 'ZIP',
+			'COUNTRYCODE=US:STATE'
+		),
+		'DoDirectPayment' => array
+		(
+		 	'METHOD', 'IPADDRESS',
+			'CREDITCARDTYPE', 'ACCT', 'EXPDATE',
+			'STREET', 'CITY', 'COUNTRYCODE', 'ZIP',
+			'AMT', 'COUNTRYCODE=US:STATE'
+		),
+		'RefundTransaction' => array
+		(
+		 	'METHOD', 'TRANSACTIONID', 'REFUNDTYPE'
+		),
+	);
 
 	/**
-	* these are the required fields for the API method DoDirectPayment
-	* other API methods and the associated fields required are listed here: http://tinyurl.com/2cffgr
-	*
-	* *note - paypalpro API field names are not case sensitive
-	*/
+	 * these are the required fields for the API method DoDirectPayment
+	 * other API methods and the associated fields required are listed here: http://tinyurl.com/2cffgr
+	 *
+	 * *note - paypalpro API field names are not case sensitive
+	 */
 
-	private $required_fields = array
+	private $map_payment_to_paypalpro = array
+	(
+		'card_type'				=> 'CREDITCARDTYPE',
+		'card_num' 				=> 'ACCT',
+	 	'exp_date'				=> 'EXPDATE',
+	 	'cvv'					=> 'CVV2',
+	 	'first_name'			=> 'FIRSTNAME',
+		'middle_name'           => 'MIDDLENAME',
+	 	'last_name'				=> 'LASTNAME',
+	 	'description'			=> 'DESC',
+	 	'amount'				=> 'AMT',
+	 	'tax'					=> 'TAXAMT',
+	 	'shipping'				=> 'SHIPPINGAMT',
+	 	'company'				=> 'BUSINESS',
+	 	'address'				=> 'STREET',
+		'address2'              => 'STREET2',
+	 	'city'					=> 'CITY',
+	 	'state'					=> 'STATE',
+	 	'zip'					=> 'ZIP',
+		'country'               => 'COUNTRYCODE',
+	 	'email'					=> 'EMAIL',
+	 	'phone'					=> 'PHONENUM',
+		'mobile'				=> '',
+	 	'fax'					=> '',
+	 	'ship_to_first_name'	=> '',
+	 	'ship_to_last_name'		=> '',
+	 	'ship_to_company'		=> '',
+	 	'ship_to_address'		=> 'SHIPTOSTREET',
+	 	'ship_to_address2'		=> 'SHIPTOSTREET2',
+	 	'ship_to_city'			=> 'SHIPTOCITY',
+	 	'ship_to_state'			=> 'SHIPTOSTATE',
+	 	'ship_to_zip'			=> 'SHIPTOZIP',
+		'ship_to_country'       => 'SHIPTOCOUNTRY',
+		'ship_to_phone'			=> '',
+		'ship_to_email'			=> ''
+	);
+
+	/**
+	 * these are a minimum set of required fields. set_fields() will map the 
+	 * fields required by METHOD into this as well.
+	 *
+	 * *note - paypalpro API field names are not case sensitive
+	 */
+
+	private $default_required_fields = array
 	(
 
 		'ENDPOINT'       => FALSE,
@@ -29,25 +186,11 @@ class Payment_Paypalpro_Driver implement
 		'SIGNATURE'      => FALSE,
 		'VERSION'        => FALSE,
 
-		'METHOD'         => FALSE,
-
-		'PAYMENTACTION'  => FALSE,
-
-		'CURRENCYCODE'   => FALSE, // default is USD - only required if other currency needed
-		'AMT'            => FALSE, // payment amount
-
-		'IPADDRESS'      => FALSE,
-
-		'FIRSTNAME'      => FALSE,
-		'LASTNAME'       => FALSE,
-
-		'CREDITCARDTYPE' => FALSE,
-		'ACCT'           => FALSE, // card number
-		'EXPDATE'        => FALSE,
-		'CVV2'           => FALSE
-
+		'METHOD'         => FALSE
 	);
 
+	private $required_fields = array();
+	
 	private $fields = array
 	(
 
@@ -58,39 +201,60 @@ class Payment_Paypalpro_Driver implement
 		'VERSION'        => '',
 
 		'METHOD'         => '',
-		/* some possible values for METHOD :
-		   'DoDirectPayment',
-		   'RefundTransaction',
-		   'DoAuthorization',
-		   'DoReauthorization',
-		   'DoCapture',
-		   'DoVoid'
-		*/
-
+		/** some possible values for METHOD :
+		 *  'DoDirectPayment',
+		 *  'RefundTransaction',
+		 *  'DoAuthorization',
+		 *  'DoReauthorization',
+		 *  'DoCapture',
+		 *  'DoVoid'
+		 */
 		'PAYMENTACTION'  => '',
-
-		'CURRENCYCODE'   => '',
-		'AMT'            => 0,  // payment amount
-
 		'IPADDRESS'      => '',
-
-		'FIRSTNAME'      => '',
-		'LASTNAME'       => '',
+		'RETURNFMFDETAILS' => '',
 
 		'CREDITCARDTYPE' => '',
 		'ACCT'           => '', // card number
 		'EXPDATE'        => '', // Format: MMYYYY
 		'CVV2'           => '', // security code
-
-		// -- OPTIONAL FIELDS --
-
+		'STARTDATE'      => '', // Maestro and Solo only
+		'ISSUENUMBER' 	 => '', // Maestro and Solo only
+		
+		'EMAIL'			 => '', 
+		'PAYERID'		 => '',
+		'PAYERSTATUS'	 => '',
+		
+		'BUSINESS'		 => '',
+		'SALUTATION'	 => '',
+		'FIRSTNAME'      => '',
+		'MIDDLENAME' 	 => '',
+		'LASTNAME'       => '',
+		'SUFFIX'		 => '',
+		
 		'STREET'         => '',
 		'STREET2'        => '',
 		'CITY'           => '',
 		'STATE'          => '',
 		'ZIP'            => '',
 		'COUNTRYCODE'    => '',
+		'PHONENUM' 		 => '',
 
+		'AMT'            => 0,  // payment amount
+		'CURRENCYCODE'   => '',
+
+		'ITEMAMT'		 => '',
+		'SHIPPINGAMT'	 => '',
+		'INSURANCEOPTIONOFFERED' => '',
+		'HANDLINGAMT' 	 => '',
+		'TAXAMT'		 => '',
+		
+		'DESC'			 => '',
+		'CUSTOM'		 => '',
+		'INVNUM'		 => '',
+
+		'BUTTONSOURCE'	 => '',
+		'NOTIFYURL'		 => '',
+		
 		'SHIPTONAME'        => '',
 		'SHIPTOSTREET'      => '',
 		'SHIPTOSTREET2'     => '',
@@ -98,14 +262,167 @@ class Payment_Paypalpro_Driver implement
 		'SHIPTOSTATE'       => '',
 		'SHIPTOZIP'         => '',
 		'SHIPTOCOUNTRYCODE' => '',
+		'SHIPTOPHONENUM'	=> '',
+		
+		// DoCapture
+		
+		'AUTHORIZATIONID'	=> '',
+		'COMPLETETYPE' 		=> '',
+		'NOTE' 				=> '',
+		'SOFTDESCRIPTOR' 	=> '',
+		
+		// DoAuthorization
+		
+		'TRANSACTIONID' 	=> '',
+		'TRANSACTIONENTITY' => '',
 
-		'INVNUM'         => '' // your internal order id / transaction id
+		// DoNonReferencedCredit
+		
+		'NETAMT'			=> '',
 
 		// other optional fields listed here:
-		// https://www.paypal.com/en_US/ebook/PP_NVPAPI_DeveloperGuide/Appx_fieldreference.html#2145100
+		// https://www.paypal.com/en_US/ebook/PP_NVPAPI_DeveloperGuide/Appx_fieldreference.html
 	);
 
 	private $test_mode = TRUE;
+	
+	private $currency_code = 'USD';
+	
+	private function check_fields() 
+	{
+		// zeroth law - map payment module variables into paypal payment pro variables
+		
+		foreach ( (array) $this->fields as $key => $value) 
+		{
+			switch ($key) 
+			{
+				case 'ship_to_first_name':
+					if ( ! empty($this->fields[$key])) 
+					{
+						// Not empty so we have part of a name
+						
+						if ( ! empty($this->fields['SHIPTONAME'])) 
+						{
+							// assume last name came first in the loop
+							
+							$this->fields['SHIPTONAME'] = $this->fields[$key].' '.$this->fields['SHIPTONAME'];
+						}
+						else
+						{
+							// assume nothing in SHIPTONAME, so save directly to it
+							
+							$this->fields['SHIPTONAME'] = $this->fields[$key];
+						}
+					}
+				break;
+				case 'ship_to_last_name':
+					if ( ! empty($this->fields[$key]))
+					{
+						// Not empty so we have part of a name
+						
+						if (!empty($this->fields['SHIPTONAME'])) 
+						{
+							// assume first name came first in the loop
+							
+							$this->fields['SHIPTONAME'] = $this->fields['SHIPTONAME'].' '.$this->fields[$key];
+						}
+						else
+						{
+							// assume nothing in SHIPTONAME, so save directly to it
+							
+							$this->fields['SHIPTONAME'] = $this->fields[$key];
+						}
+					}
+				break;
+				default:
+					if (array_key_exists($key, $this->map_payment_to_paypalpro)) 
+					{
+						$this->fields[$this->map_payment_to_paypalpro[$key]] = $value;
+						unset($this->fields[$key]);
+					}
+				break;
+			}
+		}
+		// at this point everything in $fields should be PayPal PaymentsPro key names
+	
+		// first get the method
+		
+		$method = $this->fields['METHOD'];
+		
+		// build new required_fields
+		
+		$this->required_fields = $this->default_required_fields;
+		
+		// fill up required fields with method specific requirements
+		
+		foreach ( (array) $this->method_required_fields[$method] as $key)
+		{
+			$equ = strpos($key, '=');
+			$col = strpos($key, ':');
+			if ($equ > 0 and $col > 0)
+			{
+				$prereqkey = substr($key, 0, $equ);
+				$prereqval = substr($key, $equ + 1, $col - $equ - 1);
+				$newkey    = substr($key, $col + 1, strlen($key) - $col + 1);
+				if ($this->fields[$prereqkey] == $prereqval)
+				{
+					$this->required_fields[$newkey] = FALSE;
+				}
+			}
+			else
+			{
+				$this->required_fields[$key] = FALSE;
+			}
+		}
+
+		// Check to see if method is refund and whether AMT is required or not
+		
+		if ($method == 'RefundTransaction') 
+		{
+			if ( ! empty($this->fields['REFUNDTYPE']) and $this->fields['REFUNDTYPE'] != 'Full') 
+			{	
+				// REFUNDTYPE other than Full requires AMT
+				
+				$this->required_fields['AMT'] = FALSE;
+			}
+		}
+		
+		// Check method/fields to see if CURRENCYCODE needs to be set
+		
+		if (array_key_exists('CURRENCYCODE', $this->required_fields)) 
+		{
+			// CURRENCYCODE is a required field, see if it is defined in fields
+			
+			if ( ! array_key_exists('CURRENCYCODE', $this->fields) or empty($this->fields['CURRENCYCODE'])) 
+			{
+				// not in fields, use default property 
+				
+				$this->fields['CURRENCYCODE'] = $this->currency_code;
+			}
+		}
+		
+		// Make sure DESCription is not too long to avoid SuccessWithWarning response
+		
+		if (strlen($this->fields['DESC']) > 127)
+		{
+			// truncate
+			
+			$this->fields['DESC'] = substr($this->fields['DESC'], 0, 127);
+		}
+		
+		// walk through the fields and map into the fields property, 
+		// also set required fields as appropriate
+		
+		foreach ( (array) $this->fields as $key => $value)
+		{
+			if (array_key_exists($key, $this->required_fields) and !empty($value))
+			{
+				$this->required_fields[$key] = TRUE;
+			}
+		
+		}
+
+	}
 
 	/**
 	 * Sets the config for the class.
@@ -133,14 +450,16 @@ class Payment_Paypalpro_Driver implement
 		}
 
 		$this->fields['VERSION']      = $config['VERSION'];
-		$this->fields['CURRENCYCODE'] = $config['CURRENCYCODE'];
+		
+		if ( ! empty($config['CURRENCYCODE'])) {
+			$this->currency_code = $config['CURRENCYCODE'];
+		}
 
-		$this->required_fields['USER']         = !empty($config['USER']);
-		$this->required_fields['PWD']          = !empty($config['PWD']);
-		$this->required_fields['SIGNATURE']    = !empty($config['SIGNATURE']);
-		$this->required_fields['ENDPOINT']     = !empty($config['ENDPOINT']);
-		$this->required_fields['VERSION']      = !empty($config['VERSION']);
-		$this->required_fields['CURRENCYCODE'] = !empty($config['CURRENCYCODE']);
+		$this->default_required_fields['USER']         = !empty($config['USER']);
+		$this->default_required_fields['PWD']          = !empty($config['PWD']);
+		$this->default_required_fields['SIGNATURE']    = !empty($config['SIGNATURE']);
+		$this->default_required_fields['ENDPOINT']     = !empty($config['ENDPOINT']);
+		$this->default_required_fields['VERSION']      = !empty($config['VERSION']);
 
 		$this->curl_config = $config['curl_config'];
 
@@ -171,6 +490,10 @@ class Payment_Paypalpro_Driver implement
 
 	public function process()
 	{
+		// Map and check fields before proceeding
+		
+		$this->check_fields();
+		
 		// Check for required fields
 		if (in_array(FALSE, $this->required_fields))
 		{
@@ -222,8 +545,14 @@ class Payment_Paypalpro_Driver implement
 		$nvp_res_array = array();
 
 		parse_str(urldecode($response),$nvp_res_array);
+		
+		$success = FALSE;
+		if ($nvp_res_array['ACK'] == 'Success' or $nvp_res_array['ACK'] == 'SuccessWithWarning') 
+		{
+			$success = TRUE;
+		}
 
-		return ($nvp_res_array['ACK'] == TRUE);
+		return $success;
 
 	}
-} // End Payment_Paypalpro_Driver Class
\ No newline at end of file
+} // End Payment_Paypalpro_Driver Class
