PayPal Python Pay 请求 ClientDetails
Posted
技术标签:
【中文标题】PayPal Python Pay 请求 ClientDetails【英文标题】:PayPal Python Pay request ClientDetails 【发布时间】:2012-03-12 20:37:00 【问题描述】:我正在使用 PayPals API,它的文档记录非常糟糕,需要寻求帮助。
我正在使用 PayPal 自适应 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¬ify_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
我在回复中看不到customerType
或customerId
有什么想法吗?
【问题讨论】:
你试过使用类似 django-paypal 的东西吗?你可以在这里找到它github.com/dcramer/django-paypal。 @xpanta:我不认为 django-paypal 支持自适应支付 【参考方案1】:customerId
和 customerType
不会根据 PayPal API 返回。我想这是一个将显示在您在 PayPal 网站上的交易历史记录中的字段。为什么没有返回客户数据的 API 函数也超出了我的理解。
【讨论】:
以上是关于PayPal Python Pay 请求 ClientDetails的主要内容,如果未能解决你的问题,请参考以下文章
谁能给我介绍下paypal的支付网关payflow的开发流程?急