diff --git a/uc_affirm.test b/uc_affirm.test
new file mode 100644
index 0000000..6d359f4
--- /dev/null
+++ b/uc_affirm.test
@@ -0,0 +1,157 @@
+<?php
+/**
+ * @file
+ * Tests for the uc affirm module.
+ */
+class UcaffirmTests extends UbercartTestHelper {
+  
+  /**
+   * API configuration variable decleared.
+   */
+  protected static $affirm_api = array(
+    '09940H60SCVYYBHC',
+    'SXAYAIHD7GHJBYNH',
+    '1EataEatncbhTckM1fZpaIYBI3uGAQf7',
+    'sandbox',
+    'Authorization and Capture',
+  );
+  
+  /**
+   * Metadata about our test case.
+   */
+  public static function getInfo() {
+    return array(
+      // The human readable name of the test case.
+      'name' => 'UC Affirm Core Functionality Test',
+      // A short description of the tests this case performs.
+      'description' => 'Test for the ubercart affirm module.',
+      // The group that this case belongs too, used for grouping tests together
+      // in the UI.
+      'group' => 'Uc Affirm',
+    );
+  }
+  
+  /**
+   * Perform any setup tasks for our test case.
+   */
+  public function setUp($modules = array(), $permissions = array()) {
+    $modules += array('uc_payment', 'uc_affirm');
+    $permissions = array('administer affirm', 'process affirm');
+    parent::setUp($modules, $permissions);
+    
+    // Need admin permissions in order to change affirm settings.
+    $this->drupalLogin($this->adminUser);
+
+    // Configure and enable affirm module.
+    $this->configureAffirm();
+    
+  }
+  
+  /**
+   * Tests that an order can be placed using method affirm.
+   */
+  public function testCheckout() {
+    $order = $this->createOrder(array('payment_method' => 'affirm'));
+    $this->drupalPost('node/' . $this->product->nid, array(), t('Add to cart'));
+    $this->checkout(array(
+      'panes[customer][primary_email]' =>  'abc@example.com',
+      'panes[delivery][delivery_first_name]' => $this->randomString(),
+      'panes[delivery][delivery_last_name]' => $this->randomString(),
+      'panes[delivery][delivery_street1]' => '795 E DRAGRAM',
+      'panes[delivery][delivery_city]' => 'TUCSON',
+      'panes[delivery][delivery_zone]' => '5',
+      'panes[delivery][delivery_country]' => '840',
+      'panes[delivery][delivery_postal_code]' => '85705',
+      'panes[delivery][delivery_phone]' => '9895123456',
+      'panes[billing][copy_address]' => TRUE,
+    ));
+    $this->assertText('Your order is almost complete.', 'Review Order page found' );
+  }
+  
+  /**
+   * Helper function. Creates a new order.
+   */
+   protected function createOrder($fields = array()) {
+     $order = uc_order_new();
+     foreach ($fields as $key => $value) {
+       $order->$key = $value;
+     }
+ 
+     if (empty($order->primary_email)) {
+       $order->primary_email = $this->randomString() . '@example.org';
+     }
+
+     if (!isset($fields['products'])) {
+       $item = clone $this->product;
+       $item->qty = 1;
+       $item->price = $item->sell_price;
+       $item->data = array();
+       $order->products = array($item);
+     }
+
+     $order->order_total = uc_order_get_total($order, TRUE);
+     $order->line_items = uc_order_load_line_items($order, TRUE);
+     uc_order_save($order);
+     return $order;
+   }
+   
+  /**
+   * Configure the payment method as affirm.
+   */
+  public function configureAffirm() {
+    
+    $this->drupalPost(
+      'admin/store/settings/payment',
+      array('uc_payment_method_affirm_checkout' => TRUE),
+      t('Save configuration')
+    );
+    $this->assertFieldByName(
+      'uc_payment_method_affirm_checkout',
+      TRUE,
+      t('Affirm payment method is enabled')
+    );
+    
+   $this->drupalPost(
+      'admin/store/settings/payment/method/affirm',
+      array(
+        'uc_affirm_financial_product_key' => self::$affirm_api[0],
+        'public_api_key' => self::$affirm_api[1],
+        'private_api_key' => self::$affirm_api[2],
+        'uc_affirm_server' => self::$affirm_api[3],
+        'uc_affirm_txn_type' => self::$affirm_api[4],
+      ),
+      t('Save configuration')
+    );
+   
+    $this->assertFieldByName(
+      'uc_affirm_financial_product_key',
+      self::$affirm_api[0],
+      t('Affirm financial product key has been set.')
+    );
+    
+    $this->assertFieldByName(
+      'public_api_key',
+      self::$affirm_api[1],
+      t('Affirm public api key has been set.')
+    );
+    
+    $this->assertFieldByName(
+      'private_api_key',
+      self::$affirm_api[2],
+      t('Affirm private api key has been set.')
+    );
+    
+    $this->assertFieldByName(
+      'uc_affirm_server',
+      self::$affirm_api[3],
+      t('Affirm server has been set.')
+    );
+    
+    $this->assertFieldChecked(
+      'edit-uc-affirm-txn-type-authorization-and-capture',
+      self::$affirm_api[4],
+      t('Affirm transaction type has been set.')
+    );
+    
+   }
+}
