PayPal - Migrating from OpenID to OAuth - paypal

Using OpenID, PayPal returns the user's id in "openid.identity" field in format: https://www.paypal.com/webapps/auth/user/OPENID_ID
While using the same PayPal account using OAuth2.0 PayPal returns the user's id in "user_id" field in different format (and value): https://www.paypal.com/webapps/auth/identity/user/OAUTH_ID
How can I identify an existing user in my database?
I didn't found any migration plan.
Thanks

Related

PayPal Payouts with encoded user id

I need some help with Paypal Payouts. I am currently using Java SDK and working in sandbox environment.
I am trying to implement a button in my webapp that will enable users to receive monetary awards in their paypal accounts. My first idea was to ask for their email and then - using the SDK create a payout item and send that. All works well, except that when someone types (unintentionally I assume) wrong email, then money are not going to be transferred. That is why I decided that asking the user to login with paypal and then using their paypal id will be much more error-proof.
So I followed the steps described here.
I am successfully able to exchange the authorization code and receive access and refresh tokens. Then I use those to load user info that contains only user_id (login scope is openid).
When I try to create a PayoutItem with recipient type PAYPAL_ID and value - user_id from Userinfo object - the operation is unsuccessful (no error - just the batch result is null).
We do not have and we do not expect to have any transactions from this user - so there is no way to use getTransactionDetails in order to retrieve payer id.
I suspect that user_id is not the correct property to use. However, I cannot find any information on how I can integrate payouts with recipient type PAYPAL_ID combined with paypal login.
Help, please!

Paypal: Mapping API credentials with sandbox credentials

The documentation for paypal adapative api requires the developer to send 6 headers amongst which there are:
X-PAYPAL-SECURITY-USERID : Sandbox-Caller-User-Id
X-PAYPAL-SECURITY-PASSWORD : Sandbox-Caller-Password
X-PAYPAL-SECURITY-SIGNATURE : Sandbox-Caller-Security-Signature
The trouble is I don't know where to find the USERID, PASSWORD and SIGNATURE
In the below screenshot that I took from the Paypal Sandbox Business Account, there is no such thing as USERID, PASSWORD and SIGNATURE. Instead I have Sandbox account, Endpoint, Client ID and Secret.
Screenshot: https://dl.dropboxusercontent.com/u/6599473/Capture.PNG
So which is which? What is the userid? What is the password? and what is the signature?
The screenshot you've provided is for the REST API. UN, PASS, and SIG are for the Classic API.
You can obtain those credentials logging in here with your PayPal account.
You can find more details here.

PayPal API to access trasactional data

I would like to extract transaction data from my customer's PayPal account. He has given me the API username, p/w, and signature. In addition, we created a live 'application' on developer.paypal.com so now I have a ClientID and Secret.
I have the asp.net/c# RestAPiSample code. Which (REST or SOAP) API(s) should I call to get "sales" data (i.e., payments from his customers to his paypal account? Basically I am trying to create some additional reports using the sales data.
Thanks.
Your customer's paypal account credentials can be used with Merchant SDK. You can use the API 'getTransactionDetails' to fetch his customers sales records.
But the new live account you have created (ClientID and ClientSecret) can only be used with the new REST APIs and its is not related to your customers account. If you want your customers sales records you can use the Payment.List(...) method which returns a PaymentHistory object.

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

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.