order_paypal.py 文件源码

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

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


问题


面经


文章

微信
公众号

扫码关注公众号