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

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.

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.

Do site beta test when using PayPal

I am developing a site that uses PayPal for payments. I can test with test accounts using the sandbox. However, I am not sure what to do with the PayPal accounts when doing a beta test. Do I have to create individual sandbox accounts and give them out to the test participants?
Have your participants use a test Credit Card that Paypal provides: http://www.paypalobjects.com/en_US/vhelp/paypalmanager_help/credit_card_numbers.htm
From there they should be able to test your site, and you can check if transaction go through.

Paypal start up testing and managing payment

I am new to Paypal integration to websites. I just created a sand box test account to try and create buttons.
I am trying to make use of Paypal subscription to my website.
Can anyone give some basic information of how can I test and increase my knowledge on Paypal integration to my website.
Thanks
Well, you are going in the right direction. You would want to sign up for a developer account at developer.paypal.com. Once you have your developer account set up, then you would want to log in and create a test sandbox buyer and sandbox account. You can use these accounts to create test subscription buttons and walk through and sign up for the subscription with your buyer account. This will allow you to test with subscriptions in the sandbox.

Drupal Commerce - Paypal Payment

I'm looking for a explanation about how the Paypal Sandbox works. Let's say I have a real Paypal account through which I receive payments and I want to configure it on Drupal Commerce's Paypal module, but also I want to test the payment workflow first before making it live and let my customers use it, I see the Paypal configuration on Drupal has the following options under the "PayPal server" section:
Sandbox - use for testing, requires a PayPal Sandbox account
Live - use for processing real transactions
I assume that if I want to do "dummy" transactions I must enable the "Sandbox" option on the Drupal side so my question is
Is enabling the 'Sandbox' option the only thing I need to do in order to avoid real transactions being charged to my Paypal account? or do I have to create another Paypal account (the Sandbox account) and configure it on the Drupal side instead of my real account?
I was just wondering if the Paypal Payment plugin on Drupal needs a "Sandbox account" (different from my real Paypal account) or if by just enabling the Sandbox option it somehow signals Paypal about it and any transactions are just ignored while that option is enabled.
I'll apreciate if someone clarifies this a bit for me, I'm just starting to develop Paypal related stuff.
Thanks!
I recommend using a sandbox account from here
You cannot test a dummy transaction with a real PayPal account on PayPal Sandbox. It requires Sandbox account. So, you need a Sandbox account AND change the Drupal option to Sandbox for testing.

Using the Paypal sandbox to test an application

I recently set up Paypal payments standard on my web app and things are working fine. I am able to use Paypal sandbox to test and things work the way I expect.
However, I would like to send out the app to my beta testers and allow them to test making payments without actually using their Paypal accounts or credit cards. I can create sandbox merchants and sandbox payees, but that doesn't quite do it. My button send them to sandbox.paypal.com... but when they get there they are asked to log in with a developer/sandbox password. It doesn't just let them login with the test payee account.
I can work around this, but I wanted to see if I was missing something.
Ya this type of situation was not what we intended the sandbox to be used for. Every sandbox account is tied to a developer account so there is no way around this.
You can do your unit testing or test your application in sandbox, and go live to actually have your clients start using it. There was no plan to have your clients test making payments in sandbox.