When using PayPal API is it possible to get payer info?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Currently we use IPN, and when we receive notification there is payer info, such as email, residence_country, first_name, last_name.
We want to switch to API (because it is possible to create refund thought API). But in API calls create payment and execute payment, there is no information about payer.
How can we get this payer info?
- Labels:
-
Payments REST APIs
-
Webhooks REST APIs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
> Yes, you have to use webhooks in this case.
Which exactly webhook provides this info?
I've already checked webhook and I could not find such info in webhooks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using PHP with the Paypal-SDK. The general approach (without error-handling etc) is:
PAYMENT.SALE.COMPLETED
$resource = $webhookEvent->getResource();
$Payment = \Paypal\Api\Payment::get($resource->parent_payment, $api);
$Payer = $Payment->getPayer();
$Payerinfo = $Payer->getPayerInfo();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you!
I checked this webhook in webhook simulator. And it really does not provide payer info.
But your code looks more like sequential API calls, than just parsing webhook response.
So I dig into it, and I found that execute payment API call returns payer info.
https://developer.paypal.com/docs/api/payments/v1/#payment_execute
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Getting errors when integrating standard checkout with my web site. Probably a beginner problem. in SDKs
- Button in PayPal Payments Standard
- Need help to integrate Advanced Checkout (PPCP) With WHMCS in PayPal Upgrade Community
- I want to implement subscription functionality. in REST APIs
- IPN works in sandbox but not live in Sandbox Environment