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.
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]
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)
This can be run in a standard way:
sbt run
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
This service supports various payment scenarios.
- Go to http://localhost:9263
- Select the scenario from the dropdown
- Click submit
- 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.
- https://confluence.tools.tax.service.gov.uk/display/OPS/F2F+Payments
- https://confluence.tools.tax.service.gov.uk/display/Payments/Face+to+Face+Payments
- https://confluence.tools.tax.service.gov.uk/display/Payments/smartpay-connect-proxy
- https://confluence.tools.tax.service.gov.uk/pages/viewpage.action?pageId=457442181
This code is open source software licensed under the Apache 2.0 License.