paul
paul

Reputation: 4487

How to test "Payment Gateway" without making real payments?

I want to perform rigrous testing on Payment Gateway(2checkout) and Pay Pal. For testing, I need to simulate a large number of successful, failed and halted transactions (transaction stopped due to system crash/reboot). But I don't want to make actual payments.

1. Is there any way I can make a test transaction on payment gateway, using fake card numbers or something else.
2. What are the possible advance testing scenarios for Payment Gateway testing?

For example:

  1. Changing the amount, unmask CVV or card from Inspect element.
  2. List item

Upvotes: 0

Views: 8594

Answers (2)

Shubham A.
Shubham A.

Reputation: 2534

I would suggest you only one solution, look at this Git PayPal-Android SDK and go through the README.md file. Last link tells you how to create a sandbox PayPal account to create dummy transactions across your sandboxed account developer account.

If you have doubts, you can refer Part 1 and Part 2 of AndroidHive tutorial for this.

Upvotes: 0

jlouzado
jlouzado

Reputation: 502

There are two options :

  1. Using the PayPal Sandbox (Application Testing), or
  2. Using Dependancy Injection (Unit Testing).

Both would work but I would suggest a Dependancy Injection approach. Assuming you have a separate object that only interacts with PayPal and then other objects that do your actual application logic (and error handling, etc) then you can just create a dummy version of the PayPal interaction object (that always returns true, or conditionally returns false, whatever) and then test your various application classes in detail.

Upvotes: 2

Related Questions