Skip to content

Commit

Permalink
[BO] Bugfix: read transaction_id from array
Browse files Browse the repository at this point in the history
empty transaction id error occurs if someone cancels a product. Code tries to read id from object but an array is given. See http://www.prestashop.com/forums/topic/234174-how-to-solve-fatal-error-id-transaction-is-null-when-refundingcancelling-orders/ as well...
  • Loading branch information
Peter Schaeffer committed Jan 2, 2014
1 parent d335547 commit ace9665
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions paypal/paypal.php
Expand Up @@ -594,7 +594,7 @@ public function hookCancelProduct($params)
$message = $this->l('Cancel products result:').'<br>';

$amount = (float)($products[(int)$order_detail->id]['product_price_wt'] * (int)$cancel_quantity[(int)$order_detail->id]);
$refund = $this->_makeRefund($paypal_order->id_transaction, (int)$order->id, $amount);
$refund = $this->_makeRefund($paypal_order['id_transaction'], (int)$order->id, $amount);
$this->formatMessage($refund, $message);
$this->_addNewPrivateMessage((int)$order->id, $message);
}
Expand Down Expand Up @@ -1090,7 +1090,7 @@ private function _updatePaymentStatusOfOrder($id_order)

$paypal_lib = new PaypalLib();
$response = $paypal_lib->makeCall($this->getAPIURL(), $this->getAPIScript(), 'GetTransactionDetails',
'&'.http_build_query(array('TRANSACTIONID' => $paypal_order->id_transaction), '', '&'));
'&'.http_build_query(array('TRANSACTIONID' => $paypal_order['id_transaction']), '', '&'));

if (array_key_exists('ACK', $response))
{
Expand Down

0 comments on commit ace9665

Please sign in to comment.