diff --git a/js/customAffirmMPP.js b/js/customAffirmMPP.js
index 295010f..5706a99 100644
--- a/js/customAffirmMPP.js
+++ b/js/customAffirmMPP.js
@@ -2,94 +2,136 @@
  * @file
  * Initializes Affirm API for monthly payment promotion.
  */
- (function($) {
-    Drupal.behaviors.custom_uc_affirm_mpp = {
+
+(function ($) {
+  Drupal.behaviors.custom_uc_affirm_mpp = {
     attach: function (context, settings) {
-    var public_key = Drupal.settings.uc_affirm.public_api_key;
-    var listprice = '';
-    var month = Drupal.settings.uc_affirm.months;
-    var arp = Drupal.settings.uc_affirm.arp;
-    var _affirm_config = {
-      public_api_key: public_key, /* Use the PUBLIC API KEY Affirm sent you. */
-      script: "https://cdn1-sandbox.affirm.com/js/v2/affirm.js"
-    };
-    (function(l,g,m,e,a,f,b){var d,c=l[m]||{},h=document.createElement(f),n=document.getElementsByTagName(f)[0],k=function(a,b,c){return function(){a[b]._.push([c,arguments])}};c[e]=k(c,e,"set");d=c[e];c[a]={};c[a]._=[];d._=[];c[a][b]=k(c,a,b);a=0;for(b="set add save post open empty reset on off trigger ready setProduct".split(" ");a<b.length;a++)d[b[a]]=k(c,e,b[a]);a=0;for(b=["get","token","url","items"];a<b.length;a++)d[b[a]]=function(){};h.async=!0;h.src=g[f];n.parentNode.insertBefore(h,n);delete g[f];d(g);l[m]=c})(window,_affirm_config,"affirm","checkout","ui","script","ready");
-      if($('#affirmmpp').length){
+      var public_key = Drupal.settings.uc_affirm.public_api_key;
+      var listprice = '';
+      var month = Drupal.settings.uc_affirm.months;
+      var arp = Drupal.settings.uc_affirm.arp;
+      var _affirm_config = {
+        // Use the PUBLIC API KEY Affirm sent you.
+        public_api_key: public_key,
+        script: "https://cdn1-sandbox.affirm.com/js/v2/affirm.js"
+      };
+      (function (l, g, m, e, a, f, b) {
+        var d, c = l[m] || {}, h = document.createElement(f), n = document.getElementsByTagName(f)[0], k = function (a, b, c) {
+          return function () {
+            a[b]._.push([c, arguments])
+          };
+        };
+        c[e] = k(c, e, "set");
+        d = c[e];
+        c[a] = {};
+        c[a]._ = [];
+        d._ = [];
+        c[a][b] = k(c, a, b);
+        a = 0;
+        for (b = "set add save post open empty reset on off trigger ready setProduct".split(" "); a < b.length; a++)
+          d[b[a]] = k(c, e, b[a]);
+        a = 0;
+        for (b = ["get", "token", "url", "items"]; a < b.length; a++)
+          d[b[a]] = function () {
+          };
+        h.async = !0;
+        h.src = g[f];
+        n.parentNode.insertBefore(h, n);
+        delete g[f];
+        d(g);
+        l[m] = c
+      })(window, _affirm_config, "affirm", "checkout", "ui", "script", "ready");
+      // Change to your template value for product or cart price.
+      if ($('#affirmmpp').length) {
         listprice = $('#affirmmpp').attr('data-value');
         listprice = listprice * 100;
-        affirm.ui.ready( function() { updateAffirmAsLowAs( listprice ) } ); // change to your template value for product or cart price
+        affirm.ui.ready(function () {
+          updateAffirmAsLowAs(listprice)
+        });
       }
-      if($(document.getElementsByClassName("cls-affirmmpp").length)){
-        $('a[class="cls-affirmmpp"]').each(function(index, item){
-         $(item).attr('id','affirm_mpp_' + index);
-          affirm.ui.ready( function() {
-            // payment estimate options
+      if ($(document.getElementsByClassName("cls-affirmmpp").length)) {
+        $('a[class="cls-affirmmpp"]').each(function (index, item) {
+          $(item).attr('id', 'affirm_mpp_' + index);
+          affirm.ui.ready(function () {
+            // Payment estimate options.
             var options = {
-              apr: arp, // percentage assumed APR for loan
-              months: month, // can be 3, 6, or 12
-              amount: $(item).attr('data-value') * 100, // USD cents
+              apr: arp, // Percentage assumed APR for loan.
+              months: month, // Can be 3, 6, or 12.
+              amount: $(item).attr('data-value') * 100, // USD cents.
             };
             try {
-              typeof affirm.ui.payments.get_estimate; /* try and access the function */
+              // Try and access the function.
+              typeof affirm.ui.payments.get_estimate;
             }
             catch (e) {
-              return; /* stops this function from going any further - affirm functions are not loaded and will throw an error */
+              /* Stops this function from going any further.
+               * Affirm functions are not loaded and will throw an error. */
+              return;
             }
-            // use the payment estimate response
-            function handleEstimateResponseCSS (payment_estimate) {
-              // the payment comes back in USD cents
-              var dollars = ( ( payment_estimate.payment + 99 ) / 100 ) | 0; // get dollars, round up, and convert to int
+            // Use the payment estimate response.
+            function handleEstimateResponseCSS(payment_estimate) {
+              // The payment comes back in USD cents.
+              // Get dollars, round up, and convert to int.
+              var dollars = ((payment_estimate.payment + 99) / 100) | 0;
               // Set affirm payment text for large.
               $(item).html("Starting at $" + dollars + " a month. Learn More");
-              // open the customized Affirm learn more modal
+              // Open the customized Affirm learn more modal.
               var a = document.getElementById('affirm_mpp_' + index);
-              var iText = ('innerText' in a)? 'innerText' : 'textContent';
+              var iText = ('innerText' in a) ? 'innerText' : 'textContent';
               a[iText] = "Starting at $" + dollars + " a month. Learn More";
-              // open the customized Affirm learn more modal
+              // Open the customized Affirm learn more modal.
               a.onclick = payment_estimate.open_modal;
               a.style.visibility = "visible";
             }
-            // request a payment estimate
+            // Request a payment estimate.
             affirm.ui.payments.get_estimate(options, handleEstimateResponseCSS);
           });
         });
       }
-      function updateAffirmAsLowAs( amount ){
-        if ( ( amount == null ) || ( amount < 1000 ) ) { return; } // Only display as low as for items over $10 CHANGE FOR A DIFFERENT LIMIT
-        // payment estimate options
+      function updateAffirmAsLowAs(amount) {
+        // Only display as low as for items over $10.
+        // Change for a different limit.
+        if ((amount == null) || (amount < 1000)) {
+          return;
+        }
+        // Payment estimate options.
         var options = {
-          apr: arp, // percentage assumed APR for loan
-          months: month, // can be 3, 6, or 12
-          amount: amount // USD cents
+          apr: arp, // Percentage assumed APR for loan.
+          months: month, // Can be 3, 6, or 12.
+          amount: amount // USD cents.
         };
         try {
-          typeof affirm.ui.payments.get_estimate; /* try and access the function */
+          // Try and access the function.
+          typeof affirm.ui.payments.get_estimate;
         }
         catch (e) {
-          return; /* stops this function from going any further - affirm functions are not loaded and will throw an error */
+          /* Stops this function from going any further.
+           * Affirm functions are not loaded and will throw an error. */
+          return;
         }
-        // use the payment estimate response
-        function handleEstimateResponse (payment_estimate) {
-          // the payment comes back in USD cents
-          var dollars = ( ( payment_estimate.payment + 99 ) / 100 ) | 0; // get dollars, round up, and convert to int
+        // Use the payment estimate response.
+        function handleEstimateResponse(payment_estimate) {
+          // The payment comes back in USD cents.
+          // Get dollars, round up, and convert to int.
+          var dollars = ((payment_estimate.payment + 99) / 100) | 0;
           // Set affirm payment text for large.
           var a = document.getElementById('affirmmpp');
-          var iText = ('innerText' in a)? 'innerText' : 'textContent';
+          var iText = ('innerText' in a) ? 'innerText' : 'textContent';
           a[iText] = "Starting at $" + dollars + " a month. Learn More";
-          // open the customized Affirm learn more modal
+          // Open the customized Affirm learn more modal.
           a.onclick = payment_estimate.open_modal;
           a.style.visibility = "visible";
-        };
-        // request a payment estimate
+        }
+        // Request a payment estimate.
         affirm.ui.payments.get_estimate(options, handleEstimateResponse);
       }
       // For handling dynamic variant product price.
-      $('#dynamic-affirmmpp').bind('DOMNodeInserted', function(event) {
+      $('#dynamic-affirmmpp').bind('DOMNodeInserted', function (event) {
         if (event.type == 'DOMNodeInserted') {
           var x = this.innerHTML;
           x = parseInt(x);
           x = x * 100;
-          updateAffirmAsLowAs( x );
+          updateAffirmAsLowAs(x);
         }
       });
     }
diff --git a/js/uc_affirm.js b/js/uc_affirm.js
index 50e2c29..d63e37d 100644
--- a/js/uc_affirm.js
+++ b/js/uc_affirm.js
@@ -1,7 +1,8 @@
 /**
  * @file
- * Initializes Affirm API
+ * Initializes Affirm API.
  */
+
 (function ($) {
   Drupal.behaviors.uc_affirm_checkout = {
     attach: function (context, settings) {
@@ -76,9 +77,8 @@
                 "state": settings.ShippingAddressState,
                 "zipcode": settings.ShippingAddressPostCode
               },
-              "phone_number": '9253236612',
               "phone_number": settings.ShippingTelephone,
-                  "email": settings.Email,
+              "email": settings.Email,
             },
             "billing": {
               "name": {
diff --git a/uc_affirm.info b/uc_affirm.info
index bd7e696..4d99fd3 100644
--- a/uc_affirm.info
+++ b/uc_affirm.info
@@ -1,6 +1,5 @@
 name = Ubercart Affirm
-description = Provides Integration with the Affirm Payment Gateway (http://www.affirm.com) and Drupal Ubercart
-core = 7.x
+description = Provides integration with the Affirm Payment Gateway (http://www.affirm.com) and Drupal Ubercart.
 dependencies[] = uc_payment
 package = Ubercart - payment
 version = "7.x-1.0"
diff --git a/uc_affirm.install b/uc_affirm.install
index e91a6e0..dfec074 100644
--- a/uc_affirm.install
+++ b/uc_affirm.install
@@ -3,13 +3,10 @@
 /**
  * @file
  * Install, update and uninstall hooks for the uc_affirm module.
- *
  */
 
 /**
  * Implements hook_schema().
- *
- * Primarily for the recording transaction details.
  */
 function uc_affirm_schema() {
   $schema = array();
@@ -84,7 +81,6 @@ function uc_affirm_schema() {
       'received_time' => array(
         'description' => 'Affirm receipt timestamp.',
         'type' => 'int',
-        //'unsigned' => TRUE,
         'not null' => TRUE,
         'default' => 0,
       ),
diff --git a/uc_affirm.module b/uc_affirm.module
index bb05c64..0a0aded 100644
--- a/uc_affirm.module
+++ b/uc_affirm.module
@@ -2,36 +2,39 @@
 
 /**
  * @file
- * Integrates Affirm payment services and Transaction Details
- * with Ubercart!
+ * Integrates Affirm payment services and Transaction Details with Ubercart.
+ */
+
+/*
  * @TODO
- * show the affirm checkout option only if the user is from US.
+ * Show the affirm checkout option only if the user is from US.
  */
-/** Affirm live. */
+
+/* Affirm live. */
 define('UC_AFFIRM_TXN_MODE_LIVE', 'live');
 
-/** Affirm sandbox . */
+/* Affirm sandbox . */
 define('UC_AFFIRM_TXN_MODE_TEST', 'sandbox');
 
-/** Just authorize a buyer details. */
+/* Just authorize a buyer details. */
 define('UC_AFFIRM_AUTH_ONLY', 'Authorization');
 
-/** Just Capture the amount. */
+/* Just Capture the amount. */
 define('UC_AFFIRM_CAPTURE_ONLY', 'Capture');
 
-/** Authorize the buyer and Capture the amount. */
+/* Authorize the buyer and Capture the amount. */
 define('UC_AFFIRM_AUTH_CAPTURE', 'Authorization and Capture');
 
-/** Void/Cancel the transaction. */
+/* Void/Cancel the transaction. */
 define('UC_AFFIRM_VOID', 'void');
 
-/** Refund the transaction amount. */
+/* Refund the transaction amount. */
 define('UC_AFFIRM_REFUND', 'refund');
 
-/** Payment received status. */
+/* Payment received status. */
 define('ORDER_STATUS_PAYMENT_RECEIVED', 'payment_received');
 
-/** Transaction authorized status. */
+/* Transaction authorized status. */
 define('ORDER_STATUS_AUTHORIZED', 'order_under_review');
 
 /**
@@ -115,7 +118,8 @@ function uc_affirm_uc_payment_method() {
 }
 
 /**
- * Affirm Checkout form
+ * Affirm Checkout form.
+ *
  * Payment method callback: redirect form.
  *
  * Returns form elements that should be submitted to the redirected
@@ -124,8 +128,8 @@ function uc_affirm_uc_payment_method() {
  * Sending the amounts in cent, not in dollers.
  * For that multiply the doller amount with 100.
  *
- * FinancialProductKey: Each merchant will have a financial_product_key that identifies
- * their configuration of a financial product.
+ * FinancialProductKey: Each merchant will have a financial_product_key that
+ * identifies their configuration of a financial product.
  */
 function uc_affirm_form($form, &$form_state) {
   $order_id = intval($_SESSION['cart_order']);
@@ -145,7 +149,8 @@ function uc_affirm_form($form, &$form_state) {
     '#type' => 'button',
     '#value' => t('Proceed with payment'),
     '#attributes' => array(
-      'class' => array('affirm-confirmation-button'),),
+      'class' => array('affirm-confirmation-button'),
+    ),
   );
   $affirm_module_info = system_get_info('module', 'uc_affirm');
   if ($affirm_module_info['version'] == '') {
@@ -214,7 +219,7 @@ function uc_affirm_form($form, &$form_state) {
   }
   $data['discounts'][] = array(
     "discount_amount" => '',
-    "discount_display_name" => "tets discount"
+    "discount_display_name" => "tets discount",
   );
   // Pass checkout settings through to front-end.
   drupal_add_js(array('uc_affirm' => $data), 'setting');
@@ -226,23 +231,23 @@ function uc_affirm_form($form, &$form_state) {
 /**
  * Function for getting the state code.
  *
- * @param Ineger $id
- * The state id selected from drop box.
+ * @param int $id
+ *   The state id selected from drop box.
  *
  * @return string
- * State code against the state id.
+ *   State code against the state id.
  */
 function get_zone_code_get_by_id($id) {
   $zone_id = db_query("SELECT zone_code FROM {uc_zones} WHERE zone_id = :id", array(':id' => $id))->fetchField();
-  if($zone_id == 'AF') {
+  if ($zone_id == 'AF') {
     $zone_id = 'AE';
     return $zone_id;
   }
-  elseif($zone_id == 'AC') {
+  elseif ($zone_id == 'AC') {
     $zone_id = 'AE';
     return $zone_id;
   }
-  elseif($zone_id == 'AM') {
+  elseif ($zone_id == 'AM') {
     $zone_id = 'AE';
     return $zone_id;
   }
@@ -257,7 +262,7 @@ function get_zone_code_get_by_id($id) {
 function uc_payment_method_affirm($op, &$arg1) {
   switch ($op) {
     case 'settings':
-      // Product key
+      // Product key.
       $form['uc_affirm_financial_product_key'] = array(
         '#type' => 'textfield',
         '#title' => t('Financial product key'),
@@ -270,7 +275,7 @@ function uc_payment_method_affirm($op, &$arg1) {
         '#title' => t('Public API key'),
         '#default_value' => variable_get('public_api_key', ''),
       );
-      // Private key
+      // Private key.
       $form['private_api_key'] = array(
         '#type' => 'textfield',
         '#title' => t('Private API key:'),
@@ -341,12 +346,10 @@ function uc_affirm_form_uc_cart_checkout_review_form_alter(&$form, &$form_state,
  *
  * @param string $txn_type
  *   The transaction type (Authorization/Capture/Refund/Void).
- * @param array $payment_method
- *   The payment method instance array associated with this API request.
  * @param object $order
  *   The order object the payment request is being submitted for.
- * @param object|null $transaction
- *   The payment transaction object requested.
+ * @param array $charge_id
+ *   The payment method instance array associated with this API request.
  * @param array $data
  *   Data to send to Affirm.
  *
@@ -373,7 +376,6 @@ function uc_affirm_api_request($txn_type, $order, $charge_id = NULL, $data = arr
 
   // Get the API endpoint URL for the method's transaction mode.
   $url = uc_affirm_api_server_url($txn_mode, $txn_type, $charge_id);
-  // echo '<pre>'; print_r($options); exit;
   $ch = curl_init($url);
   curl_setopt_array($ch, $options);
   $response = curl_exec($ch);
@@ -381,7 +383,12 @@ function uc_affirm_api_request($txn_type, $order, $charge_id = NULL, $data = arr
 
   if (($result = drupal_json_decode($response)) && (is_array($result))) {
     if (isset($result['status_code'])) {
-      watchdog('Affirm response data', "!message<br/>Transaction type: !txn_type<br/><br/>The request returned from Affirm with the following data: !data<br/>The request concerned the following order: !order", array(
+      watchdog(
+          'Affirm response data',
+          "!message<br/>Transaction type: !txn_type<br/><br/>"
+          . "The request returned from Affirm with the following data:"
+          . " !data<br/>The request concerned the following order:"
+          . " !order", array(
         '!message' => $result['message'],
         '!txn_type' => $txn_type,
         '!data' => '<pre>' . check_plain(print_r($result, TRUE)) . '</pre>',
@@ -406,9 +413,8 @@ function uc_affirm_api_request($txn_type, $order, $charge_id = NULL, $data = arr
  *   The transaction mode that relates to the production or test server.
  * @param string $txn_type
  *   The transaction type (Authorization/Capture/Refund/Void).
- * @param object|null $transaction
- *   The payment transaction object to be captured. The object is required if
- *   you want to do something else than an authorization.
+ * @param array $charge_id
+ *   The payment method instance array associated with this API request.
  *
  * @return string|bool
  *   The URL to use to submit requests to the Affirm server.
@@ -465,10 +471,13 @@ function uc_affirm_server_url($txn_mode) {
   return FALSE;
 }
 
+/**
+ * Implements hook_uc_order_actions().
+ */
 function uc_affirm_uc_order_actions($order) {
   $actions = array();
   if (user_access('fulfill orders')) {
-    // response is caputured added the refund option to the options.
+    // Response is captured added the refund option to the options.
     $refund_data = db_query("SELECT * FROM {uc_affirm} WHERE order_id = :id", array(':id' => $order->order_id))->fetchObject();
     $default_amount = $order->order_total - $refund_data->refund_amount;
     if ($default_amount > 0) {
@@ -482,7 +491,7 @@ function uc_affirm_uc_order_actions($order) {
         );
       }
     }
-    // response is autherized added the capture and refund option.
+    // Response is autherized added the capture and refund option.
     if ($order->order_status == ORDER_STATUS_AUTHORIZED && $order->payment_method == "affirm") {
       $title = t('Void order !order_id.', array('!order_id' => $order->order_id));
       // Void option.
@@ -506,20 +515,14 @@ function uc_affirm_uc_order_actions($order) {
 }
 
 /**
- * This function for mothly payment promotion link for all pages.
- * <a id="affirmmpp" href="#" data-value="{Amount}" ></a>
- * The data value keep the amount.
- * <div style="display:none;" id="dynamic-affirmmpp" ></div>
- * The id dynamic-affirmmpp innerHTML for dynamic value only pass number.
- * Also use this in case of multiple link is needed in the same case.
- * <a class="cls-affirmmpp" href="#" data-value="{Amount}" ></a>
+ * Implements hook_init().
  */
-function uc_affirm_init(){
-    $settings = array(
-     'public_api_key' => variable_get('public_api_key'),
-     'months' => 12, // can be 3, 6, or 12
-     'arp' =>  "0.10", // percentage assumed APR for loan
-    );
-    drupal_add_js(array('uc_affirm' => $settings), 'setting');
-    drupal_add_js(drupal_get_path('module', 'uc_affirm') . '/js/customAffirmMPP.js');
+function uc_affirm_init() {
+  $settings = array(
+    'public_api_key' => variable_get('public_api_key'),
+    'months' => 12, /* Can be 3, 6, or 12 */
+    'arp' => "0.10", /* Percentage assumed APR for loan. */
+  );
+  drupal_add_js(array('uc_affirm' => $settings), 'setting');
+  drupal_add_js(drupal_get_path('module', 'uc_affirm') . '/js/customAffirmMPP.js');
 }
diff --git a/uc_affirm.pages.inc b/uc_affirm.pages.inc
index a882a02..a4848d9 100644
--- a/uc_affirm.pages.inc
+++ b/uc_affirm.pages.inc
@@ -42,8 +42,9 @@ function uc_affirm_authentication() {
 
 /**
  * Page callback for Affirm void.
+ *
  * @param string $charge_id
- * The payment transaction returned id.
+ *   The payment transaction returned id.
  */
 function uc_affirm_void($charge_id = NULL) {
   $response = uc_affirm_api_request(UC_AFFIRM_VOID, $order = array(), $charge_id, $data = array());
@@ -60,8 +61,9 @@ function uc_affirm_void($charge_id = NULL) {
 
 /**
  * Page callback to handle a complete Affirm Payment sale.
- * @param integer $order_id
- *  Unique id for a order.
+ *
+ * @param int $order_id
+ *   Unique id for a order.
  */
 function uc_affirm_complete($order_id = 0) {
   watchdog('Order Complete', "!message<br/>Transaction type: !txn_type<br/><br/>", array(
@@ -86,8 +88,6 @@ function uc_affirm_complete($order_id = 0) {
  *
  * @param object $order
  *   The loaded order that is being processed.
- * @param array $payment_method
- *   The payment method settings.
  * @param array $data
  *   Data to send to Affirm.
  *
@@ -107,7 +107,7 @@ function uc_affirm_process_transaction($order, $data) {
     drupal_set_message(t('Your cart is emplty. please feel free to continue your purchasing!'), 'error');
     drupal_goto('cart');
   }
-  /**
+  /*
    * In case the payment method is configured for Auth & Capture, the capture
    * request is triggered right after the authorization.
    */
@@ -166,23 +166,24 @@ function uc_affirm_process_transaction($order, $data) {
 
 /**
  * Custom function to log transaction details.
- * @param integer $order_id
- *  Unique id for a order.
- * @param string $charge_id
- * The payment transaction returned id.
+ *
+ * @param int $order_id
+ *   Unique id for a order.
  * @param float $amount
- * The order total amount.
- * @param varchar $payment_status
- * The transaction status, that returned from affirm.
- * @param $buyer_email
- * The email address of the buyer.
- * @param $authentication_trans_id
- *  The transaction id, that returned from affirm.
+ *   The order total amount.
+ * @param string $payment_status
+ *   The transaction status, that returned from affirm.
+ * @param string $buyer_email
+ *   The email address of the buyer.
+ * @param int $authentication_trans_id
+ *   The transaction id, that returned from affirm.
+ * @param string $charge_id
+ *   The payment transaction returned id.
  *
  * @return bool
  *   Returns TRUE if the transaction was successful. FALSE if it was not.
  */
-function uc_affirm_transaction_save($order_id, $charge_id = NULL, $amount, $payment_status, $buyer_email, $authentication_trans_id) {
+function uc_affirm_transaction_save($order_id, $amount, $payment_status, $buyer_email, $authentication_trans_id, $charge_id = NULL) {
   db_insert('uc_affirm')
       ->fields(array(
         'order_id' => $order_id,
@@ -194,17 +195,17 @@ function uc_affirm_transaction_save($order_id, $charge_id = NULL, $amount, $paym
         'authentication_trans_id' => $authentication_trans_id,
       ))
       ->execute();
-  return;
+  return TRUE;
 }
 
 /**
  * Function for getting charge id against the order id.
  *
- * @param integer $order_id
- * The unique id for an order.
+ * @param int $order_id
+ *   The unique id for an order.
  *
  * @return string
- *  Returns the charg id against the given order id.
+ *   Returns the charge id against the given order id.
  */
 function _get_uc_affirm_charge_id($order_id) {
   $result = db_select('uc_affirm', 'n')
@@ -219,7 +220,7 @@ function _get_uc_affirm_charge_id($order_id) {
  * Form callback: allows the user to void/cancel a transaction.
  */
 function uc_affirm_void_form($form, &$form_state, $order_id = NULL) {
-  // get charge_id form order id
+  // Get charge_id form order id.
   $charge_id = _get_uc_affirm_charge_id($order_id);
   $form_state['order'] = $order_id;
   $form['markup'] = array(
@@ -246,7 +247,7 @@ function uc_affirm_void_form_submit($form, &$form_state) {
       drupal_set_message(t('Void failed'), 'error');
     }
     else {
-      // update status on uc_order table.
+      // Update status on uc_order table.
       uc_afffirm_transaction_updates($order_id, $response, $status = 'canceled', $field = 'void_trans_id');
       uc_order_comment_save($order_id, 0, t('The order canceled.'), 'order', $status = 'canceled');
       drupal_set_message(t('Transaction successfully voided.'));
@@ -358,7 +359,7 @@ function uc_affirm_refund_form_submit($form, &$form_state) {
       $refund_data = db_query("SELECT * FROM {uc_affirm} WHERE order_id = :id", array(':id' => $order_id))->fetchObject();
       // Caluculating the refund amount.
       $refund_amount = $refund_data->refund_amount + $refund_amount;
-      // update status on uc_order table.
+      // Update status on uc_order table.
       uc_afffirm_transaction_updates($order_id, $response, $status = 'chargeback', $field = 'refund_trans_id', $refund_amount);
       // Save the comment.
       uc_order_comment_save($order_id, 0, t('Refund of @amount @currency submitted through Affirm.', array('@amount' => $refund_amount, '@currency' => 'USD')), 'order', 'chargeback');
@@ -434,7 +435,7 @@ function uc_affirm_capture_form_submit($form, &$form_state, $order_id) {
 /**
  * Function to handle the updations in the order table and uc_affirm table.
  *
- * @param integer $order_id
+ * @param int $order_id
  *   Unique id for a order.
  * @param array $response
  *   The the response data from affirm.
@@ -474,21 +475,19 @@ function uc_afffirm_transaction_updates($order_id, $response, $status, $field, $
   // transaction such as sending an email to customer,
   // setting database status, informing logistics etc.
   $comment = t('Affrim @transaction_id id', array('@transaction_id' => $response['transaction_id']));
-  if (($field == capture_trans_id ) || ($field == refund_trans_id)) {
+  if (($field == capture_trans_id) || ($field == refund_trans_id)) {
     if ($field == refund_trans_id) {
       $order->order_total = '-' . $response['amount'];
     }
     uc_payment_enter($order_id, 'Affirm', $order->order_total, $order->uid, NULL, $comment);
   }
   uc_cart_complete_sale($order);
-  return;
+  return TRUE;
 }
 
-/*
- * @TODO
+/**
  * Track each response code and show proper messages against them.
- * */
-
+ */
 function get_affirm_status($response_code = NULL) {
   drupal_set_message(t('Transaction failed, Please try agin !!'), 'error');
   drupal_goto('cart');
