Mock Server
How to compile
- Put sample code to {YOUR_GO_PATH}/github.com/cybavo/SOFA_MOCK_SERVER
- Execute
- go mod vendor
- go build ./mockserver.go
- ./mockserver
Setup configuration
Configure CYBAVO API server URL in mockserver.app.conf
api_server_url="BACKEND_SERVER_URL"
Put wallet API code/secret into mock server
- Get API code/secret on web control panel
- API_CODE, API_SECRET, WALLET_ID
- Put API code/secret to mock server’s database
- For the read-only API code/secret, use wallet ID
0
to register.
curl -X POST -H "Content-Type: application/json" -d '{"api_code":"API_CODE","api_secret":"API_SECRET"}' \
http://localhost:8889/v1/mock/wallets/{WALLET_ID}/apitoken
Register mock server callback URL
Operate on web control panel
Notification Callback URL
http://localhost:8889/v1/mock/wallets/callback
Withdrawal Authentication Callback URL
http://localhost:8889/v1/mock/wallets/withdrawal/callback
The withdrawal authentication callback URL once set, every withdrawal request will callback this URL to get authentication to proceed withdrawal request.
Refer to WithdrawalCallback() function in mock server OuterController.go