diff --git a/adm/tabs/AdminOrders.php b/adm/tabs/AdminOrders.php index e3bd43ac..5579190b 100755 --- a/adm/tabs/AdminOrders.php +++ b/adm/tabs/AdminOrders.php @@ -1629,11 +1629,10 @@ class AdminOrders extends AdminTab '; } $html .= '
'; - if($order->module && $order->module=="paybox"){ + if ($order->module && $order->module == "paybox") { require_once dirname(__FILE__).'/../../modules/paybox/paybox.php'; $refundsPaybox = Paybox::getAllRefundbyOrder($order->id); - if (sizeof($refundsPaybox)) - { + if (sizeof($refundsPaybox)) { $html .=''; foreach ($refundsPaybox as $refund) { $html .=' @@ -1646,7 +1645,7 @@ class AdminOrders extends AdminTab } else { $html .= '

Pas de remboursement

'; } - } elseif($order->module && $order->module=="paypal") { + } elseif ($order->module && $order->module == "paypal") { $paypal_messages = Db::getInstance()->ExecuteS(' SELECT `message`, `date_add` FROM `ps_message` @@ -1659,12 +1658,11 @@ class AdminOrders extends AdminTab $html .= '

('.date('d/m/Y',strtotime($message['message'])).'):
'.$message['message'].'

'; } } - if(empty($paypal_messages)){ - $html .= '

Pas de remboursement

'; + if (empty($paypal_messages)){ + $html .= '

Pas de remboursement

'; } - } - $html .=' + $html .=' @@ -1720,8 +1718,7 @@ class AdminOrders extends AdminTab
'; if (sizeof($messages)) { - foreach ($messages as $message) - { + foreach ($messages as $message) { $html.= '
'; if ($message['is_new_for_me']){ $html.= ''; diff --git a/modules/paypal/paypal.php b/modules/paypal/paypal.php index 5a7c093e..95e7b02a 100755 --- a/modules/paypal/paypal.php +++ b/modules/paypal/paypal.php @@ -725,6 +725,7 @@ class PayPal extends PaymentModule // Get product amount to refund $amount = $order->total_shipping; + $message = $this->l('Cancel shipping cost result:').'
'; if ($amount > 0){ $refund = $this->_makeRefund($paypal_order['id_transaction'], (int)$order->id, $amount); @@ -734,8 +735,12 @@ class PayPal extends PaymentModule mail('contact@bebeboutik.com', 'Erreur dans le remboursement', 'Erreur remboursement échoué pour la commande ' . $order_detail->id_order); } else { $this->refundSave($order->id, 0, $amount, $cookie->id_employee); + $message .= $this->l('Transaction error because of the amount of the shipping cost!').'
'; } } + + $this->formatMessage($refund, $message); + $this->_addNewPrivateMessage((int)$order->id, $message); } public function hookCancelProduct($params)