gpt4 book ai didi

Paypal Adaptive Payments Pay API 操作返回无效请求参数 "receiver",即使已提供

转载 作者:太空宇宙 更新时间:2023-11-03 16:08:38 26 4
gpt4 key购买 nike

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

这是请求有效载荷

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 之前,不要将 python dict 对象编码为 json。

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

希望这对某人有帮助。

关于Paypal Adaptive Payments Pay API 操作返回无效请求参数 "receiver",即使已提供,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28981595/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com