![](/img/trans.png)
[英]Php - Paypal v2 checkout orders returned status 422 when passing tax amount
[英]PayPal Orders V2 payee object in Checkout-PHP-SDK fails with amount error
我正在集成 PayPal Checkout,除非我在訂單正文中包含自定義收款人,否則它運行良好。 I tried the PayPal PHP example at https://developer.paypal.com/docs/checkout/integration-features/custom-payee/ that looks like this:
return array(
'intent' => 'AUTHORIZE',
'purchase_units' =>
array(
0 =>
array(
'amount' =>
array(
'currency_code' => 'USD',
'value' => '220.00'
)
),
array(
'payee' =>
array(
'email_address' => 'payee@email.com'
)
)
)
);
嘗試創建訂單將導致此錯誤消息(這似乎是完全錯誤的,因為它抱怨既不存在也不需要的字段):
{"name":"INVALID_REQUEST","message":"Request is not well-formed, syntactically incorrect, or violates schema.","debug_id":"65a47f1e8defd","details":[{"field":"/purchase_units/1/amount","value":"","location":"body","issue":"MISSING_REQUIRED_PARAMETER","description":"A required field / parameter is missing."}],"links":[{"href":"https://developer.paypal.com/docs/api/orders/v2/#error-MISSING_REQUIRED_PARAMETER","rel":"information_link","encType":"application/json"}]} [/var/www/web15/htdocs/retroplace/vendor/paypal/paypalhttp/lib/PayPalHttp/HttpClient.php:215]
如果我刪除與收款人的部分,一切正常。 但我需要訂單中的收款人...
您是否啟用了 PHP 錯誤/警告? 看起來可能是錯誤的 PHP 語法
嘗試放置:
'payee' =>
array(
'email_address' => 'payee@email.com'
)
在上面的數組中(第二個鍵,在與“金額”相同的數組中)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.