$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.
The "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.com for testing or https://api.paypal.com for live).