Adaptive Chained Payments: What are the necessary Credentials to Test in Sandbox? - paypal

We are confused on whether, or not you need special credentials to test Chained payments in Paypal's sandbox. It seems that in order to make adaptive payments in a live environment you need special permission from Paypal, but does testing adaptive payments in the sandbox require these special permissions (credentials)? There is a application page on the developer site to create a new app that intends to use adaptive payments, but this app appears to be for the live environment, and does not mention testing. We wish to test adaptive payments in conjunction with our web application prior to obtaining live permissions. What are the steps to obtain the sandbox credentials to accomplish this, or can this be done with basic credentials?

For sandbox, there is no need for additional permission. Just use the sandbox app ID - APP-80W284485P519543T. You can refer to the documentation below
https://developer.paypal.com/docs/classic/adaptive-payments/gs_AdaptivePayments/

Related

Integration tests with PayPal

I would like to be able to test our integration with PayPal. We have sandbox accounts set up, etc, and I can even create payments. However, I'd like to be able to also issue refunds, query for refunds, and all the other APIs, all via integration tests and without human or even browser involvement. The difficult part seems to be that, of course, the PayPal flow requires someone to interact with a PayPal URL and approve the purchase.
Some more detail : We use the standard e-commerce flow on our site. User shows up, puts a product in a cart, proceeds to buy flow, selects a payment method, in this case PayPal. Of course, in PayPal's case, we create the Payment in PayPal and then simply show the embedded popup of palpal's flow where the user logs into their PayPal account and approves the purchase. PayPal does all this work. We simply get the response that 'yes, the purchase has been approved'.
So.. in an integration test environment, we can create the Payment entity in PayPal but.. how do we, in a sandbox environment integration test, get that payment approved? Is there a developer API available on the sandbox environment that says 'hey, this PayPal user approves this payment' or 'hey, this PayPal user rejects this payment', so that in test code we can simulate the buyer's flow. Or is there a way to set up a sandbox account to just 'auto approve' purchases or 'auto reject' purchases, simply for a test environment?
Yes, you can do anything in the sandbox that you can do on the live servers. This is a very broad question, though, so it's tough to answer.
For example, if you want to process payments without the need for any browser flow you'll need to have a billing agreement setup or a Pro transaction so you can run reference transactions. This would involve Express Checkout APIs and/or Payments Pro APIs, and reference transactions APIs. Depending on whether you're using Classic or REST, though, the API calls would be different.
In any case, once a transaction exists in the PayPal sandbox system you could then use the API to refund it. Same thing, though...you'd either be using REST APIs or Classic.
If you can provide more specifics in your question I can update this answer to be more specific as well.

Braintree sandbox accepts non-existent PayPal accounts?

It seems to me that you can type in any random username/password combination and both the drop-in UI widget and the backend will accept it as a valid PayPal account. The payment will go through and everything.
Is there a way I can set Braintree sandbox to only accept real PayPal accounts?
Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.
The Braintree Sandbox allows you to pass any email address and password you like into the PayPal dialog, as mentioned in Braintree's documentation. You can test with the fake PayPal nonces found on the Testing and Go-Live page, but keep in mind, Braintree didn't actually design the PayPal sandbox for handling end-to-end tests. All PayPal transactions made in the sandbox use the same, fake PayPal account. Because of that, there's no way to configure your Sandbox account to accept real PayPal accounts. We recommend that when you go live, you perform a few low-value sale transactions with each of the payment methods you plan to accept, including PayPal.
You can test cases where the information in a PayPal account is bad in the same way you would test a bad credit card: use one of the fake invalid nonces from our Testing and Go-Live page. If your code is handling those cases correctly, you can be confident that it will be able to handle a PayPal account with bad information as well.

PayPal Adaptive Chained Payments in the sandbox

Chained payments in PayPal Adaptive Payments is documented as only being available with approval: https://developer.paypal.com/webapps/developer/docs/classic/adaptive-payments/integration-guide/APIntro/
Is it possible to use it in the Sandbox without approval to test workflow and code, before submitting an application for approval?
Yes, you can try the API on sandbox without app approval. Just create a sandbox account from developer.paypal.com and use the account's API credentials along withe the special sandbox app id APP-80W284485P519543T.
When you go live, you will have to go through the app approval process to get your own app id

How do I complete registration for a live application on PayPal

I have been using the Express Checkout methods of the PayPal Classic API to allow my site's clients to set up both recurring and one-off payments. Everything works smoothly in my test environment with it pointing to the PayPal sandbox environment.
Now I have been trying to go live. I am following the instructions from https://developer.paypal.com/webapps/developer/docs/classic/lifecycle/goingLive/ which tells me to register my app. I go to https://apps.paypal.com/user/my-account/applications/new and fill in my details, but in the section 'Services used by App' there is nowhere to tick Merchant Services. I'm not using the Adaptive API or Invoicing, but the page won't allow me to submit without filling in something on the Adaptive Payments section. There is no help or guidance on the page.
How do I proceed?
If you're just using Express Checkout and Recurring Payments you won't need to submit an app. The app submission is for people using Adaptive Payment or Adaptive Account API calls.
You should be able to use Express Checkout as long as you have a confirmed and Verified Business PayPal account.

How to safely test code updates in pages involved in online payment?

I've got a client website in production with both PayPal checkout and PayPal pro credit card payments. I need to update the code sometimes, but I want to be 100% sure that the code works. However I can't test it because I'd have to make a real payment for that.
How do you deal with this?
You can run test transactions against the sandbox box and test the different API calls. You would need to set up a developer account at developer.paypal.com. Then create a couple of test accounts such as a seller account and a buyer account. Generate your API credentials for your test seller account. Then plug those into your code, and make test API calls against that account. You can set up your test accounts to mimic your live accounts.