def DoExpressCheckoutPayment(self, token, payer_id, amt):
params = {
'METHOD' : "DoExpressCheckoutPayment",
'PAYMENTACTION' : 'Sale',
'RETURNURL' : self.returnurl,
'CANCELURL' : self.cancelurl,
'TOKEN' : token,
'AMT' : amt,
'PAYERID' : payer_id,
'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_tokens = {}
for token in response.split('&'):
response_tokens[token.split("=")[0]] = token.split("=")[1]
for key in list(response_tokens.keys()):
response_tokens[key] = urllib.unquote(response_tokens[key])
return response_tokens
评论列表
文章目录