Skip to content

otono/shift4-api

Repository files navigation

Shift4 API test

1. Build & start docker

make docker-run

OR

cd docker && docker-compose up --build

2. Build application

make install

OR

docker exec -u www-data -it tt-php-fpm build-app.sh

API Doc

http://localhost:8086/api/doc

Charge

List of test cards: https://dev.shift4.com/docs/testing/#test-card-numbers

curl --request POST \
  --url http://localhost:8086/api/charge \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
	"amount": 18.88,
	"currency": "USD",
	"card": {
		"number": "4909069612259316",
		"expMonth": 12,
		"expYear": 2028,
		"cvv": "123"
	}
}'

Refund

curl --request POST \
  --url http://localhost:8086/api/refund \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "chargeId": "char_6hLcejaOGWVqMZXPV7rGX11Z",
  "amount": 1
}'

Testing

docker exec -it tt-php-fpm bash

make tests

About

Shift4 API test task

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors