Payments microservice for Ubademy
This service manages:
- SmartContract deployment in kovan network
- User Wallets
- Transactions from the SmartContract
For further information visit Ubademy Payments
Check out the SmartContract in Etherscan!
API deployed at: ubademy-service-payments 🚀
Directory structure (based on Onion Architecture):
├── contracts
│ └── BasicPayments.sol
├── deployments
│ └── kovan
├── src
│ ├── handlers
│ │ ├── createDepositHandler.js
│ │ ├── createPaymentHandler.js
│ │ ├── createWalletHandler.js
│ │ ├── getTransactionHandler.js
│ │ ├── getTransactionMetricsHandler.js
│ │ ├── getTransactionsHandler.js
│ │ ├── getUbademyWalletHandler.js
│ │ └── getWalletHandler.js
│ ├── infrastructure
│ │ ├── transaction
│ │ │ └── transactionDTO.js
│ │ ├── wallet
│ │ │ └── walletDTO.js
│ │ └── database.js
│ ├── models
│ │ ├── metrics.js
│ │ ├── transactions.js
│ │ └── wallet.js
│ ├── services
│ │ ├── contractInteraction.js
│ │ ├── metrics.js
│ │ ├── services.js
│ │ ├── transactions.js
│ │ └── wallets.js
│ ├── app.js
│ ├── config.js
│ ├── exceptions.js
│ ├── routes.js
│ └── server.js
└── __tests__
Make sure you add a .env file in the project's root directory. It should include the following variables:
MNEMONIC=your_mnemonic_separated_with_underscores
INFURA_API_KEY=selfExplanatory
COMMISSION=<payment-commission>
MICROSERVICES=<microservices-dict>
- payment-commission: float between 0 and 1
- microservices-dict: {microservice-name: microservice-url}
- npm 6.14.15
- nvm Use node v14.18.1
- Docker-Compose
Once you have installed these tools, npm will take care of the rest 😌
npm i
make run
make reset
npm test
Once the API is running you can check all available endpoints at http://127.0.0.1:8000/docs#/