Changeset 872

Show
Ignore:
Timestamp:
07/09/08 10:18:15 (2 months ago)
Author:
rach
Message:

correct currency behaviour with PAYPAL

now :
If you don't specify a currency in PAYPAL configuration (Admin)
You use the base currency if it is authorized by PAYPAL else it s USD

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/common/lib/epayment/methods/paypal.php

    r861 r872  
    6363 
    6464                $my_currency = MODULE_PAYMENT_PAYPAL_CURRENCY; 
    65                 if (!in_array($my_currency, array('CAD', 'EUR', 'GBP', 'JPY', 'USD'))) { 
     65                $base_currency = strtoupper($GLOBALS['A2B']->config['global']['base_currency']); 
     66 
     67        if($my_currency ='Selected Currency' && in_array($base_currency,array('CAD', 'EUR', 'GBP', 'JPY', 'USD')) ){ 
     68                $my_currency = $base_currency; 
     69        } 
     70        elseif (!in_array($my_currency, array('CAD', 'EUR', 'GBP', 'JPY', 'USD'))) { 
    6671                        $my_currency = 'USD'; 
    6772                } 
     
    8590    } 
    8691    function get_CurrentCurrency() 
    87     { 
     92    {     
    8893        $my_currency = MODULE_PAYMENT_PAYPAL_CURRENCY; 
    89                 if (!in_array($my_currency, array('CAD', 'EUR', 'GBP', 'JPY', 'USD'))) { 
     94        $base_currency = strtoupper($GLOBALS['A2B']->config['global']['base_currency']); 
     95        if($my_currency =='Selected Currency' && in_array($base_currency,array('CAD', 'EUR', 'GBP', 'JPY', 'USD')) ){ 
     96                $my_currency = $base_currency; 
     97        } 
     98        elseif (!in_array($my_currency, array('CAD', 'EUR', 'GBP', 'JPY', 'USD'))) { 
    9099                        $my_currency = 'USD'; 
    91100                } 


Google