feat: init billing app

wip-payments
Aravinth Manivannan 2022-06-22 00:36:46 +05:30
parent 743f3447e7
commit 4908754b0d
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
6 changed files with 27 additions and 0 deletions

View File

@ -1,3 +1,5 @@
export DATABASE_URL="" export DATABASE_URL=""
export db="" export db=""
export OIDC_RSA_PRIVATE_KEY="" export OIDC_RSA_PRIVATE_KEY=""
export STRIPE_SECRET_KEY=""
export STRIPE_PUBLIC_KEY=""

View File

@ -10,6 +10,7 @@ pipeline:
- make lint - make lint
- make test - make test
- make coverage - make coverage
secrets: [ STRIPE_PUBLIC_KEY, STRIPE_SECRET_KEY ]
services: services:
database: database:

View File

@ -37,6 +37,7 @@ lint: ## Run linter
@./venv/bin/black ./accounts/* @./venv/bin/black ./accounts/*
@./venv/bin/black ./dash/* @./venv/bin/black ./dash/*
@./venv/bin/black ./support/* @./venv/bin/black ./support/*
@./venv/bin/black ./billing/*
migrate: ## Run migrations migrate: ## Run migrations
$(call run_migrations) $(call run_migrations)

View File

@ -45,6 +45,8 @@ INSTALLED_APPS = [
"dash", "dash",
"support", "support",
"oauth2_provider", "oauth2_provider",
"payments",
"billing",
] ]
MIDDLEWARE = [ MIDDLEWARE = [
@ -144,6 +146,21 @@ OAUTH2_PROVIDER = {
} }
## django-payments configuration
PAYMENT_MODEL = "billing.Payment" # please don't change this value
PAYMENT_HOST = "http://localhost:8000"
PAYMENT_VARIANTS = {
"stripe": (
"payments.stripe.StripeProvider",
{
"secret_key": env.get_value("STRIPE_SECRET_KEY"),
"public_key": env.get_value("STRIPE_PUBLIC_KEY"),
},
)
}
### Dashbaord specific configuration options ### Dashbaord specific configuration options
HOSTEA = { HOSTEA = {

View File

@ -18,6 +18,8 @@ from django.urls import path, include
urlpatterns = [ urlpatterns = [
path("o/", include("oauth2_provider.urls", namespace="oauth2_provider")), path("o/", include("oauth2_provider.urls", namespace="oauth2_provider")),
path("payments/", include("payments.urls")),
path("billing/", include("billing.urls")),
path("admin/", admin.site.urls), path("admin/", admin.site.urls),
path("dash/", include("dash.urls")), path("dash/", include("dash.urls")),
path("support/", include("support.urls")), path("support/", include("support.urls")),

View File

@ -11,6 +11,8 @@ Deprecated==1.2.13
Django==4.0.3 Django==4.0.3
django-environ==0.8.1 django-environ==0.8.1
django-oauth-toolkit==2.0.0 django-oauth-toolkit==2.0.0
django-payments==1.0.0
django-phonenumber-field==6.3.0
djangorestframework==3.13.1 djangorestframework==3.13.1
greenlet==1.1.2 greenlet==1.1.2
idna==3.3 idna==3.3
@ -24,6 +26,7 @@ mypy-extensions==0.4.3
oauthlib==3.2.0 oauthlib==3.2.0
parso==0.8.3 parso==0.8.3
pathspec==0.9.0 pathspec==0.9.0
phonenumberslite==8.12.50
platformdirs==2.5.1 platformdirs==2.5.1
psycopg2==2.9.3 psycopg2==2.9.3
pycparser==2.21 pycparser==2.21
@ -32,6 +35,7 @@ pynvim==0.4.3
pytz==2022.1 pytz==2022.1
requests==2.27.1 requests==2.27.1
sqlparse==0.4.2 sqlparse==0.4.2
stripe==3.4.0
tblib==1.7.0 tblib==1.7.0
toml==0.10.2 toml==0.10.2
tomli==2.0.1 tomli==2.0.1