MALFORMED_REQUEST [message] => Incoming JSON request does not map to A-6ren">
gpt4 book ai didi

api - 发送发票返回 : "Incoming JSON request does not map to API request"

转载 作者:太空宇宙 更新时间:2023-11-03 15:49:03 24 4
gpt4 key购买 nike

我正在尝试向客户发送发票,但我收到了:

[name] => MALFORMED_REQUEST
[message] => Incoming JSON request does not map to API request
[information_link] => https://developer.paypal.com/webapps/developer/docs/api/#MALFORMED_REQUEST

我要发送以下内容:注意我是json编码,我也试过带&不带注释部分。我的 header 应用程序类型是 json。投稿网址:https://api.sandbox.paypal.com/v1/payments/payment

$f = array(
/*"intent" => "sale",
"redirect_urls" => array(
"return_url" => "http://www.return.com/",
"cancel_url" => "http://www.cancel.com/"
),
"payer" => array(
"payment_method" => "paypal"
),
*
*/
"requestEnvelope" => array(
"errorLanguage" => "en_US"
),
"invoice" => array(
"merchantEmail" => "merchant@domain.com",
"payerEmail" => "payer@domain.com",
"currencyCode" => "USD",
"paymentTerms" => "DueOnReceipt",
"merchantInfo" => array(
"address" => array(
"line1" => "Address"
)
),
"itemList" => array(
"item" => array(
array(
"name" => "Item1",
"quantity" => "25",
"unitPrice" => "3"
), array(
"name" => "Item2",
"quantity" => "32",
"unitPrice" => "3"
)
)
)
)
);

最佳答案

“发票”=> array(
"merchantEmail"=> "merchant@domain.com",
"payerEmail"=> "payer@domain.com",
"currencyCode"=> "USD",
"paymentTerms"=> "DueOnReceipt",
"merchantInfo"=> array(
“地址”=>数组(
"line1"=> "地址"
)
)

您应该阅读如何声明 invoice-object https://developer.paypal.com/webapps/developer/docs/api/#invoice-object

例如invoice-object 没有键 merchantEmail , payerEmail .....你的数组完全错误

关于api - 发送发票返回 : "Incoming JSON request does not map to API request",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21210574/

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