【问题标题】:PayPal Adaptive Payments API failing with multiple receiversPayPal Adaptive Payments API 因多个接收者而失败
【发布时间】:2012-04-03 13:42:38
【问题描述】:

我正在为 Paypal 的 Adaptive Payments API 开发 Python 绑定,目前我正在实现并行/链式支付调用,但我遇到了一个相当神秘的错误。

我已经实现了Pay API Operation中详述的基本“PAY”操作,参数如下:

{'actionType': 'PAY',
'cancelUrl': 'http://my_domain.com/cancel_url',
'clientDetails.applicationId': 'My Application ID',
'clientDetails.ipAddress': 'MY IP',
'currencyCode': 'USD',
'receiverList.receiver(0).amount': 15,
'receiverList.receiver(0).email': 'sandbox_test_account@email.com',
'requestEnvelope.detailLevel': 'ReturnAll',
'requestEnvelope.errorLanguage': 'en_US',
'returnUrl': 'http://my_domain.com/cancel_url'}

而且它工作得非常好,但是当我尝试在 receiverList 对象中添加更多接收器时,Paypal 向我返回了一个没有说明任何内容的错误:

{'error(0).category': ['Application'],
'error(0).domain': ['PLATFORM'],
'error(0).errorId': ['580001'],
'error(0).message': ['Invalid request: {0}'],
'error(0).severity': ['Error'],
'error(0).subdomain': ['Application'],
'responseEnvelope.ack': ['Failure'],
'responseEnvelope.build': ['2486531'],
'responseEnvelope.correlationId': ['f454f1118f799'],
'responseEnvelope.timestamp': ['2012-03-18T17:48:10.534-07:00']}

仅此而已,它没有说明请求无效的位置,我真的找不到将第一个参数集更改为添加的任何问题:

'receiverList.receiver(1).amount': 15,
'receiverList.receiver(1).email': 'sandbox_2nd_test_account@email.com'

我是否必须启用某些东西才能在 Sandbox 中测试链式/并行支付,或者我是否忘记了基本标头/参数中的某些配置才能发送?

感谢您的帮助

【问题讨论】:

    标签: python paypal paypal-adaptive-payments


    【解决方案1】:

    联系 PayPal 后,他们告诉我尝试按顺序发送 receiverList 对象,例如:

    {'actionType': 'PAY',
    'cancelUrl': 'http://my_domain.com/cancel_url',
    'clientDetails.applicationId': 'My Application ID',
    'clientDetails.ipAddress': 'MY IP',
    'currencyCode': 'USD',
    'receiverList.receiver(0).amount': 15,
    'receiverList.receiver(0).email': 'sandbox_test_account@email.com',
    'receiverList.receiver(1).amount': 15,
    'receiverList.receiver(1).email': 'sandbox_test_account@email.com',
    'requestEnvelope.detailLevel': 'ReturnAll',
    'requestEnvelope.errorLanguage': 'en_US',
    'returnUrl': 'http://my_domain.com/cancel_url'}
    

    当我将正文实现为 Python 字典时,它变得无序,所以我开始使用 OrderedDict,这对我有用 :)

    【讨论】:

      猜你喜欢
      • 2013-12-29
      • 2012-06-28
      • 2014-01-18
      • 2014-01-10
      • 2013-09-14
      • 2011-02-19
      • 2013-03-22
      • 2013-09-28
      • 2016-08-22
      相关资源
      最近更新 更多