我正在尝试向客户发送发票,但我收到了:
[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编码,我也试过&没有评论部分。 我的标头应用程序类型是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"
)
)
)
)
);
答案 0 :(得分:1)
"invoice" => array(
"merchantEmail" => "merchant@domain.com",
"payerEmail" => "payer@domain.com",
"currencyCode" => "USD",
"paymentTerms" => "DueOnReceipt",
"merchantInfo" => array(
"address" => array(
"line1" => "Address"
)
)
您应该阅读invoice-object
如何宣布https://developer.paypal.com/webapps/developer/docs/api/#invoice-object
E.g。 invoice-object
没有密钥merchantEmail
,payerEmail
.....
你的阵列是完全错误的