def SetExpressCheckout(self, amount):
params = {
'METHOD' : "SetExpressCheckout",
'NOSHIPPING' : 1,
'PAYMENTACTION' : 'Authorization',
'RETURNURL' : self.returnurl,
'CANCELURL' : self.cancelurl,
'AMT' : amount,
'CURRENCYCODE': self.currency
}
params_string = self.signature + urllib.urlencode(params)
response = urlfetch.fetch(self.API_ENDPOINT, params_string.encode("UTF-8"),"POST",deadline=10).content.decode("UTF-8")
response_token = ""
for token in response.split('&'):
if token.find("TOKEN=") != -1:
response_token = token[ (token.find("TOKEN=")+6):]
return response_token
评论列表
文章目录