【问题标题】:Paypal Adaptive Payments Pay API operation returns Invalid Request Parameter "receiver" even though provided即使提供了 Paypal Adaptive Payments Pay API 操作,也会返回无效的请求参数“receiver”
【发布时间】:2015-05-12 22:42:22
【问题描述】:

我正在尝试隐式 Pay API 操作。尽管我按照 paypal api 文档中的指定沿着接收器发送,但我一直收到“无效的请求参数:接收器不能为空”错误。我将 API 凭据作为请求标头包含在内。

这是请求负载

request['payload']={
'actionType' : 'PAY', 
'senderEmail': 'sender@company.com',
'receiverList' : {'receiver': [{ 'amount': '10.0', 'email':'recepient@company.com' }]}, 
'currencyCode' : 'SGD',
'requestEnvelope' : {
    "errorLanguage":"en_US",    # Language used to display errors
    "detailLevel":"ReturnAll"   # Error detail level
    },
'ipnNotificationUrl': 'http://xxxxxxxx',
'cancelUrl': 'http://xxxxxxxxx',
'returnUrl': 'http://xxxxxxxxxx'
}

【问题讨论】:

    标签: paypal paypal-sandbox paypal-adaptive-payments


    【解决方案1】:

    错误在我这边——尽管贝宝的错误信息并没有多大帮助。我做了 在将请求发送到贝宝之前,不要将 python dict 对象编码为 json。

    import json
    payload = json.dumps(request['payload'])
    

    希望这对某人有所帮助。

    【讨论】:

      猜你喜欢
      • 2015-10-17
      • 2012-06-28
      • 2015-08-08
      • 1970-01-01
      • 2011-02-19
      • 1970-01-01
      • 2014-01-18
      • 2015-03-28
      • 1970-01-01
      相关资源
      最近更新 更多