to run the app, make sure you have docker, docker compose and curl installed. then use the following commands:
git clone git@github.com:blackestwhite/zwrapper.git
cd zwrapper
chmod +x ./setup.sh
./setup.sh
docker compose up -d --build
setup.sh
writes your inputs into .env
.
- automatically refresh authority before end-user interaction
- support for webhooks
- multiple consumers
POST /api/v1/admin/newConsumer?username=admin_username&password=admin_password
body:
{
"consumer": "consumer name"
}
on success returns:
{
"ok": true,
"result": {
"message": "token generated successfully",
"consumer": "consumer name",
"token": "uuid access token"
}
}
POST /api/v1/payment/new
access token fetched in consumer creation should be included as a header which name is x-zwrapper-access-token
body:
{
"amount": 10000,
"next": "https://example.com/afterPaymentFailOrSuccess",
"webhook": "https://example.com/afterPaymentSuccessWebhook",
"description": "payment description"
}
on success returns:
{
"ok": true,
"result": {
"id": "payment id"
}
}
GET /api/v1/payment/pay/:id
:id
is the id fetched in payment creation step
POST /api/v1/payment/verify/:id
:id
is the id fetched in payment creation step
access token fetched in consumer creation should be included as a header which name is x-zwrapper-access-token
if paid retuns:
{
"ok": true,
"result": {
"paid": true,
"ref": "ref"
}
}
if not paid returns:
{
"ok": true,
"result": {
"paid": false,
"verified": false,
"ref": "ref",
"status": 123,
"error": "error message"
}
}
- check if vpn/proxy is being used