payment.capture.com已完成:如何获得父母付款?
在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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
返回的资源> 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.