Skip to content

Instantly share code, notes, and snippets.

@chrisns
Created June 20, 2012 09:22
Show Gist options
  • Save chrisns/2959006 to your computer and use it in GitHub Desktop.
Save chrisns/2959006 to your computer and use it in GitHub Desktop.
diff --git includes/handlers/pay_method_direct_paypal.inc includes/handlers/pay_method_direct_paypal.inc
index 9508897..5f9d0d6 100644
--- includes/handlers/pay_method_direct_paypal.inc
+++ includes/handlers/pay_method_direct_paypal.inc
@@ -7,6 +7,7 @@
class pay_method_direct_paypal extends pay_method_direct {
var $paypal_account = '';
var $paypal_sandbox = '';
+ var $paypal_return_url = '';
// Always assume this is a 'paypal' payment, since we won't get more specific.
var $payment_type = 'paypal';
@@ -57,7 +58,7 @@ class pay_method_direct_paypal extends pay_method_direct {
//'BUTTONSOURCE' => 'Ubercart_ShoppingCart_DP_US',
'notify_url' => url('pay/gateway/response/'. $this->activity->paid, array('absolute' => TRUE)),
'email' => $this->mail,
- 'return' => $base_url,
+ 'return' => !empty($this->paypal_return_url) ? $this->paypal_return_url : $base_url,
//'PHONENUM' => $this->billto['phone'],
);
@@ -123,6 +124,14 @@ class pay_method_direct_paypal extends pay_method_direct {
'#required' => TRUE,
'#parents' => array($group, 'paypal_account'),
);
+ $form[$group]['pp']['paypal_return_url'] = array(
+ '#type' => 'textfield',
+ '#title' => t('PayPal Return Address'),
+ '#description' => t('You can specify the address that users are returned to after completing their PayPal purchase. Enter a fully qualified domain name (including http://). If you leave it empty your homepage will be used.'),
+ '#default_value' => $this->paypal_return_url,
+ '#required' => FALSE,
+ '#parents' => array($group, 'paypal_return_url'),
+ );
$form[$group]['pp']['paypal_sandbox'] = array(
'#type' => 'checkbox',
'#title' => t('This is a sandbox test account'),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment