PayPal Python支付请求客户端详细信息

2024-04-20 12:33:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用PayPals API,它的文档非常糟糕,需要寻求帮助。在

我正在扩展我的网站在贝宝自适应API允许我设置预先批准的付款之前。在

在发送详细信息的同时,我还想添加一些用户信息。在

似乎可以根据他们的文档来完成,但在IPN中没有任何地方可以捕捉到它。在

简单付款

def test_pay():
    response = paypal.pay(
        actionType = 'PAY',
        cancelUrl = cancelUrl,
        currencyCode = currencyCode,
        senderEmail = EMAIL_ACCOUNT,
        feesPayer = 'EACHRECEIVER',
        memo = 'Simple payment example',
        preapprovalKey = 'PA-0HA01893HK6322232',
        receiverList = { 'receiver': [
            { 'amount':"10.0", 'email':API_EMAIL, 'primary':True },
            { 'amount':"5.0", 'email':SECONDARY_EMAIL, 'primary':False }
        ]},
        clientDetailsType = { 'customerId': 1, 'customerType': 'Normal' },
        returnUrl = returnUrl,
        ipnNotificationUrl = notificationUrl
    )
#     if response['responseEnvelope']['ack'] == "Success":
    print response['responseEnvelope']['ack']
#     if response['paymentExecStatus'] == "COMPLETED":
    print response['paymentExecStatus']
#     if response.has_key('payKey'):
    print response['payKey']
    print response

test_pay()

IPN反应

^{pr2}$

在响应中我看不到customerType或{}

有什么想法吗?在


Tags: 文档testapiifemailresponseamountpay
1条回答
网友
1楼 · 发布于 2024-04-20 12:33:31

根据PayPalAPI,不会返回customerId和{}。我想这是一个字段,它将显示在你的交易历史记录在贝宝网站上。为什么没有API函数来返回客户数据我也不明白。在

相关问题 更多 >