Sample Golang application with stripe payment
- Start backend
make start_back
(to stop runmake stop_back
) - Start frontend
air
- you can run both using single command
make start
ormake stop
for stopping - open browser
http://localhost:4001/api/payment-intent
to test backend - open browser
http://localhost:4000/virtual-terminal
to test frontend - do some test (see https://stripe.com/docs/testing)
- check your stripe dashboard (https://dashboard.stripe.com/test/payments)
- for login testing use credentials
admin@example.com
andpassword
- build mysqldb with docker
docker-compose -p mysql -f ./docker-compose.yml up -d
- connect to db using root user
- run query
GRANT ALL ON widgets.* TO 'ananto'@'%' IDENTIFIED BY 'secret'
orCREATE USER 'ananto'@'%' IDENTIFIED BY 'secret'; && GRANT ALL PRIVILEGES ON widgets.* TO 'ananto'@'%';
for newest version
- Opsi 1
- seed database using
go run ./cmd/seed/*.go
- test widget api
http://localhost:4001/api/widget/1
- Opsi 2
- run
soda migrate
- if database failure to save transaction, we should cancel the order
- if one of database saving process fail, we should rollback the transaction
- parse int amout: input 12.345 shall output 12.34
- input email should be lowercase
- Error
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'addEventListener')
at paginator (all-sales:177:28)
at all-sales:241:17