Testing the PayPal Adaptive Paymemts API in the Sandbox - paypal

I want to simulate a simple scenario with the adaptive API. A seller, buyer and my app.
I created 3 test accounts in the Sandbox website:
Account named buyer - of type Personal.
Account named seller - of type Business.
Account named myApp - of type Business.
I am using the Adaptive Payments C#.Net code samples from paypal developers site. (The code I am using is inside csharp_nv_adaptivepayments.zip , in the Pay.cs file).
I changed sAPIUser, sAPIPassword, sAPISignature to match myApp (From API Credentialns page in SandBox site)
I changed sReceiverEmail to the seller email.
I changed sSenderEmail to the buyer email.
After sending the request to https://svcs.sandbox.paypal.com/AdaptivePayments/Pay ,
and getting the response with sResponse = oStreamReader.ReadToEnd(); I get an OK status and I have a payKey in my hand.
Now, as the AdaptivePayments PDF says (P. 70) I need to redirect the user to
https://www.paypal.com/webscr?cmd=_ap-payment&paykey=value , So I use Response.Redirect() to this url. When the browser loads the page, I get a java script error in:
var sf = new PAYPAL.AP.Subflow();
Stating that "Object doesn't support this action".
I tried to change the url to http://www.sanbox.paypal....paykey=value but then I just get a white page , saying "Please login to use the PayPal Sandbox features."
Also, in both cases i didn't see any payment activity in the seller,buyer logs.
What am I doing wrong here ?

Yaron,
To make Live API calls, you need to obtain a Live APP ID from PayPal,
For making sandbox calls, you need to properly set up the sandbox testing environment, AND be logged in to it beforehand.
This guide explains in detail what you need to do for each case:
Requires x.com free registration
http://www.x.com/servlet/JiveServlet/download/211264-21046/HelloMoney.zip
EDIT
X.com died a while back. I've posted my original files in GitHub:
https://github.com/lmarkus/AdaptivePaymentsExample

Related

Cannot access Paypal Sandbox Accounts

PayPal:
Cant access paypal sandbox - if trying to appraoch directly, you are being redirected to the paypal main site.
If trying to reach the sandbox via the paypal developer site,
browsed to Dashboard>Sandbox>accounts,
(find the facilitator and buyer accounts - which apperently do require decent passwords to work) than press "Click Me" just to fail again by being redirected to a page indicating:
"We're sorry.
Relying party validation error: client_id or redirect_url provided in the request does not match any of the registered clients. Please check the request and try again."
OK, found a way aroudn this.
Problem: For some reason if you are a PayPal user and also wish to use the sandbox (in my case I have a seperate private account and a business account, and the sandbox is used by the busienss account), any attempt to approach the sandbox results in being redirected to paypal main site (at least in my region).
Solution: Use a seperate cognito or private window for the sandbox - never login to you your own account while working with the sandbox, and if you do, restart the browser and get a new private window.

Paypal DG Express Cannot Use Sandbox. Live Account Works Fine

I have a Paypal Digital Goods Express payment form created using their wizard.
When I use our live account it works fine. But when I use the sandbox Business (Seller) account I created, when a user clicks on the 'Buy' button, the popup window appears with only this message:
SetExpressCheckout API call failed. Detailed Error Message: Short Error Message: Error Code: Error Severity Code:
I did some research and saw this article:
https://www.paypal-knowledge.com/infocenter/index?page=content&widgetview=true&id=FAQ1914&viewlocale=en_EN
It suggests that our hosting company needs to update their PHP/TLS, but I did the Curl test and it properly returns a 200 OK.
I also saw this Stackoverflow article:
Paypal "SetExpressCheckout" API method has stopped working with sandbox seller account
...where the problem was the wrong sandbox endpoint, but I've made sure that the endpoint is indeed:
https://api-3t.sandbox.paypal.com/nvp
...and it still doesn't work.
I've tried clearing my browser cache, using different computers to test and all with the same result.
Any ideas?
did you enable Digital Goods feature on your sandbox accounts?
If you have not enabled it on your sandbox account, please contact MTS(Merchant Technical Support)
https://www.paypal-techsupport.com/app/ask
to toggle it for your sandbox account.

PayPal ExpressCheckout - You do not have permission to make this API call

I have integrated a simple online form that demands some input from the user and has the item and pricing information in hidden fields.
After the user verified his inputs he hits the button to pay with PayPal and will be redirected to PP where he can pay instantly.
The PP URL is
https://api-3t.sandbox.paypal.com/nvp
for the sandbox and
https://api-3t.paypal.com/nvp
for the live environment paypemnt.
In the sandbox everything works fine when I use the sandbox credentials. After I set the URLs to live, changing the API credentials to the live credentials I am receiving the error
You do not have permission to make this API call.
I have tested and verified the following:
the PP account is a business account and verified
the form has been checked and approved as PP app by PayPal
the form uses the correct API credentials
set "Accept payments from your shop before configuring an API" to "YES" and saved it with the submit/save button
checked the http request parameter live and they are looking fine
The error occours after sending the parameters from setExpressCheckoutData().
Now I am confused. I've red some infos to set MODE "test" to "live" at the end of the cart but don't know exactly what that means.
Please help.
Found the reason and fixed it.
Removed the parameter "subject" from the request data. If this parameter isn't passed (I think it is necessary for Unipay only) the ExpressCheckout works fine.
In the sandbox it doesn't matter wether to use this parameter or not.

How to set up a PayPal sandbox "Seller" account, a "Buyer" account and an Application Tutorial

I am trying to set up a Web site which is using PayPal. Unfortunately the PayPal developer site/concept is heavily changed, so all tutorials I found are seem to be useless. For example this (very good) youtube tutorial which is very clear is using not existing pages and functions...
So please try to help me only with up to date information/tutorial.
Please note my questions is not about using API, it is about how to set up an app, and a testing sandbox configuration from the ground.
1) As far as I understand I must have a real PayPal account because dev site uses PayPal account for logon (new). Logged in with this account then I can create sandbox accounts. However I would like to create a "Seller" sandbox account and a "Buyer" sandbox account. (missed I something?) Using the new developer site it is not possible. I can create only one kind of sandbox account. In the referenced video there are two types of sandbox accounts: "seller" and "buyer" in the preconfigured accounts. Or "Seller" simply means Business account?
2) I must have an application id to use the API. Note: I inherited a working legacy code which is using the classic API, so no REST please. In the video (old PayPal dev site) there is a left side menu "API and Payment Card credentials" In the new PayPal dev site no such thing. Instead there is a "My Apps".
I've tried to set up an application. It approved automatically. In its metadata I see a live and a sandbox app id.
What is not clear: To what account is associated this newly created app? I've created it logged in with my real paypal credentials.
More: ??? When filling the app creation form there was an input field titled: "Supply Test Account Name and Password". First of all how can I type the name and a password to one input field? Secondly What is it? Maybe if I use this app with its sandbox app id then this account will be the Seller (got the money) and if I change the app id to the live one associated this app, then my real PayPal account got the money?
However my goal was to completely simulate the payment process so
1) Create a Seller sandbox account (got API credentials)
2) Associate an application to that Seller account, and get the app id.
3) Create a buyer sandbox account
4a) Configure my web site with Seller API credentials and sandbox app id
4b) Orchestrate a buy process using my website, PayPal API and the 2 sandbox account
5) Check the Seller and Buyer sandbox account's transactions.
Thanks in advance
Seller account = Business account
Buyer account = Personal account
You probably only need to create one of each in Developer Sandbox Accounts , but there's no limit if your testing requires some more
To obtain the new REST API credentials, create an App in My Apps & Credentials and select the sandbox Business account to use
Legacy APIs: If testing an old integration, you can still get Classic NVP/SOAP credentials for a business account by viewing its "Profile" within your list of sandbox accounts
Just found myself in the same situation. Like you say it seems to be constantly evolving - not even sure if some of the answers here are still up to date.
Walked through it like this:
Login at developer.paypal.com
Go to Applications tab
Click on the Sandbox accounts on the left hand side
Any sandbox accounts you already created will be listed. Big blue button Create Account to create more
Think of logging in to the sandbox with your real PayPal account as logging into your Sandbox. You do this at http://developer.paypal.com.
Once you are logged into your sandbox in the middle of the screen, click on "continue testing using Sandbox test accounts".
When the next screen comes up you will see a heading of Sandbox Test Accounts and to the far right of that a button to Create Account. Click on this and then you need to create a "Personal" buyer account (your sandbox buyer who you will test with) and a "Business" seller account (your sandbox seller who you will test with).
Set up each one of these as if you were setting up a new Paypal account.
When you have them created fully you will have fictitious bank accounts to work with.
Beyond that, you may wish to check out these tutorials http://www.developphp.com/list_php_video.php where the site goes in-depth with setting up PayPal payments on a website using your own custom, basic shopping cart with a PayPal IPN (instant payment notification). You want to scroll down to the "E-Commerce Website Tutorial...". Lessons 9-20 deal with the cart and accepting PayPal. This may be an older way to do things, but it will help you get a general grounding in working with PayPal IMHO.
You also can visit https://developer.paypal.com/webapps/developer/docs/ At the bottom of the column is a heading "Classic API's" that may provide the documentation you are looking for to move forward.
Good Luck!

paypal sandbox merchant account error

I have a website that I'm trying to hook paypal up to with a php script. php builds the query string and then submits to https://www.paypal.com/cgi-bin/webscr with the query string attached. I can verify that this works fine. I haven't processed a payment but it directs to PayPal with the correct quantities and prices, etc.
However when I change to https://www.sandbox.paypal.com/cgi-bin/webscr I get an error when I try to process that says there was a problem with the merchants PayPal account.
I have created several test accounts on PayPal sandbox but from what I can tell looking around it seems I need another merchant account in the sandbox? If so, I don't see how to do this. I'm guessing I need to change the "?business=mycode" portion of the query string but I don't know how to figure out what to change it to...
Anyway I looked around a while and can't find the answer, can anyone help or direct me to another post that answers this (I looked but couldn't find it, or at least didn't understand it if I did)?
When changing back from live to sandbox, all you should need to change if using a non hosted button is the URL to reflect the environment that you are trying to test with and the value of the business variable. This can be set to either your email address of the actual test or live seller account or the merchant id. If you have not already created an account for testing. You can do so by going to PayPal's Developer Site, and creating a developer account. Then once you have done this, you can log into the developer account and go to the Applications tab. Once on this page, click the link for sandbox accounts on the left, and create a preconfigured test seller account. This will generate an email address linked to a test account. This will be the email address that you will need to use. If this doesn't work, can you provide the string that you are submitting over to PayPal or the button code that you are using and I will take a look at it.
There is error in API key for sandbox testing in Paypal... It is due to corrupt key generation which is not properly decoded on sandbox server when you send a purchase request.
I tried using following sandbox public credentials and it works fine for me
username: sdk-three_api1.sdk.com
password: QFZCWN5HZM8VBG7Q
key: A-IzJhZZjhg29XQ2qnhapuwxIDzyAZQ92FRP5dqBzVesOkzbdUONzmOU
however I tried several times using the sandbox merchant account that i have created myself.... but was unable to ACK success.