diff --git a/webform_paypal.module b/webform_paypal.module
index 6babe99..d68dc63 100644
--- a/webform_paypal.module
+++ b/webform_paypal.module
@@ -23,6 +23,9 @@ function webform_paypal_permission() {
     'update payment status' =>  array(
       'title' => t('Update PayPal Payment Status'),
     ),
+    'use paypal sandbox' =>  array(
+      'title' => t('Use PayPal in Sandbox Mode'),
+    ),
   );
 }
 
@@ -34,6 +37,7 @@ function _webform_defaults_paypal() {
     'value' => '',
     'extra' => array(
       'private' => 1,
+      'transaction' => 'live',
     ),
   );
 }
@@ -66,6 +70,23 @@ function _webform_edit_paypal($component) {
     '#element_validate' => array('_webform_edit_paypal_validate'),
     '#description' => "The id of the button generated within your Paypal account. This can be found by visiting Merchant Services > My Saved Buttons or by copying the value for 'hosted-button-id' in the button code provided by Paypal"
   );
+
+  if (user_access('use paypal sandbox')) {
+    $form['paypal'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('PayPal Settings'),
+    );
+
+    $form['paypal']['transaction'] = array(
+      "#type" => 'select',
+      '#title' => t('Choose the type of transaction to process.'),
+      '#options' => array('live' => 'Live Transaction', 'testing' => 'Testing/Sandbox'),
+      '#description' => t('In order to use "Testing/Sandbox", you must have a <a href="https://developer.paypal.com/">developer account</a> set up with PayPal.'),
+      '#default_value' => $component['extra']['transaction'],
+      '#parents' => array('extra', 'transaction'),
+    );
+  }
+
   return $form;
 }
 
@@ -215,9 +236,15 @@ function webform_paypal_submit(&$form, &$form_state) {
   foreach ($webform_components as $key => $value) {
     if ($value['type'] == 'paypal') {
       $paypal_component_name = $value['form_key'];
+
+      if ($value['extra']['transaction'] == 'live') {
+        $url = 'https://www.paypal.com/cgi-bin/webscr';
+      }
+      else {
+        $url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
+      }
     }
   }
-  $url = 'https://www.paypal.com/cgi-bin/webscr';
 
   $post_data = array();
   $post_data['cmd'] = '_s-xclick';
