Integration with StarkBank server
- Issuance of boletos (between 8 to 12) every 3 hours to random individuals for 24 hours;
- Receive a webhook callback for the credits received (from task 1) and transfer the received amount (subtracting any fees) to the StarkBank account.
- Python 3.10;
- Flake8 (linter) / Black (formatter);
- Pytest / coverage;
- GCP:
- Cloud Functions (run microservices);
- Cloud Scheduler (schedule microservice executions);
- Artifact Registry (python package repository);
- Secret Manager (store sensitive files);
git clone https://github.com/ArtShx/starkbank_int
cd starkbank_int
virtualenv venv --python=python3.10
source venv/bin/activate
# Install dependencies
pip install .
pip install -r requirements.txt
pip install -r requirements-dev.txt
# Run tests
pytest
You need to update the env
file to be able to authenticate with Starkbank API. Follow steps below:
-
Update the path of your private_key.pem (make sure this the same key that is already registered on Starkbank API)
private_key=/path/to/your/key.pem
-
Update the access_id (Starkbank project id):
access_id=...
-
Create a environment variable to set the path of this env file:
export env_file=${PWD}/file/env
-
Try executing the
HelloWorld
service by running the following command:functions-framework --target entrypoint --source services/HelloWorld/handler.py
Open a new terminal and run curl localhost:8080
, this should return a json describing the version and if authentication worked.
.
├── file # General files (mock, configuration)
│ └── keys # PEM keys
├── services # Microservices
│ ├── IssueInvoice
│ └── Transfer2Starkbank
├── starkbank_integration # Base code to be used by microservices
│ ├── db # Database interaction
│ └── models # Entities (business rules)
└── tests # Unit tests
- Create a package for starkbank api integration;
- Create tests for
services/
; - Add CI automated tests on commit, run tests and coverage report;
- Setup a GCP freetier account (maybe use Terraform or other IaC tool?);
- Add CD automated deploy on GCP;
- Deploy
services
and thestarkbank_integration
package into a cloud provider;