#Credit Card Image Generator
This service generates credit card image for a given credit card number, expiry date and card holder name.
Generated image can be used as an image in documentation, for OCR recognition test purposes or for any other kind of use cases where it can be of help.
To start the service you can use gradle:
./gradlew run
By default service will start on port 5050.
To generate a card with a random card number simply go to: http://localhost:5050/card
You can customize values displayed on the card:
To generate card with specific card number append the card number after the full url. For example: http://localhost:5050/card/1234567890123456 Card number can have any length between 1 and 19 digits.
To use specific expiry date use query parameter expiry
.
For example, to have expiry date 11/21
printed on a card, use the following path: /card/?expiry=11/21
.
You can also specify card holder first and last name. To do this use name
and lastname
query parameters respectively. For example card/?name=John&lastname=Smith
.
You can specify the width of the final output image using width
query parameter.
For example, to have a card of size 500px
use the following uri: /card/?width=500
.
Maximum allowed size 1000px
, the smallest card you can generate is 200px
.
Let's say you want to generate a card that has the following data printed on it:
- card number
1234 5678 9012 3456
- expiry date
11/21
- card holder name
John Smith
The url that will allow you to generate an image with specified data is:
http://localhost:5050/card/1234567890123456?expiry=11/21&name=John&lastname=Smith
The result will be as follows:
To run service inside separate docker container use the following commands:
$ cd card-generator
$ docker build -t card-generator .
$ docker run -d -p 8080:5050 --name card-generator card-generator
This will start card generation service on port 8080
of the host.