GOV.UK Pay Card Type Identification Service
Switch branches/tags
approved-alpha_staging-10 approved-alpha_staging-1-24 approved-alpha_staging-1-23 approved-alpha_staging-1-22 approved-alpha_release-41 approved-alpha_release-40 approved-alpha_release-39 approved-alpha_release-38 approved-alpha_release-36 approved-alpha_release-35 approved-alpha_release-34 approved-alpha_release-33 approved-alpha_release-32 approved-alpha_release-31 approved-alpha_release-30 approved-alpha_release-29 approved-alpha_release-28 approved-alpha_release-27 approved-alpha_release-25 approved-alpha_release-24 approved-alpha_release-23 approved-alpha_release-22 approved-alpha_release-14 approved-alpha_release-10 alpha_test_staging-1 alpha_test_release-1 alpha_test_production-1 alpha_staging-10 alpha_staging-4 alpha_staging-3 alpha_staging-2 alpha_staging-2-72 alpha_staging-2-71 alpha_staging-2-70 alpha_staging-2-68 alpha_staging-2-67 alpha_staging-2-64 alpha_staging-2-63 alpha_staging-2-62 alpha_staging-2-61 alpha_staging-2-57 alpha_staging-2-53 alpha_staging-2-52 alpha_staging-2-49 alpha_staging-2-48 alpha_staging-2-46 alpha_staging-2-45 alpha_staging-2-44 alpha_staging-2-41 alpha_staging-2-40 alpha_staging-2-39 alpha_staging-1-39 alpha_staging-1-38 alpha_staging-1-35 alpha_staging-1-34 alpha_staging-1-30 alpha_staging-1-29 alpha_staging-1-27 alpha_staging-1-25 alpha_staging-1-24 alpha_staging-1-23 alpha_staging-1-22 alpha_staging-0-20 alpha_staging-0-14 alpha_release-72 alpha_release-71 alpha_release-70 alpha_release-69 alpha_release-68 alpha_release-67 alpha_release-66 alpha_release-65 alpha_release-64 alpha_release-63 alpha_release-62 alpha_release-61 alpha_release-60 alpha_release-59 alpha_release-58 alpha_release-57 alpha_release-56 alpha_release-55 alpha_release-54 alpha_release-53 alpha_release-52 alpha_release-51 alpha_release-50 alpha_release-49 alpha_release-48 alpha_release-47 alpha_release-46 alpha_release-45 alpha_release-44 alpha_release-43 alpha_release-42 alpha_release-41 alpha_release-40 alpha_release-39 alpha_release-38 alpha_release-37
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.github
data @ 9325ede
src
.dockerignore
.editorconfig
.gitignore
.gitmodules
CONTRIBUTING.md
Dockerfile
Jenkinsfile
LICENSE
README.md
build-local.sh
docker-startup.sh
env.sh
pom.xml

README.md

pay-cardid

GOV.UK Pay Card information service

The service provides an API that could be accessed to retrieve card information for a given card number.

Environment Variables

  • WORLDPAY_DATA_LOCATION: Variable to override the default path for the card bin range data provided by Worldpay.
  • DISCOVER_DATA_LOCATION: Variable to override the default path for the card bin range data provided by Discover.
  • TEST_CARD_DATA_LOCATION: Variable to override the default path for the test card bin range data.

Card data

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:

Worldpay

Location: /data/sources/worldpay Format: csv

  • The csv file is expected to have the following structure, as of WordlPay EMIS v19 document
00!12102015!!!!!!!!!!
05!511949000!511949999!CN!ELECTRON!SAMPLE COMP PLC!GBR!826!D!PE000!XE000!Y
99!1!!!!!!!!!!
  • Legend:
    • 00 - header
    • 05 - data record
    • 99 - EOF

Discover

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
  • Legend:
    • 01 - header
    • 02 - data record
    • 09 - EOF

Test Card Data

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
  • Legend:
    • 01 - header
    • 02 - data record
    • 09 - EOF

API Specification

POST /v1/api/card

Returns information for a given card number.

Request example

POST /v1/api/card
{
    "cardNumber": "1234567812345678"
}

Payment response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "brand": "visa",
    "type": "D",
    "label": "visa"
}

Licence

MIT License

Responsible Disclosure

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.