Permalink
Browse files

Sandox or live>

  • Loading branch information...
1 parent af022ec commit 5d8ac9fa170e499863ed8fd6433cd10029f76477 @shabda shabda committed Jul 26, 2010
Showing with 7 additions and 1 deletion.
  1. +7 −1 sellflickr/adaptive/__init__.py
View
8 sellflickr/adaptive/__init__.py
@@ -20,5 +20,11 @@ def get_adaptive_payment_url(returnUrl, cancelUrl, receiverList, **kwargs):
request = urllib2.Request(API_END_POINT, data = json.dumps(data), headers = headers)
resp = json.loads(urllib2.urlopen(request).read())
key = resp["payKey"]
- return "https://www.sandbox.paypal.com/webscr?cmd=_ap-payment&paykey=%s"%key
+ API_ENDPOINT = ""
+ if settings.DEBUG:
+ API_ENDPOINT = "https://www.sandbox.paypal.com/webscr"
+ else:
+ API_ENDPOINT = "https://www.paypal.com/webscr"
+ return "%s?cmd=_ap-payment&paykey=%s"%(API_ENDPOINT,key)
+

0 comments on commit 5d8ac9f

Please sign in to comment.