Payment system integrated with Openpay (https://www.openpay.mx/) to handle purchases for different products. Each product can have different plans and each plan can have multiple addons.
Every product can be configured according to different requirements, in this case, following products were created:
- Product A: a subscription product, as when the customer purchases this product, the features are enabled and the customer can use them without any limitation until plan has expired. For example, this could be a product similar to Spotify/Netflix, when you purchase a certain plan, you are able to use all the features until the plan is expired. Anyway, you can upgrade at anytime.
- Product B: a refill product, as every time a purchase is performed, the customer buy the same bag of utilities. This can be integrated with external systems to refill the capabilities for the customer. For example, if Product B is based on hours, the customer can buy 100 hours of your services every time.
- Handle different products
- Handle different plans for products
- Handle different addons for plans
- Hierarchy: Product > Plan > Addon
- Openpay integration
- Store payments
- Bank payments
- Manual purchase registration: e.g. if the user purchases using cash, then this payment can be registered manually in the system.
- Python
- Django
- Django rest framework
cd app
python3 manage.py migrate
- Open
app/paymentsystem/settings.py
- Go to line 128
- Update
OPENPAY_MERCHANT
andOPENPAY_KEY
with your values
{
"name": "paymentsystem",
"type": "python",
"request": "launch",
"console": "integratedTerminal",
"program": "/path/to/gunicorn",
"gevent": true,
"args": [
"--chdir=app",
"paymentsystem.wsgi",
"--bind=0.0.0.0:5000",
"--timeout=300",
"-k gevent",
"--reload"
],
}
gunicorn --chdir=app --bind 0.0.0.0:5000 --timeout=300 -k gevent paymentsystem.wsgi --reload