Permalink
Browse files

[-] MO : Bug fix #PNM-1116 : PayPal, refund fixed

  • Loading branch information...
1 parent 2a84051 commit d249de84b3392c06af7afba078f835a13246cc65 @gaillafr gaillafr committed Mar 28, 2013
@@ -220,12 +220,13 @@ function validateOrder($customer, $cart, $ppec)
{
$amount_match = $ppec->rightPaymentProcess();
$order_total = (float)$cart->getOrderTotal(true, Cart::BOTH);
-
+
// Payment succeed
if ($ppec->hasSucceedRequest() && !empty($ppec->token) && $amount_match)
{
if ((bool)Configuration::get('PAYPAL_CAPTURE'))
{
+ $payment_type = (int)Configuration::get('PS_OS_WS_PAYMENT');
$payment_status = 'Pending_capture';
$message = $ppec->l('Pending payment capture.').'<br />';
}
@@ -63,7 +63,14 @@ public function confirmOrder($custom)
{
$message = null;
$mc_gross = Tools::getValue('mc_gross');
- $total_price = Tools::ps_round($cart_details['total_price'], 2);
+
+ $cart_details = $cart->getSummaryDetails(null, true);
+
+ $shipping = $cart_details['total_shipping_tax_exc'];
+ $subtotal = $cart_details['total_price_without_tax'] - $cart_details['total_shipping_tax_exc'];
+ $tax = $cart_details['total_tax'];
+
+ $total_price = $shipping + $subtotal + $tax;
if ($mc_gross != $total_price)
{
@@ -82,7 +89,6 @@ public function confirmOrder($custom)
}
$customer = new Customer((int)$cart->id_customer);
- $id_order = (int)Order::getOrderByCartId((int)$cart->id);
$transaction = PayPalOrder::getTransactionDetails(false);
if (_PS_VERSION_ < '1.5')
@@ -20,17 +20,17 @@
<br />
- {if $opc && $isLogged && !$isGuest}
+ {if !$is_guest}
<a href="{$link->getPageLink('index', true)}" data-role="button" data-theme="a" data-icon="back" data-ajax="false">{l s='Continue shopping'}</a>
{else}
<ul data-role="listview" data-inset="true" id="list_myaccount">
<li data-theme="a" data-icon="check">
<a href="{$link->getPageLink('index', true)}" data-ajax="false">{l s='Continue shopping'}</a>
</li>
<li data-theme="b" data-icon="back">
- <a href="{if $back}{$link->getPageLink('history.php', true, NULL, 'step=1&amp;back={$back}')}{else}{$link->getPageLink('order', true, NULL, 'step=1')}{/if}" data-ajax="false">{l s='Back to orders' mod='paypal'}</a>
+ <a href="{$link->getPageLink('history.php', true, NULL, 'step=1&amp;back={$back}')}" data-ajax="false">{l s='Back to orders' mod='paypal'}</a>
</li>
</ul>
{/if}
<br />
-</div><!-- /content -->
+</div><!-- /content -->

0 comments on commit d249de8

Please sign in to comment.