+ if app:
+ billing_agreement['override_merchant_preferences'] = {
+ 'return_url': absolute_url('paypal_app_return', {'key': key}),
+ }
+ else:
+ billing_agreement['override_merchant_preferences'] = {
+ 'return_url': absolute_url('paypal_return', {'key': key}),
+ }
+