Giter Club home page Giter Club logo

hmcts.ia-case-payments-api's Introduction

IA Case Payments API

Background

ia-case-payments-api allows Immigration and Asylum workflow to check fees and make a payment for an appeal based on chosen type of hearing during appeal submission. There are exceptions based on Business logic when payment can be done after appeal is submitted. All interactions with Fees and Payment system are encapsulated within this service.

Prerequisites

To run the project you will need to have the following installed:

  • Java 11
  • Docker (optional)

For information about the software versions used to build this API and a complete list of it's dependencies see build.gradle

Running application

ia-home-office-integration-api is common Spring Boot application. Command to run:

./gradlew clean bootRun

Testing application

Unit tests and code style checks:

./gradlew clean build

Integration tests use Wiremock and Spring MockMvc framework:

./gradlew integration

Functional tests use started application instance:

./gradlew functional

In order for these tests to run successfully you will need its dependencies to be running.

There is a need to run ia-docker service stack to provide OpenId authentication and Wiremock recorded responses for Professional Ref Data, Fees service and Payment service.

To successfully interact with the above dependencies a few environment variables need to be set as below.

Environment Variable Example values
TEST_LAW_FIRM_A_USERNAME [email protected]
TEST_LAW_FIRM_A_PASSWORD password
TEST_LAW_FIRM_ORG_SUCCESS_USERNAME [email protected]
TEST_LAW_FIRM_ORG_SUCCESS_PASSWORD password
TEST_LAW_FIRM_ORG_DELETED_USERNAME [email protected]
TEST_LAW_FIRM_ORG_DELETED_PASSWORD password
IA_IDAM_CLIENT_ID some-idam-client-id
IA_IDAM_SECRET some-idam-secret
IA_IDAM_REDIRECT_URI http://localhost:3451/oauth2redirect
IA_S2S_SECRET some-s2s-secret
IA_S2S_MICROSERVICE some-s2s-gateway
FEES_REGISTER_API_URL http://localhost:8991
PAYMENT_API_URL http://localhost:8991
PROF_REF_DATA_URL http://localhost:8991

If you want to run a specific scenario use this command:

./gradlew functional --tests CcdScenarioRunnerTest --info -Dscenario=RIA-3271

Running smoke tests:

If the API is running (either inside a Docker container or via gradle bootRun) you can run the smoke tests as follows:

./gradlew smoke

Using the application

To understand if the application is working, you can call it's health endpoint:

curl http://localhost:8096/health

If the API is running, you should see this response:

{"status":"UP"}

Usage

API details about usages and error statuses are placed in Swagger UI

Implementation

ia-case-payments-api has 2 endpoints which are equivalent for CCD callbacks phases. Payload is a standard CCD record. Based on the event request is dispatched to proper handlers and Business logic is applied.

Authentication is defined as any other Reform application with Idam Authorization token and S2S ServiceAuthorization token.

Business logic and validation have to be implemented in dedicated handler. ia-case-payments-api has three main handlers which are responsible for integration with downstream services.

Downstream services are listed below:

  • Fees service
  • Professional Ref Data
  • Payment service

License

This project is licensed under the MIT License - see the LICENSE file for details

hmcts.ia-case-payments-api's People

Contributors

makowalski avatar burale avatar tarun-palisetty avatar lee365 avatar raghera avatar bradsorour avatar hsjhita avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.