Validate an email is linked to a valid PayPal account - paypal

Is there an ability to verify if the the user has a valid email address linked to the PayPal account
and also if possible to check if this account has Grant API permission (toward my account) to process Refund API?
Profile to refund is Payment profile is created through AdaptivePayment Pay API call.
I was wondering if this is possible through an API call?
Thanks

You can use PayPal GetVerifiedStatus API Operation will check for the verified status of the paypal account. You can also use Permissions API Operation to explicitly get/check the permissions granted for the specific PayPal account.

Related

PayPal refund permissions for custom payee

I have the following flow -
A buyer makes a payment, I add a customer payee on the client, pass the orderId to the server and capture the transaction on the server.
Can I do a refund in this case?
using the following API I get "PERMISSION_DENIED"
https://api.sandbox.paypal.com/v2/payments/captures/0NA021645B5069646/refund
description: "You do not have permission to access or perform operations on this resource."
What am I doing wrong?
You don't have permission to refund payments from someone else's account.
They need to grant the permission to your API caller account.
Once granted, for that particular v2 refund call you'll need to construct and pass a PayPal-Auth-Assertion header, documented here: https://developer.paypal.com/docs/api/reference/api-requests/#http-request-headers

How to use X-PAYPAL-AUTHORIZATION to handle payments on behalf of other users in PayPal with out knowing user's email address

We are developing a marketplace webapp which charges customers on behalf of sellers.
After reading through PayPal's API documentation, the only solution seems to be the Permissions service.
According to the documentation. After retrieving the access token and token secrete of a seller through the RequestPermissions call, we generated X-PAYPAL-AUTHORIZATION header to initiate an express checkout payment id. However, the payment id generated is associated with our PayPal account instead of the seller's, which is not the anticipated behavior.
Adding seller's email address in the SUBJECT field as noted in PayPal Name-Value Pair API Basics does work, but as we tested it, it has nothing to do with the access token and token secrete.
The problem with the SUBJECT field is that we cannot make sure the seller's email address with us is the one PayPal have on file.
The GetBasicPersonalData permission seems to be able to get a valid email address, but that needs to be pre-approved by PayPal. In fact, I have come across many websites that does not require this permission but able to initiate payment on behalf of other users. Is there a way to just get sellers' email or PayPal Id without GetBasicPersonalData permission? We don't actually need any other personal data except email or PayPal Id.

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

How to check if a PayPal email address has given the Grant API permission to us?

I am a API caller (in adaptive payment), I want to verify if a given email address has granted the API permission to
process the Refund API off their account.
It would be nice to have an API call to check this.
Thanks
Use Permissions API which will allow you to explicitly set the third-party API grant and check it.

What username/password/signature should I be using for the PayPal Sandbox?

I'm trying to refund transactions using the Paypal NVP API. I've got some payments in a sandbox account, but when I try to issue a refund though the API I get You do not have permissions to make this API call. But I'm not sure what credentials I should be using.
According to the documentation, it says:
To access the PayPal API, you need API credentials, either an API
signature or API certificate, that identify you. Use the following
sample API signature and password in your sample programs that run in
the PayPal Sandbox test environment.
API username sdk-three_api1.sdk.com
API password QFZCWN5HZM8VBG7Q
API signature A‑IzJhZZjhg29XQ2qnhapuwxIDzyAZQ92FRP5dqBzVesOkzbdUONzmOU
I tried generating API credentials for the sandbox merchant account that's issuing the refunds, but the Paypal website crashes every time I try. Are these the correct credentials? What do I need to do to test this?
Your test accounts do not have credentials.
To get started with Payment Card in Sandbox, you must first create a buyer test account and enable in-store checkout.
After login sandbox you will find that option in menu API and Payment Card Credentials
and then click it you will get option Create Test Account and after create account you will get API Username, API Password and Signature.
Use those API Username, API Password and Signature in your application.
I found these details in my account after logging in:
go to the sandbox tab
below this you will find Accounts. Click on Accounts.
All your email lists will be shown.
Click on the email id that belongs to the Business account.
You will see two options: profile and notifications below the email id's.
After clicking on profile one window will pop up with name Account details.
In that you will see the tab API Credentials. In this you will find your username, password and signature. Please note : You will find these details only in your Business type account, not for buyer type.