Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

allways return url to moneybookers

  • Loading branch information...
commit 14ee85eff5cff0dcdb5a78395b24718630fff3b8 1 parent 05b3baa
@Akuryou Akuryou authored
Showing with 4 additions and 8 deletions.
  1. +4 −8 skrill/models.py
View
12 skrill/models.py
@@ -192,14 +192,10 @@ def submit(self, force_submit=False):
data['merchant_fields'] = used_custom_fields
req = urllib2.Request(url=API_URL, data=urllib.urlencode(data))
- res = urllib2.urlopen(req).read()
-
- # Unfortunately Skrill sends HTTP 200 no matter if the request failed or not.
- # In case of error they reply with one big html page. So we test if the result is a session id with length 32
- if len(res) != 32:
- raise Exception(res)
- else:
- return "%s?sid=%s" % (API_URL, res)
+ headers = urllib2.urlopen(req).info().headers
+ for header in headers:
+ if "Set-Cookie: SESSION_ID=" in header:
+ return "%s?sid=%s" % (API_URL, header.split(';')[0].replace("Set-Cookie: SESSION_ID=", ""))
class StatusReport(models.Model):
Please sign in to comment.
Something went wrong with that request. Please try again.