GOV.UK Pay Card information service
The service provides an API that could be accessed to retrieve card information for a given card number.
ADMIN_PORT
: The port number to listen for Dropwizard admin requests on. Defaults to8081
.DISCOVER_DATA_LOCATION
: The URL to load bin ranges for Discover cards from. Defaults tofile:///app/data/discover/Merchant_Marketing.csv
.JAVA_OPTS
: Options to pass to the JRE. Defaults to-Xms1500m -Xmx1500m
.METRICS_HOST
: The hostname to send graphite metrics to. Defaults tolocalhost
.METRICS_PORT
: The port onMETRICS_HOST
to send graphite metrics to. Defaults to8081
.PORT
: The port number to listen for requests on. Defaults to8080
.TEST_CARD_DATA_LOCATION
: The URL to load bin ranges for test cards from. Defaults tofile:///app/data/test-cards/test-card-bin-ranges.csv
.WORLDPAY_DATA_LOCATION
: The URL to load the Worldpay bin range data from. Defaults tofile:///app/data/worldpay/GENERIC2ISOCPTISSUERPREPAID.CSV
.
The data for this service would need to be sourced externally from relevant providers. The service currently supports data provided by:
- Worldpay
- Discover
For the service to built and run the relevant data from the supported providers would need to be placed in the appropriate
location under the data
folder as follows:
Location: /data/sources/worldpay Format: csv
The csv file is expected to have the following structure, as of Worldpay EMIS v19 document
00!12102015!!!!!!!!!!
05!511949000!511949999!CN!ELECTRON!SAMPLE COMP PLC!GBR!826!D!PE000!XE000!Y
99!1!!!!!!!!!!
Key | Meaning |
---|---|
00 | Header |
05 | Data record |
99 | EOF |
Location: /data/sources/discover Format: csv
Since the data from discover is in pdf format, the services expects it to be converted into a csv format. The csv file is expected to have the following structure.
01,START,END,TYPE,BRAND
02,12345678,12345679,C,DISCOVER
09
Key | Meaning |
---|---|
01 | Header |
02 | Data record |
09 | EOF |
Location: /data/sources/test-cards Format: csv
The data is a manual collection of test cards provided by our API documentation, converted into a csv format. The csv file is expected to have the following structure:
01,START,END,TYPE,BRAND
02,123456789,123456789,C,VISA
09
Key | Meaning |
---|---|
01 | Header |
02 | Data record |
09 | EOF |
Returns information for a given card number.
POST /v1/api/card
{
"cardNumber": "1234567812345678"
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"brand": "visa",
"type": "D",
"label": "visa"
}
GOV.UK Pay aims to stay secure for everyone. If you are a security researcher and have discovered a security vulnerability in this code, we appreciate your help in disclosing it to us in a responsible manner. We will give appropriate credit to those reporting confirmed issues. Please e-mail gds-team-pay-security@digital.cabinet-office.gov.uk with details of any issue you find, we aim to reply quickly.