commit 166f37b2a61f3ac2e32261fd57c7be83908c2bcc
Author: Randy Fay <randy@randyfay.com>
Date:   Mon Nov 9 11:08:21 2015 -0700

    Allow zero-decimal currencies per Issue #2580025

diff --git a/uc_stripe.module b/uc_stripe.module
index a754141..011ff8c 100644
--- a/uc_stripe.module
+++ b/uc_stripe.module
@@ -287,6 +287,17 @@ function uc_stripe_settings_form() {
     '#description' => t('Your Live Stripe API Key. Must be the "publishable" key, not the "secret" one.'),
   );
 
+  $form['uc_stripe_settings']['uc_stripe_currency_multiplier'] = array(
+    '#type' => 'select',
+    '#title' => t('Currency Multiplier'),
+    '#options' => array(
+      100 => 100,
+      1 => 1,
+    ),
+    '#description' => t('Stripe charges are denominated in the smallest currency unit - for example "cents" for US Dollars, so the currency multiplier for a currency like USD is 100. However, zero-decimal currencies will require this to be set to 1. Use the default of 100 unless charging in a zero-decimal currency.'),
+    '#default_value' => variable_get('uc_stripe_currency_multiplier', 100),
+  );
+
   $form['uc_stripe_settings']['uc_stripe_testmode'] = array(
     '#type' => 'checkbox',
     '#title' => t('Test mode'),
@@ -297,7 +308,7 @@ function uc_stripe_settings_form() {
   $form['uc_stripe_settings']['uc_stripe_poweredby'] = array(
     '#type' => 'checkbox',
     '#title' => t('Powered by Stripe'),
-    '#description' => 'Show "powered by Stripe" in shopping cart.',
+    '#description' => t('Show "powered by Stripe" in shopping cart.'),
     '#default_value' => variable_get('uc_stripe_poweredby', FALSE),
   );
 
@@ -410,8 +421,10 @@ function uc_stripe_charge($order_id, $amount, $data) {
     'prec' => 2,
   );
 
-  // Format the amount in cents, which is what Stripe wants
-  $amount = uc_currency_format($amount, FALSE, FALSE, FALSE);
+  // Stripe wants charges to be
+  // "A positive integer in the smallest currency unit (e.g 100 cents to charge $1.00, or 1 to charge ¥1, a 0-decimal currency)"
+  // Zero-decimal currencies will use a multiplier of 1
+  $amount = $amount * variable_get('uc_stripe_currency_multiplier', 100);
 
   $stripe_customer_id = FALSE;
 
@@ -502,7 +515,7 @@ function uc_stripe_charge($order_id, $amount, $data) {
       )
     );
 
-    $formatted_amount = $amount / 100;
+    $formatted_amount = $amount / variable_get('uc_stripe_currency_multiplier', 100);
     $formatted_amount = number_format($formatted_amount, 2);
 
     $result = array(
@@ -578,7 +591,7 @@ function uc_stripe_renew($order, &$fee) {
 
     //Create the charge
     $amount = $fee->fee_amount;
-    $amount = $amount * 100;
+    $amount = $amount * variable_get('uc_stripe_currency_multiplier', 100);
 
     $charge = \Stripe\Charge::create(array(
         "amount" => $amount,
