Checkout

This is a test API service built on top of .Net Core Framework 3.1.

The implementation applies the Mediatr pipeline with a command query pattern as shown below:

Checkout Api

Requests validation has been decoupled by using FluentValidation.

For test purpose, data will be stored in memory by using Entity Framework Core InMemory.

Application telemetries recorded by using Microsoft.ApplicationInsight.AspNetCore.

Project dependencies

Usage

Running the API project locally will launch the Swagger client exposing 5 endpoints as shown below:

swagger client

Each endpoint exposes its request/response schema.

An example of test flow could be:

  1. Submit one or more Transactions via the ../api/beta/transactions endpoint.
  2. Use the merchantId from previous response to invoke the ../api/beta/merchants/{id}/transactions and fetch all its transactions (successful and non).
  3. Use the transactionId from previous response to invoke the ../api/beta/transactions/{id}/ and fetch the transaction detail.
  4. After playng around with above endpoints, youcan try out and have a look at telemetries fetched by Azure Application Insights:
    • ../api/beta/Telemetries/events/all/top/10 to check out what kind of events have bee recored.
    • ../api/beta/Telemetries/requests/count to check out how many requests have been submitted.

Notes

The Transactions validation will be apllied using the response codes listed at Checkout testing page via a mocked service.