$authResponse = Http::withToken($accessToken)->post("{$this->baseUrl}/v1/payments/payment", ["intent" => "authorize","payer" => ["payment_method" => "credit_card","funding_instruments" => [["credit_card_token" => ["credit_card_id" => $cardId]]]],"transactions" => [["amount" => ["total" => "1.00","currency" => "USD"],"description" => "Card verification test"]]]);`
When I call this api to authorise payment response is like
"Payee is Invalid"
Although at first I get token successfully if payee were invalid then why token api would be successfull.
$authResponse = Http::withToken($accessToken)->post("{$this->baseUrl}/v1/payments/payment", ["intent" => "authorize","payer" => ["payment_method" => "credit_card","funding_instruments" => [["credit_card_token" => ["credit_card_id" => $cardId]]]],"transactions" => [["amount" => ["total" => "1.00","currency" => "USD"],"description" => "Card verification test"]]]);`
When I call this api to authorise payment response is like
"Payee is Invalid"
Although at first I get token successfully if payee were invalid then why token api would be successfull.
Share Improve this question edited Feb 2 at 20:00 VLAZ 29.1k9 gold badges63 silver badges84 bronze badges asked Feb 2 at 8:44 The VottuxThe Vottux 211 bronze badge 1- log the entire request and entire response, in JSON format – Preston PHX Commented Feb 2 at 17:01
1 Answer
Reset to default 1The "Payee is Invalid" error usually indicates that the recipient (merchant account) specified for the transaction is incorrect or not eligible to receive payments. The token you received initially is only for authentication, not for transaction validation.
Ensure that your PayPal (or other payment provider) merchant account is set up correctly and is eligible to receive payments.
Make sure you are using the correct API URL for payments:
"{$this->baseUrl}/v1/payments/payment"
Make sure $this->baseUrl is set correctly (https://api.sandbox.paypal for testing or https://api.paypal for live).