Skip to content

Commit

Permalink
Merge pull request #1220 from alphagov/pp-12487/remove_data_submodule
Browse files Browse the repository at this point in the history
PP-12487 remove data submodule now it is no longer required
  • Loading branch information
nlsteers authored May 22, 2024
2 parents 675e4aa + 0e04e70 commit 4085f86
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 45 deletions.
4 changes: 0 additions & 4 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ EXPOSE 8081

WORKDIR /app

COPY --from=builder /home/build/data/sources /app/data
COPY --from=builder /home/build/target/*.yaml .
COPY --from=builder /home/build/target/pay-*-allinone.jar .

Expand Down
82 changes: 44 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,79 +2,82 @@

GOV.UK Pay Card information service

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

## Environment Variables

- `ADMIN_PORT`: The port number to listen for Dropwizard admin requests on. Defaults to `8081`.
- `DISCOVER_DATA_LOCATION`: The URL to load bin ranges for Discover cards from. Defaults to `file:///app/data/discover/Merchant_Marketing.csv`.
- `JAVA_OPTS`: Options to pass to the JRE. Defaults to `-Xms1500m -Xmx1500m`.
- `PORT`: The port number to listen for requests on. Defaults to `8080`.
- `TEST_CARD_DATA_LOCATION`: The URL to load bin ranges for test cards from. Defaults to `file:///app/data/test-cards/test-card-bin-ranges.csv`.
- `WORLDPAY_DATA_LOCATION`: The URL to load the Worldpay bin range data from. Defaults to `file:///app/data/worldpay/WP_341BIN_V03.CSV`.
- `ADMIN_PORT`: The port number to listen for Dropwizard admin requests on. Defaults to `8081`.
- `JAVA_OPTS`: Options to pass to the JRE. Defaults to `-Xms1500m -Xmx1500m`.
- `PORT`: The port number to listen for requests on. Defaults to `8080`.
- `TEST_CARD_DATA_LOCATION`: The path to load bin ranges for test cards from. Defaults
to `classpath:/data-sources/test-cards.csv`.
- `WORLDPAY_DATA_LOCATION`: The path to load bin ranges for Worldpay from. Defaults
to `classpath:/data-sources/worldpay-v3.csv`.
- `DISCOVER_DATA_LOCATION`: The path to load bin ranges for Discover cards from. Defaults
to `classpath:/data-sources/discover.csv`.

## Card data
The data for this service would need to be sourced externally from relevant providers.
The service currently supports data provided by:

The data for this service is sourced externally from supported 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:
For the service to build and run, BIN range data from the supported providers should be available in the `data-sources`
folder:

### Worldpay

Location: /data/sources/worldpay
Location: `/resources/data-sources/worldpay-v3.csv`
Format: csv

The csv file is expected to have the following structure, as of Worldpay EMIS v19 document
The csv file should have the following structure.

00!12102015!!!!!!!!!!
05!511949000!511949999!CN!ELECTRON!SAMPLE COMP PLC!GBR!826!D!PE000!XE000!Y
99!1!!!!!!!!!!
00,20240122,611649,,,,,,,,,,,,,,,,,,,,,
01,999999999999999998,999999999999999999,CN,MASTERCARD CREDIT,APERTURE SCIENCE INC.,BRA,76,BRAZIL,C,BRL,DCC allowed,AC000,N,N,,16,D,,,,,,
99,611648,,,,,,,,,,,,,

|Key|Meaning |
|---|-----------|
|00 |Header |
|05 |Data record|
|99 |EOF |
| Key | Meaning |
|-----|-------------|
| 00 | Header |
| 01 | Data record |
| 99 | EOF |

### Discover

Location: /data/sources/discover
Location: `/resources/data-sources/discover.csv`
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.
Data from Discover is in pdf format and should be converted to csv. The csv file should have the following structure.

01,START,END,TYPE,BRAND
02,12345678,12345679,C,DISCOVER
09

|Key|Meaning |
|---|-----------|
|01 |Header |
|02 |Data record|
|09 |EOF |
| Key | Meaning |
|-----|-------------|
| 01 | Header |
| 02 | Data record |
| 09 | EOF |

### Test Card Data

Location: /data/sources/test-cards
Location: `/resources/data-sources/test-cards.csv`
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:
The data is a manual collection of test cards provided by our API documentation, converted into a csv format. The csv
file should have the following structure:

01,START,END,TYPE,BRAND
02,123456789,123456789,C,VISA
09

|Key|Meaning |
|---|-----------|
|01 |Header |
|02 |Data record|
|09 |EOF |
| Key | Meaning |
|-----|-------------|
| 01 | Header |
| 02 | Data record |
| 09 | EOF |

## API Specification

Expand Down Expand Up @@ -107,4 +110,7 @@ Returns information for a given card number.

## Vulnerability 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. Please refer to our [vulnerability disclosure policy](https://www.gov.uk/help/report-vulnerability) and our [security.txt](https://vdp.cabinetoffice.gov.uk/.well-known/security.txt) file for details.
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. Please refer to
our [vulnerability disclosure policy](https://www.gov.uk/help/report-vulnerability) and
our [security.txt](https://vdp.cabinetoffice.gov.uk/.well-known/security.txt) file for details.
1 change: 0 additions & 1 deletion data
Submodule data deleted from bf0193
1 change: 0 additions & 1 deletion m1/arm64.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ EXPOSE 8081

WORKDIR /app

COPY --from=builder /home/build/data/sources /app/data
COPY --from=builder /home/build/target/*.yaml .
COPY --from=builder /home/build/target/pay-*-allinone.jar .

Expand Down

0 comments on commit 4085f86

Please sign in to comment.