API calls required to obtain buyer's e-mail - paypal

I'm using PayPal Express checkout with BigCommerce with a sandbox account. Via the BigCommerce API, only one field is supplied, which is also listed via the http://www.sandbox.paypal.com interface as the "Unique Transaction ID" under "Details":
<payment_provider_id>0P192574JB861364C</payment_provider_id>
The orders are going from BigCommerce into an ERP system that, for PayPal Express orders, expects the PayPal username (e-mail) to be provided.
Via the PayPal REST API (or otherwise), is there a way derive the e-mail used during the transaction via the transaction ID?
If so, which API call(s) would be necessary to get the e-mail?
Thanks.

The GetTransactionDetails of the classic NVP/SOAP APIs will let you get the buyer's e-mail with only a transaction ID.
Info is here: https://developer.paypal.com/docs/classic/api/merchant/GetTransactionDetails_API_Operation_NVP/

Related

Can we integrate PayPal payment API using email instead credentials?

We have ecommerce website for multiple stores so seller can connect PayPal by themselves but sometimes they don't know how to get credentials/key, so is there any way to use PayPal email instead API key?
I am using API credentials, but I want to use PayPal email to make it simple.
To set up a simple PayPal checkout for intent:capture payments, you can set a payee object when creating the order. See pay another account for examples.
Other operations will require either the seller's Client ID and Secret, or permissions for a third-party integration.

Validate PayPal Client id

I have been trying to validate Paypal client id but I didn't landed to any solution from Paypal documentation and also from other sources.
Anyone please help me if there is any API to validate Paypal's Client id.
You may want to look at PayPal Adaptive Accounts API. You can use GetVerifiedStatus API Operation to determine whether the specified PayPal account's status is verified or unverified.

Paypal Client Website Payment Options

Currently we are using Paypal's REST API to setup a paypal payment process on our client's website.
Our webcontrol sits inside an iframe on their website and it is from this control the the paypal process is started and processed. Currently that works ok.
The issue we have is that this requires each customer of ours to have a business account (which is required any way we go so that bit is ok) but they then need to go the developer portal on their account and setup a an App ClientID and Secret (which is the bit we are hoping to do without to make it as simple as possible for our customers).
I have noticed solutions like wix.com offer paypal integration to their customers and only require the email address of their customer's paypal account and they handle the rest of the setup from there automatically.
I am just looking for some guidance on which product in Paypal's range should I be looking at to implement the same sort of solution setup for our customers?
Your observation is correct: the REST API service does not (currently) support placing API Calls for other users.
Alternatives:
Classic API: You can call the API in the name of a customer (who first needs to grant your API user access to his account) by passing the "SUBJECT=E-Mail Address" Variable. Usually used in conjunction with Express Checkout - see: https://developer.paypal.com/webapps/developer/docs/classic/express-checkout/ht_ec-singleItemPayment-curl-etc/
If you want to go this route, you may want to look into the permission service API under https://developer.paypal.com/docs/classic/products/permissions/ - it allows you to programmatically request the required permissions from a seller.
Adaptive Payments:
Often used by market places, we're dealing with 3 parties within Adaptive Payments:
a. API Caller --> The API caller placing the API calls and receiving all infos
b. The sender --> The person sending money to one or more recipients
c. The receiver(s) --> One or more receivers of the payment. As Adaptive Payments is pretty much using PayPals "Send Money" functionality, no further permissions need to be requested from the receivers.
See: https://developer.paypal.com/webapps/developer/docs/classic/adaptive-payments/integration-guide/APIntro/
Website Payments Standard: Just add a different e-mail address to the "business" variable and you're done.
See: https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/cart_upload/

Paypal Subscription Details

Can you help me. I need to know if PayPal has an API call to get subscription details like the enddate of the subscription?
I do the request to PayPal and get the response,
SUCCESS
transaction_subject=Name20
payment_date=10%3A42%3A50+Mar+28%2C+2014+PDT
txn_type=subscr_payment
subscr_id=I-MWMMATTBSY2M
last_name=jls
....
but I need details from suscription as enddate.
Sounds like you're using Standard Subscriptions and the "response" you're referring to would be an Instant Payment Notification (IPN)..??
Unfortunately, the standard subscriptions system doesn't have any API's to access details directly. You could switch to Express Checkout and the Recurring Payments API, though, and this would give you access to API's to obtain details and manage the profiles programatically.
If you're working with PHP you can setup Express Checkout and Recurring Payments very easily using my class library for PayPal.
The flow you'll be setting up would be as follows...
1) Call SetExpressCheckout to obtain a token and redirect the user to PayPal. The SEC request will also include a ReturnURL which is where PayPal sends the user after they've signed in and agreed to continue. You also need to make sure to include the Billing Agreement parameters in your SEC request so that the token you get will be compatible with recurring payments.
2) The user ends up back at your ReturnURL, and this is where you'll call GetExpressCheckoutDetails to obtain details about the buyer that the system now knows since they've signed in. This gives you info like the payer's name, email, address, etc. It also gives you the Payer ID you'll need for the final request.
3) Right after obtaining the details via GECD you'll call CreateRecurringPaymentsProfile to finalize the subscription profile creation.

Paypal Classic API: Test accounts

I need to simulate a buyer transaction in my paypal sandbox environment. Essentially, a buyer is a user that decides to subscribe to my service, which is done using the Paypal NVP API method: DoDirectPayment.
Reading the documentation, I gather that a buyer in this case will essentially be a Personal account, and basically to make any kind of api call, I require API credentials. However, the PAYPAL Developer website does not show any kind of API credentials for this personal account :
I do have a business account, and that does state the corresponding API credentials. The link I am referring to is :
https://www.x.com/developers/paypal/documentation-tools/ug_sandbox#credentials
where it states that the API credentials are specified for all accounts.
The only rationale I have behind this are :
a) personal accounts do not get API credentials,
b) I need to simulate a DoDirectPayment API with my business account API credentials, but documentation states that to simulate a buyer transaction I must use a personal account.
c) I need to set API credentials manually somehow.
Any leads?
You would use your API credentials from your business account in the API call. As for the buyer, you would not be paying with a PayPal account if you are using the DoDirectPayment API. You would be using a credit card. You should be able to use any of the card numbers below to test with. I juse use a Mod 10 check to generate the card numbers. You can just use any valid future date for the exp date, and use 123 for the card security code.
Visa
4539261585419872
4532063588063153
4024007125711126
4916126222581496
4916335290325039
4929693226575720
4916573003035640
4485204470227566
4024007102338976
4024007148183980