/includes/modules/payment/paypalwpp.php
line 673 starts like this:
Code:
function after_process() {
global $insert_id, $db, $order;
// update OSH records for this order (which at outset is only a single record anyway)
$sql = "UPDATE ".TABLE_ORDERS_STATUS_HISTORY. "
SET comments = concat(if (trim(comments) != '', concat(trim(comments), '\n\n'), ''),
'Transaction ID: :transID " .
"\nPayment Type: :pmtType " .
"\nTimestamp: :pmtTime " .
"\nPayment Status: :pmtStatus " .
" :AVS " .
"\nAmount: :orderAmount')
WHERE orders_id = ".(int)$insert_id;
$sql = $db->bindVars($sql, ':transID', $this->trans_id, 'noquotestring');
$sql = $db->bindVars($sql, ':pmtType', $this->payment_type, 'noquotestring');
$sql = $db->bindVars($sql, ':pmtTime', $this->payment_time, 'noquotestring');
$sql = $db->bindVars($sql, ':pmtStatus', $this->payment_status, 'noquotestring');
$sql = $db->bindVars($sql, ':AVS', ($this->avs != 'N/A' ? "\nAVS Code: ".$this->avs."\nCVV2 Code: ".$this->cvv2 : ''), 'noquotestring');
$sql = $db->bindVars($sql, ':orderAmount', urldecode($this->responsedata['AMT'] . ' ' . $this->responsedata['CURRENCYCODE']), 'noquotestring');
$db->Execute($sql);
Change that to this:
Code:
function after_process() {
global $insert_id, $db, $order;
// add a new OSH record for this order's PP details
$commentString = "Transaction ID: :transID: " .
(isset($this->responsedata['PPREF']) ? "\nPPRef: " . $this->responsedata['PPREF'] : "") .
(isset($this->responsedata['AUTHCODE'])? "\nAuthCode: " . $this->responsedata['AUTHCODE'] : "") .
"\nPayment Type: :pmtType: " .
"\nTimestamp: :pmtTime: " .
"\nPayment Status: :pmtStatus: " .
($this->avs != 'N/A' ? "\nAVS Code: ".$this->avs."\nCVV2 Code: ".$this->cvv2 : '') .
"\nAmount: :orderAmt: ";
$commentString = $db->bindVars($commentString, ':transID:', $this->transaction_id, 'noquotestring');
$commentString = $db->bindVars($commentString, ':pmtType:', $this->payment_type, 'noquotestring');
$commentString = $db->bindVars($commentString, ':pmtTime:', $this->payment_time, 'noquotestring');
$commentString = $db->bindVars($commentString, ':pmtStatus:', $this->payment_status, 'noquotestring');
$commentString = $db->bindVars($commentString, ':orderAmt:', $this->amt, 'noquotestring');
$sql_data_array= array(array('fieldName'=>'orders_id', 'value'=>$insert_id, 'type'=>'integer'),
array('fieldName'=>'orders_status_id', 'value'=>$order->info['order_status'], 'type'=>'integer'),
array('fieldName'=>'date_added', 'value'=>'now()', 'type'=>'noquotestring'),
array('fieldName'=>'customer_notified', 'value'=>0, 'type'=>'integer'),
array('fieldName'=>'comments', 'value'=>$commentString, 'type'=>'string'));
$db->perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
This will force the PayPal comments to be added as a new order-history entry instead of appending them to the existing one.
Bookmarks