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.
- How to hide the shipping address for a specific merchant - As no shipping address required in PayPal Payments Standard
- Paypal checkout money not reaching paypal in REST APIs
- Webhook Data Discrepancies Between Live and Sandbox Environments in REST APIs
- Urgent Assistance - PayPal Integration (Monthly Recurring Payment) in PayPal Payments Standard
- Want to upgrade to PayPal Checkout (PPCP) with OpenCart? in PayPal Upgrade Community