payment.capture.com已完成:如何获得父母付款?

发布于 2025-01-28 18:03:34 字数 472 浏览 5 评论 0原文

在webhook中完成event付款时

$resource = $webhookEvent->getResource();
$Payment = \Paypal\Api\Payment::get($resource->parent_payment, $apiContext);
$Payer = $Payment->getPayer();
$Payerinfo = $Payer->getPayerInfo();

。这是如何工作的?似乎没有$ resource-> parent_payment。我尝试了类似的事情:

$request = new PayPalCheckoutSdk\Orders\OrdersGetRequest($resource->id);

但是这仅返回resource_not_found。

我如何在这里获得PayerInfo?

When getting an event PAYMENT.SALE.COMPLETED in a webhook, you can use this code to get more information about the payer:

$resource = $webhookEvent->getResource();
$Payment = \Paypal\Api\Payment::get($resource->parent_payment, $apiContext);
$Payer = $Payment->getPayer();
$Payerinfo = $Payer->getPayerInfo();

Now I updated to SDK V2, and get PAYMENT.CAPTURE.COMPLETED-events. How does this work here? It seems there is no $resource->parent_payment. I tried something like:

$request = new PayPalCheckoutSdk\Orders\OrdersGetRequest($resource->id);

But this only returns RESOURCE_NOT_FOUND.

How can I get the Payerinfo here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

千紇 2025-02-04 18:03:34

返回的资源> id是V2/付款ID,而不是订单ID。

V2/Checkout/订单ID仅在付款人批准期间使用,并且没有会计价值。

The resource->id returned is a v2/payments id, not an Order ID.

v2/checkout/orders IDs are only used during payer approval, and have no accounting value.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文