solecoder
solecoder

Reputation: 221

what is the best practice to simulate test payments using actual API call in JAVA

I am doing a Payment Transaction using Payeezy, here is my Payment Request Body.

{
"operation": "Sale",
"tender": "CC",
"accountNumber": "XXXXXXXXXXXX1881",
"accountType": "VISA",
"amount": "79",
"merchantId": "HOM_EZ",
"policyNumber": "19029W0042",
"payerName": "TEST-200",
}

I was thinking to check for the "payerName": "TEST-205" field and check if it starts with TEST, Any number following that will be used to simulate the amount used to test the payment errors shown here.

Bank Response codes

and

Transaction codes
For eg if its TEST-205, I will change the simulation amount to 5207 to get the simulated error as shown in the above link.

I am using a spring boot application, all the apiKey, secretKey is declared in my application.properties which also has to be changed during the simulation.

What is the best practice to do this kind of simulation ?

Upvotes: -1

Views: 975

Answers (1)

LppEdd
LppEdd

Reputation: 21152

Payeezy offers demo accounts to test their payment API, Payeezy Gateway Demo Accounts.

You can then set up integretions tests to carry out API calls automatically.
Certain aspects could even be tested via unit testing, such as the validity of the credit card number.

Upvotes: 2

Related Questions