After a payment is approved by the payer, I load the payment details and obtain the country of the payer from [payment_response].payer.payer_info.country_code.
My question: is it guaranteed that the payer's country is always set after the payment was approved? Is it possible for the payer to hide his country? Are there cases, where the payer's country won't be set after the payment approval?
It seems like the payer's country is always set but the PayPal's REST API documentation does not explicitly confirm this.
I hope someone from PayPal will read this since they use StackOverflow in their developer's support page.
I'm asking because I need to conform to EU regulation 1042/2013 which requires me to obtain two non-exclusive proofs of country of origin for each payment I receive. If I knew that payer's PayPal country is not always set, I would have to implement another solution.
Related
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).
Well I asked though the paypal site, but have got no answer. I got the famous email with "Your question has been received. To review the status of your ticket, click on the link below." with no link in it. So I'm hoping I can get an answer here.
This is what I sent them:
It appears you have multiple APIs available and I'm having a hard time figuring out what the each API is capable of doing exactly. I want to create a site that in short, brings buyers and seller together. Here is what I am looking for:
Buyer and Seller make an agreement through site.
Buyer sends money, seller is unable to touch it yet though. (Basically can paypal secure a payment?)
Seller gets notice of money sent and notice to ship product ship product.
Alternative paths for step 4:
Buyer gets product and there are no issues, the buyer confirms the transaction and payment is released to the seller and a set % is sent to me. (Can paypal split payments?)
Seller never ships product or problem arise in shipping that cannot be resolved, paypal returns money to buyer without penalty. (Can paypal return funds without penalty?)
Product arrives, but has issues. There will be set penalties for said issues. Penalities are returned to the buyer, then rest is sent to seller and set % sent to me. (can paypal enact a penalty?)
Any general information or answers to my specific questions would be greatly appreciated. thank you for your time.
For #2, since you're the service provider, you'll be liable for product delivery. Paypal won't do it for you.
An ideal workflow would be:
Your buyers pay you
You withold the payment
Buyer okays the shipment
You keep your cut and pay the rest to the seller
If you have to refund your buyer (order cancellation, or some other reason), you can use paypal's refund api
To summarize, paypal is just a payment processor and would ensure that payment reaches from endpoint A to endpoint B. How you use paypal for your particular use cases is totally upto you.
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.
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/
Instant Payment Notification script receives among other parameters the following one:
payer_id = LPLWNMTBWMFAY
What is the meaning of that string?
It's an external unique identifier of a particular PayPal account. Since email addresses change over time. A PayerID is static.
As others have said, payer_id can be used to identify a Paypal account. HOWEVER! -- a single Paypal account can have several payer_ids associated with it, one for each credit card or funding source used by that account. Because of this, a given Paypal account does NOT map one-to-one to a single payer_id.
For example, if Bob buys from my website (through Paypal) using his Visa card, the transaction will include one payer_id. If Bob later buys using his Mastercard, the transaction will include a different payer_id.
I confirmed this in a phone call with Paypal Merchant Technical Solutions, in May of 2013, after running into problems with my order processing (due to an incorrect assumption I had made about payer_id being a reliable way to see if a customer already existed within my customer database).
NB: One ramification of this fact is that, when writing a Paypal IPN-processing script, payer_id should properly be stored only in the "orders" database table, and not stored in the "customers" table.
See also this answer: Is the paypal payer_id unique per credit card?
EDIT:
Apparently, each PayPal account does get just one payer_id. (That is not what I gleaned from my aforementioned phone call with Paypal Merchant Technical Solutions, but I can't find my notes on that call, so perhaps there was some confusion there.) Regardless, the payer_id does NOT uniquely identify a customer – as in a single, unique individual somewhere out there in the world. A customer could use multiple Paypal accounts, or could make some purchases as a "guest" using a different funding source than their primary Paypal account, and merchants would get different payer_ids for each one – even if the person's name, address, and all other identifying information were exact matches.
For these reasons, it is misleading for Paypal to call the payer_id variable a "Unique customer ID". Unfortunately, that description still persists in their documentation (scroll to the bottom of the "Buyer information variables" section):
https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNandPDTVariables/#id091EB01I0Y4
It's just the id of the user who paid. You have to log it, to be able to give it to Paypal in case of conflict.
Payer_id is just paypal id of who pay the payment.
Email id is dynamic and always change, but payer_id is static.