diff --git a/commerce_2checkout.module b/commerce_2checkout.module
index 781e121..2f362d4 100644
--- a/commerce_2checkout.module
+++ b/commerce_2checkout.module
@@ -442,7 +442,11 @@ function commerce_2checkout_icons() {
  *   The URL to use to submit requests to 2checkout.
  */
 function commerce_2checkout_server_url ($settings) {
-  return $settings['one_page_checkout'] ? 'https://www.2checkout.com/checkout/spurchase' : 'https://www.2checkout.com/checkout/purchase';
+  if ($settings['demo']) {
+    return $settings['one_page_checkout'] ? 'https://sandbox.2checkout.com/checkout/spurchase' : 'https://sandbox.2checkout.com/checkout/purchase';
+  } else {
+    return $settings['one_page_checkout'] ? 'https://www.2checkout.com/checkout/spurchase' : 'https://www.2checkout.com/checkout/purchase';
+  }
 }
 
 
