最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Paypal authorise rest api in php - Stack Overflow

programmeradmin0浏览0评论
$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
Add a comment  | 

1 Answer 1

Reset to default 1

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.

  1. Ensure that your PayPal (or other payment provider) merchant account is set up correctly and is eligible to receive payments.

  2. 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).

发布评论

评论列表(0)

  1. 暂无评论