Skip to content

hmrc/smartpay-connect-stub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About smartpay-connect-stub

The smartpay-connect-stub is a stub microservice used in the Face to Face (F2F) service. It emulates a group of Barclaycard related systems involved in taking a card payment. Those are smartpay-connect-proxy and smartpay-connect, connected to a pin enabled device (PED). This service emulates the user interaction with the PED. Various scenarios can be chosen, which define user behaviour for successful and unsuccessful payments.

Architecture

A browser gets the page from face-to-face-frontend. This page runs javascript which calls a websocket on the stubs:

graph TD
A(Browser) -->|GET page with javascript| F2F(face-to-face-frontend)
A <-->|rest API| B[smartpay-connect-stub]
Loading

The sequence diagram:

sequenceDiagram
participant B as BrowserJavascript
participant SPCS as smartpay-connect-stub

    B->>SPCS: send request (spc message as a body)
    SPCS->>B: receive response (list of 1-n messages)
Loading

How to run

Using sbt

This can be run in a standard way:

sbt run

Using service manager

To run the stub alone:

sm --start SMARTPAY_CONNECT_STUB

To run all F2F services including this service there is a F2F_ALL profile:

sm --start F2F_ALL

Scenario configuration

This service supports various payment scenarios.

  1. Go to http://localhost:9263
  2. Select the scenario from the dropdown
  3. Click submit
  4. Start a face to face journey by going to http://localhost:9260/face-to-face/start

The default scenario is 'success with chip@pin'. When you want to select a different path, you will need to set it each time by following the configuration steps above.

Other documentation

License

This code is open source software licensed under the Apache 2.0 License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 10

Languages