Index: ec_paypal.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/ecommerce/ec_paypal/ec_paypal.module,v
retrieving revision 1.4.2.1
diff -u -r1.4.2.1 ec_paypal.module
--- ec_paypal.module	3 Nov 2008 23:35:48 -0000	1.4.2.1
+++ ec_paypal.module	5 Nov 2008 15:40:18 -0000
@@ -712,17 +712,18 @@
       ec_paypal_wd($response, 'ec_paypal', t('PayPal PDT notication received for %receiver_email. Unknown receiver email.', array('%receiver_email' => $response['receiver_email'])), WATCHDOG_WARNING);
     }
   }
-
-  $return_url = variable_get('ec_receipt_return_url', 'node');
+  $info = ec_receipt_get_types('type', $txn->payment_method);
+  $return_url = isset($info->return_url) ? $info->return_url : variable_get('ec_receipt_return_url', 'node');
   if ($return_url == '%order-history') {
     $return_url = "user/$user->uid/store";
   }
-  drupal_goto(variable_get('ec_receipt_return_url', 'node'));
+  drupal_goto($return_url);
 }
 
 function ec_paypal_cancel() {
   $output .= dpr($_REQUEST, TRUE);
-  drupal_goto(variable_get('ec_receipt_cancel_url', 'node'));
+  $info = ec_receipt_get_types('type', $txn->payment_method);
+  drupal_goto(isset($info->cancel_url) ? $info->cancel_url : variable_get('ec_receipt_cancel_url', 'node'));
 }
 
 /**
