--- uc_paypal.module	2010-03-04 11:01:20.000000000 +0100
+++ uc_paypal.module.new	2010-03-04 11:00:50.000000000 +0100
@@ -303,7 +303,7 @@ function uc_paypal_wpp_charge($order_id,
       'METHOD' => 'DoCapture',
       'AUTHORIZATIONID' => $data['auth_id'],
       'AMT' => uc_price($amount, $context, $options),
-      'CURRENCYCODE' => variable_get('uc_paypal_wpp_currency', 'USD'),
+	  'CURRENCYCODE' => !empty($order->data["uc_cck_currency"]["code"]) ? $order->data["uc_cck_currency"]["code"] : variable_get('uc_paypal_wps_currency', 'USD'),
       'COMPLETETYPE' => 'Complete',
     );
   }
@@ -370,8 +370,8 @@ function uc_paypal_wpp_charge($order_id,
       'CITY' => substr($order->billing_city, 0, 40),
       'STATE' => uc_get_zone_code($order->billing_zone),
       'ZIP' => $order->billing_postal_code,
-      'COUNTRYCODE' => $billing_country[0]['country_iso_code_2'],
-      'CURRENCYCODE' => variable_get('uc_paypal_wpp_currency', 'USD'),
+	  'COUNTRYCODE' => $billing_country[0]['country_iso_code_2'],
+	  'CURRENCYCODE' => !empty($order->data["uc_cck_currency"]["code"]) ? $order->data["uc_cck_currency"]["code"] : variable_get('uc_paypal_wps_currency', 'USD'),
       'DESC' => substr($desc, 0, 127),
       'INVNUM' => $order_id .'-'. time(),
       'BUTTONSOURCE' => 'Ubercart_ShoppingCart_DP_US',
@@ -662,7 +662,7 @@ function uc_paypal_ec_checkout($form, &$
     'RETURNURL' => url('cart/echeckout/selected', array('absolute' => TRUE)),
     'CANCELURL' => url('uc_paypal/wps/cancel', array('absolute' => TRUE)),
     'AMT' => uc_price($order->order_total, $context, $options),
-    'CURRENCYCODE' => variable_get('uc_paypal_wpp_currency', 'USD'),
+    'CURRENCYCODE' => !empty($order->data["uc_cck_currency"]["code"]) ? $order->data["uc_cck_currency"]["code"] : variable_get('uc_paypal_wps_currency', 'USD'),
     'PAYMENTACTION' => variable_get('uc_paypal_wpp_payment_action', 'Sale'),
     'DESC' => substr($desc, 0, 127),
     'INVNUM' => $order->order_id .'-'. time(),
@@ -751,7 +751,7 @@ function uc_paypal_ec_form_submit($form,
     'RETURNURL' => url('cart/echeckout/review', array('absolute' => TRUE)),
     'CANCELURL' => url('uc_paypal/wps/cancel', array('absolute' => TRUE)),
     'AMT' => uc_price($subtotal, $context, $options),
-    'CURRENCYCODE' => variable_get('uc_paypal_wpp_currency', 'USD'),
+    'CURRENCYCODE' => !empty($order->data["uc_cck_currency"]["code"]) ? $order->data["uc_cck_currency"]["code"] : variable_get('uc_paypal_wps_currency', 'USD'),
     'PAYMENTACTION' => variable_get('uc_paypal_wpp_payment_action', 'Sale'),
     'DESC' => substr($desc, 0, 127),
     'INVNUM' => $order->order_id .'-'. time(),
@@ -830,7 +830,7 @@ function uc_paypal_ec_submit_form_submit
     'ITEMAMT' => uc_price($subtotal, $context, $options),
     'SHIPPINGAMT' => uc_price($shipping, $context, $options),
     'TAXAMT' => uc_price($tax, $context, $options),
-    'CURRENCYCODE' => variable_get('uc_paypal_wpp_currency', 'USD'),
+    'CURRENCYCODE' => !empty($order->data["uc_cck_currency"]["code"]) ? $order->data["uc_cck_currency"]["code"] : variable_get('uc_paypal_wps_currency', 'USD'),
   );
 
   $nvp_response = uc_paypal_api_request($nvp_request, variable_get('uc_paypal_wpp_server', 'https://api-3t.sandbox.paypal.com/nvp'));
@@ -913,7 +913,7 @@ function uc_paypal_wps_form($form_state,
     'rm' => 2,
 
     // Transaction information
-    'currency_code' => variable_get('uc_paypal_wps_currency', 'USD'),
+	'currency_code' => !empty($order->data["uc_cck_currency"]["code"]) ? $order->data["uc_cck_currency"]["code"] : variable_get('uc_paypal_wps_currency', 'USD'),
     'handling_cart' => uc_price($shipping, $context, $options),
     'invoice' => $order->order_id .'-'. time(),
     'tax_cart' => uc_price($tax, $context, $options),
