Getting user's business name and country via PayPal APIs - paypal

Our company has clients who have PayPal accounts. We also have their PayPal emails.
The issue is how to get client's business_name and country by providing its PayPal email?
Is it possible to make it using PayPal API?
Thanks in advance!

When a user makes a payment (Set up standard payments), you'll receive their shipping address country code as part of the v2/checkout/orders capture response.
If you need to the country of a PayPal account separately from such a payment capture's shipping address, then you might need to implement Log in with PayPal requesting the scope address, and have the user log in.
However, the capture response might also have a "payer" object with the billing account country (which can be different from the shipping country in some cases).

Related

Paypal API don't want a Delivery Address

I'm using secure-hosting as a middleman to process payments from my website which accepts credit card details and has an automatic paypal feature which essentially uses the paypal-api.
It processes payments fine and dandy, however our product isn't supposed to be delivered to the person who purchased it, it is sent to another (or many hundreds of) person(s) whose details are entered on our site by the purchaser.
The problem is that PayPal displays the purchaser's address as the delivery address both when the purchaser is signing into paypal and when they receive an invoice from paypal.
Does anyone know if there is an option to turn off this display of the delivery address/in the email? I've tried adding the no_shipping: '1' and NOSHIPPING=1 field when communicating with paypal but I believe this is to specify that the user doesn't have to supply an address because paypal will have a record of their address.
The ADDROVERRIDE variable determines whether or not the PayPal pages should display the shipping address set by you in this SetExpressCheckout request, not the shipping address on file with PayPal for this buyer. This would allow you to pass in a shipping address that your buyer enters into a form on your website, for example.

Get the email of my PayPal customer

I need to read the email of the buyer that has completed a transaction on my eCommerce site. Paypal does send me an email of notification, but does not contain the email of the buyer (Instead, it returns just the transaction-id - which takes me to my account.)
I was looking through the PayPal for Developer API, but I can't find an example to get this level of detail. Is this even possible to retrieve, and if so, how?
Paypal ipn returns the address. When you post to PayPal, they request an address by default. (Source)
no_shipping =2 is the prompt for requiring an address.

Getting billing info express checkout

I would like to get User billing information from PayPal so that I can compare the billing information the user would have inputted in my site with those which the user has in PayPal.
I did try to access this information using the response which PayPal gives using
getECResponse.GetExpressCheckoutDetailsResponseDetails.PayerInfo.Address.Street1
but these are all null.
Is this possible? I am using Express checkout and these are digital goods so the user would not be inputting any shipping details himself.
Thanks
GetExpressCheckoutDetails returns Billing information if you had passed REQBILLINGADDRESS = 1 in SetExpressCheckout. Before doing this, you will need to get billing address enabled by contacting PayPal customer/Business Support.
A sample GETEC response :
TOKEN=EC-6CW49061US796703X
BILLINGAGREEMENTACCEPTEDSTATUS=0
CHECKOUTSTATUS=PaymentActionNotInitiated
TIMESTAMP=2014-11-06T09:29:59Z
CORRELATIONID=ac2e59af86d9c
ACK=Success
VERSION=109.0
BUILD=13630372
EMAIL=vimalbuyer#gmail.com
PAYERID=ZK5AUW8MWY9CW
PAYERSTATUS=verified
FIRSTNAME=vimalbuyer
LASTNAME=ravichandran
COUNTRYCODE=US
SHIPTONAME=J Smith
SHIPTOSTREET=1 Main St
SHIPTOCITY=San Jose
SHIPTOSTATE=CA
SHIPTOZIP=95131
SHIPTOCOUNTRYCODE=US
SHIPTOCOUNTRYNAME=United States
BILLINGNAME=vimalbuyer ravichandran //Billing information starts
STREET=1 Main St
CITY=San Jose
STATE=CA
ZIP=95131
COUNTRY=US
COUNTRYNAME=United States
ADDRESSID=PayPal
ADDRESSSTATUS=Confirmed
CURRENCYCODE=USD
AMT=0.01
SHIPPINGAMT=0.00
HANDLINGAMT=0.00
TAXAMT=0.00
INSURANCEAMT=0.00
SHIPDISCAMT=0.00
PAYMENTREQUEST_0_CURRENCYCODE=USD
PAYMENTREQUEST_0_AMT=0.01
PAYMENTREQUEST_0_SHIPPINGAMT=0.00
PAYMENTREQUEST_0_HANDLINGAMT=0.00
PAYMENTREQUEST_0_TAXAMT=0.00
PAYMENTREQUEST_0_INSURANCEAMT=0.00
PAYMENTREQUEST_0_SHIPDISCAMT=0.00
PAYMENTREQUEST_0_INSURANCEOPTIONOFFERED=false
PAYMENTREQUEST_0_SHIPTONAME=J Smith
PAYMENTREQUEST_0_SHIPTOSTREET=1 Main St
PAYMENTREQUEST_0_SHIPTOCITY=San Jose
PAYMENTREQUEST_0_SHIPTOSTATE=CA
PAYMENTREQUEST_0_SHIPTOZIP=95131
PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE=US
PAYMENTREQUEST_0_SHIPTOCOUNTRYNAME=United States
PAYMENTREQUEST_0_ADDRESSSTATUS=Confirmed
PAYMENTREQUEST_0_ADDRESSNORMALIZATIONSTATUS=None
PAYMENTREQUESTINFO_0_ERRORCODE=0
The GetExpressCheckoutDetails API call is only going to return the shipping information, and you are correct that if the buyer is going through the flow for digital goods there are not going to be any shipping details. There are a few different ways to get some of the information that you are wanting.
You could use the AddressVerify API. This would need to be enabled on your account by PayPal. The AddressVerify API operation confirms whether a postal address and postal code match those of the specified PayPal account holder.
You could use PayPal Identity (formerly PayPal Access), to get some of the user's information back. The basic account information that will be returned is:
Name (First, Last or Full)
Email Address
Address (Street Address, City, State, Postal Code, Country)
Phone Number
Another option, is you can contact PayPal and request a feature to be enabled to return the billing address for Express Checkout. This is feature that does need to be approved before it can be turned on as well.

How to get user country via Paypal API

Is it possible to get the country using their email? Or validate user's country.
In our system, the user submits their email and country. We need to check whether the country is correctly specified.
Sorry for my English.
Thanks.
you have to force users to login paypal (you don't want to allow transactions by who doesn't have a paypal account)
See SetExpressCheckout SOLUTIONTYPE = Mark
after the user completes the expresscheckout, in order to confirm it, you should check if its street address is confirmed and if it is of the country you require:
GetExpressCheckoutDetails
PAYERSTATUS must be "verified"
COUNTRYCODE must be the country you require
if these two values are ok, you can confirm the payment with "DoExpressCheckoutPayment"
since you are new, if you like my answer don't forget to set it as "accepted"
An alternative solution to verify customer's PP account country with out initiaing a transaction, is to implement "Login with PayPal" with your own customer login/register managenment.
It's based on the PayPal REST identity APIs, and will be much easier for you to get & manage customer account info (with user consent).
Here's the developemnt resource for your reference: https://developer.paypal.com/docs/integration/direct/identity/

How to get sellers PayPal account from eBay transaction

How can I get a sellers PayPal email account after I've successfully purchased an item on eBay?
I'm writing an application which makes a purchase on eBay via its API. When it successfully purchases, I receive a Transaction ID from eBay.
I now want to use the PayPal API to pay for this item, and require the sellers email address. I understand that their API has methods like GetTransactionDetails, but I'm making the request as a buyer, and also only have the eBay transaction ID.
Where can I get the seller's PayPal email address?
Thanks!
There is no API based approach to remitting purchases on eBay via PayPal.
After testing many different options and wading through the vast mess of eBay API "documentation" and raw responses, it's evident that the PayPal email address of the seller is NOT available unless you are the seller.
Trying to access this field as the buyer, despite being part of the transaction, will simply return "Invalid Data" in this field.
I'm assuming you're using the PlaceOffer call (from the Trading API) to purchase the item.
You can get the seller's email address using the GetItemTransactions API, and there would be a strong liklihood that that email address would be the same one associated with their PayPal account, but it's not guaranteed to be the same. For example, for large-volume sellers, they might have "sales#mystore.com" for their eBay contact but "payments#mystore.com" for their PayPal one.