PayPal Python Pay请求ClientDetails

时间:2012-02-22 13:50:39

标签: python django paypal paypal-ipn paypal-adaptive-payments

我正在使用PayPals API,这个API非常难以记录,需要寻求帮助。

我正在使用PayPal Adaptive 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回复

pay_key=AP-8J7165865F7541310&transaction%5B0%5D.id_for_sender_txn=4GL2853573576212V&transaction%5B0%5D.pending_reason=NONE&charset=windows-1252&log_default_shipping_address_in_transaction=false&transaction%5B0%5D.id=6XD76450JV9737605&notify_version=UNVERSIONED&preapproval_key=PA-93P236141R834703C&transaction%5B1%5D.id=9R07347926768733A&test_ipn=1&transaction%5B0%5D.status=Completed&status=COMPLETED&action_type=PAY&memo=Simple+payment+example&transaction%5B0%5D.receiver=a.smit_1329744569_biz%40mac.com&transaction%5B1%5D.status=Completed&payment_request_date=Wed+Feb+22+05%3A30%3A49+PST+2012&transaction%5B1%5D.id_for_sender_txn=2D9633797C888500H&verify_sign=AIDiik4kxSLiNqbMmTDHplFnCnz3A3ORrDVlBVOzrtltyUx-NoxxgSc6&transaction%5B1%5D.pending_reason=NONE&transaction%5B0%5D.status_for_sender_txn=Completed&transaction%5B1%5D.status_for_sender_txn=Completed&transaction%5B0%5D.is_primary_receiver=true&transaction%5B1%5D.receiver=a.smit_1298362298_per%40mac.com&transaction%5B1%5D.amount=USD+5.00&ipn_notification_url=http%3A%2F%2F108.166.107.74%2Fyour-ipn-location%2F&transaction%5B0%5D.amount=USD+10.00&transaction_type=Adaptive+Payment+PAY&cancel_url=http%3A%2F%2F108.166.107.74%2F&reverse_all_parallel_payments_on_error=false&sender_email=a.smit_1329128659_per%40mac.com&transaction%5B1%5D.is_primary_receiver=false&fees_payer=EACHRECEIVER&return_url=http%3A%2F%2F108.166.107.74%2F

我无法在回复中看到customerTypecustomerId

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

根据PayPal API不会返回

customerIdcustomerType。我想这是一个将显示在PayPal网站上的交易历史记录中的字段。为什么没有API函数来返回客户数据也超出了我的范围。

相关问题