M
M
Micro Null2021-02-20 08:34:32
Software testing
Micro Null, 2021-02-20 08:34:32

Best practice for full cycle business process testing with rest api, acquiring and webhooks?

There was a problem on an old legacy project. When making changes in the code or additional functionality, one of the links in the business process fell off / changed.

We want to write a test that will simulate the whole process, checking the result of each stage, taking into account the data from the previous one.

What is the best way to implement such a test? What are the appropriate tools and practices?

I will describe more specifically in stages what happens in the system. Each step needs to be tested to make sure everything goes as planned.
1. A certain client application creates an order through the rest api and receives a link for payment.
1.1. Depending on the type of client, we select the desired service with suitable tariffs / commissions and turn to the required acquiring (there may be several of them, they can be switched, there may be a coin, a savings account, etc.).
1.2. We create an order, get a link from the acquiring.
2. The client makes a payment on the acquiring page. Apparently here it is necessary to implement using a functional test.
3. We receive a request from the acquiring company with payment confirmation. At the same time, other types of requests (pings, statuses, errors) can also be sent from acquiring, they must all be filtered and checked which of them are payment confirmations and which are garbage.
3.1. We check the signature. The signature is associated with the order id and the client id.
4. We mark the order as paid. We make sure that the system has accepted and started processing the operation by checking substatuses.
5. We send our webhook to another client web application.
5.1. We form our signature.
5.2. The third party client application matches the response with the generated order, verifies the signature, makes sure it exists, and returns a successful response.

It is necessary to take into account in the test that each stage goes sequentially. So that there are no duplicates. So that webhooks at the fifth stage are not sent without payment confirmation.

In the same way, there is a process for processing erroneous payments (an error occurred at the acquiring during the payment) and returns.

Now I am writing a container and emulator applications for client applications. Which will rise to gitlab with each release and automatically run tests.

Due to the fact that I have little experience, I decided to ask a question on this resource. What is the best way to solve this problem? What to read, in which direction to move? Maybe there are some examples.

What type of testing to apply? Is it possible to combine several (modular and functional)?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question