This is a coding challenge for payment.
You can start the unit test by executing startunittest.sh
.
The unit test environment is in Dockerfile.unittest
.
This project uses Gin, Protocol Buffers, and zap.
The database is mysql 5
.
The public structure definition uses Protocol Buffers, see proto/payment.proto.
The front end can use it.
The database script is in sql/ccpayment.sql
.
You can build and deploy with Dockerfile
.
You can build and deploy with builddocker.sh
and startdocker.sh
.
You need to configure cfg/config.yaml
first.
We did not support https in the project, you can configure it in nginx.
About the numeric type of currency, we use int64 instead of floating point numbers.
For example, USD, 100 units means 1 US dollar.
There is no calculation fee for this version.
You can see the payment logic in model/paymentdb.go
.