+ def _get_return_url(self, **post):
+ """ Extract the return URL from the data coming from paypal. """
+ return_url = post.pop('return_url', '')
+ if not return_url:
+ custom = json.loads(post.pop('custom', '{}'))
+ return_url = custom.get('return_url', '/')
+ return return_url
+