diff --git a/uc_affirm.install b/uc_affirm.install
index dfec074..62047f3 100644
--- a/uc_affirm.install
+++ b/uc_affirm.install
@@ -98,14 +98,41 @@ function uc_affirm_schema() {
  */
 function uc_affirm_install() {
   db_insert('uc_order_statuses')
-      ->fields(array(
-        'order_status_id' => 'uc_affirm_received_amount',
-        'title' => 'Affrim Captured',
-        'state' => 'payment_received',
-        'weight' => 7,
-        'locked' => 1,
-      ))
-      ->execute();
+    ->fields(array(
+      'order_status_id' => 'uc_affirm_received_amount',
+      'title' => 'Affrim Captured',
+      'state' => 'payment_received',
+      'weight' => 7,
+      'locked' => 1,
+    ))
+    ->execute();
+  db_insert('uc_order_statuses')
+    ->fields(array(
+      'order_status_id' => 'chargeback',
+      'title' => 'Chargeback',
+      'state' => 'post_checkout',
+      'weight' => 0,
+      'locked' => 0,
+    ))
+    ->execute();
+  db_insert('uc_order_statuses')
+    ->fields(array(
+      'order_status_id' => 'affirm_authorized',
+      'title' => 'Affrim Authorized',
+      'state' => 'authorized',
+      'weight' => 0,
+      'locked' => 0,
+    ))
+    ->execute();
+  db_insert('uc_order_statuses')
+    ->fields(array(
+      'order_status_id' => 'order_under_review',
+      'title' => 'Order under Review',
+      'state' => 'payment_received',
+      'weight' => 0,
+      'locked' => 0,
+    ))
+    ->execute();
 }
 
 /**
@@ -113,12 +140,48 @@ function uc_affirm_install() {
  */
 function uc_affirm_uninstall() {
   db_delete('variable')
-      ->condition(db_or()
-          ->condition('name', 'uc_affirm_%%', 'LIKE'))
-      ->execute();
-
+    ->condition(db_or()
+        ->condition('name', 'uc_affirm_%%', 'LIKE'))
+    ->execute();
+  $db_or = db_or();
+  $db_or->condition('order_status_id', 'uc_affirm_received_amount', '=');
+  $db_or->condition('order_status_id', 'chargeback', '=');
+  $db_or->condition('order_status_id', 'affirm_authorized', '=');
+  $db_or->condition('order_status_id', 'order_under_review', '=');
   db_delete('uc_order_statuses')
-      ->condition(db_or()
-          ->condition('order_status_id', 'uc_affirm_received_amount', '='))
-      ->execute();
+    ->condition($db_or)
+    ->execute();
+}
+
+/**
+ * Implements hook_update_N().
+ */
+function uc_affirm_update_7000() {
+  db_insert('uc_order_statuses')
+    ->fields(array(
+      'order_status_id' => 'chargeback',
+      'title' => 'Chargeback',
+      'state' => 'post_checkout',
+      'weight' => 0,
+      'locked' => 0,
+    ))
+    ->execute();
+  db_insert('uc_order_statuses')
+    ->fields(array(
+      'order_status_id' => 'affirm_authorized',
+      'title' => 'Affrim Authorized',
+      'state' => 'authorized',
+      'weight' => 0,
+      'locked' => 0,
+    ))
+    ->execute();
+  db_insert('uc_order_statuses')
+    ->fields(array(
+      'order_status_id' => 'order_under_review',
+      'title' => 'Order under Review',
+      'state' => 'payment_received',
+      'weight' => 0,
+      'locked' => 0,
+    ))
+    ->execute();
 }
diff --git a/uc_affirm.module b/uc_affirm.module
index fffad13..5c3c964 100644
--- a/uc_affirm.module
+++ b/uc_affirm.module
@@ -31,6 +31,9 @@ define('UC_AFFIRM_VOID', 'void');
 /* Refund the transaction amount. */
 define('UC_AFFIRM_REFUND', 'refund');
 
+/* Refund ubercart status. */
+define('UC_AFFIRM_REFUND_STATUS', 'chargeback');
+
 /* Payment received status. */
 define('UC_AFFIRM_ORDER_STATUS_PAYMENT_RECEIVED', 'payment_received');
 
@@ -402,27 +405,22 @@ 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',
-        '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>',
-          '!order' => '<pre>' . check_plain(print_r($order, TRUE)) . '</pre>',
-        ),
-         WATCHDOG_ERROR
-      );
+          '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>',
+            '!order' => '<pre>' . check_plain(print_r($order, TRUE)) . '</pre>',
+          ), WATCHDOG_ERROR);
     }
     else {
-      watchdog(
-        'Affirm response data',
-        '!function Response:!data',
-        array(
-          '!function' => __FUNCTION__,
-          '!data' => '<pre>' . print_r(drupal_json_decode($response), TRUE) . '</pre>',
-        ),
-        WATCHDOG_WARNING
-      );
+      watchdog('Affirm response data', '!function Response:!data', array(
+        '!function' => __FUNCTION__,
+        '!data' => '<pre>' . print_r(drupal_json_decode($response), TRUE) . '</pre>',
+        ), WATCHDOG_WARNING);
     }
     return $result;
   }
@@ -504,7 +502,7 @@ function uc_affirm_uc_order_actions($order) {
     $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) {
-      if ($order->order_status == UC_AFFIRM_ORDER_STATUS_PAYMENT_RECEIVED && $order->payment_method == "affirm") {
+      if ($order->order_status == UC_AFFIRM_REFUND_STATUS || $order->order_status == UC_AFFIRM_ORDER_STATUS_PAYMENT_RECEIVED && $order->payment_method == "affirm") {
         $title = t('Refund !order_id.', array('!order_id' => $order->order_id));
         $actions[] = array(
           'name' => t('Refund'),
