order_paypal.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:server 作者: viur-framework 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号