diff options
author | Matthew Lemon <y@yulqen.org> | 2024-10-17 17:25:48 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-10-17 17:25:48 +0100 |
commit | 4a7fe21ec2b5b93734a4f6d0e1736292629248c8 (patch) | |
tree | cb34baeffec37aee6fd68b2c60bf54d3f7910632 | |
parent | eeaddb27560d723ca7d61359744ceb2709fccd2d (diff) |
Update Stripe and include the API key
-rw-r--r-- | alphabetlearning/payments/models.py | 3 | ||||
-rw-r--r-- | alphabetlearning/payments/views.py | 5 | ||||
-rw-r--r-- | pyproject.toml | 2 | ||||
-rw-r--r-- | uv.lock | 200 |
4 files changed, 107 insertions, 103 deletions
diff --git a/alphabetlearning/payments/models.py b/alphabetlearning/payments/models.py index 80d93c2..62bcbde 100644 --- a/alphabetlearning/payments/models.py +++ b/alphabetlearning/payments/models.py @@ -9,6 +9,9 @@ class Product(models.Model): name = models.CharField(max_length=255) stripe_product_id = models.CharField(max_length=100) + def __str__(self): + return self.name + class Price(models.Model): product = models.ForeignKey(Product, on_delete=models.CASCADE) diff --git a/alphabetlearning/payments/views.py b/alphabetlearning/payments/views.py index 8337177..ca81d86 100644 --- a/alphabetlearning/payments/views.py +++ b/alphabetlearning/payments/views.py @@ -15,6 +15,7 @@ from .models import Price from .models import Product from .models import ShoppingCart + stripe.api_key = settings.STRIPE_SECRET_KEY @@ -31,8 +32,8 @@ class CreateCheckoutSessionView(View): }, ], mode="payment", - success_url=domain + "payments/success/", - cancel_url=domain + "payments/cancel/", + success_url=domain + "/payments/success/", + cancel_url=domain + "/payments/cancel/", ) return redirect(checkout_session.url, code=303) diff --git a/pyproject.toml b/pyproject.toml index 5f5ece7..6c89c9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -53,7 +53,7 @@ dependencies = [ # https://github.com/psycopg/psycopg "watchfiles==0.21.0", # https://github.com/samuelcolvin/watchfiles - "stripe==10.10.0", + "stripe==11.1.0", "django-stubs[compatible-mypy]>=5.0.4", ] [tool.uv] # https://docs.astral.sh/uv/concepts/dependencies/#development-dependencies @@ -2,6 +2,103 @@ version = 1 requires-python = ">=3.11" [[package]] +name = "alphabetlearning" +version = "0.1.0" +source = { virtual = "." } +dependencies = [ + { name = "argon2-cffi" }, + { name = "boto3" }, + { name = "botocore" }, + { name = "celery" }, + { name = "crispy-bootstrap5" }, + { name = "django" }, + { name = "django-allauth", extra = ["mfa"] }, + { name = "django-celery-beat" }, + { name = "django-crispy-forms" }, + { name = "django-environ" }, + { name = "django-model-utils" }, + { name = "django-redis" }, + { name = "django-storages" }, + { name = "django-stubs", extra = ["compatible-mypy"] }, + { name = "flower" }, + { name = "gunicorn" }, + { name = "hiredis" }, + { name = "markdown" }, + { name = "pdf2image" }, + { name = "pillow" }, + { name = "psycopg", extra = ["c"] }, + { name = "pypdf2" }, + { name = "python-dotenv" }, + { name = "python-magic" }, + { name = "python-slugify" }, + { name = "redis" }, + { name = "sqlparse" }, + { name = "stripe" }, + { name = "watchfiles" }, + { name = "werkzeug", extra = ["watchdog"] }, + { name = "whitenoise" }, +] + +[package.dev-dependencies] +dev = [ + { name = "coverage" }, + { name = "django-coverage-plugin" }, + { name = "factory-boy" }, + { name = "pdbpp" }, + { name = "pytest" }, + { name = "pytest-django" }, + { name = "pytest-sugar" }, + { name = "ruff" }, +] + +[package.metadata] +requires-dist = [ + { name = "argon2-cffi", specifier = "==23.1.0" }, + { name = "boto3", specifier = "==1.34.89" }, + { name = "botocore", specifier = "~=1.34.93" }, + { name = "celery", specifier = "==5.4.0" }, + { name = "crispy-bootstrap5", specifier = "==2024.2" }, + { name = "django", specifier = "==5.0.4" }, + { name = "django-allauth", extras = ["mfa"], specifier = "==0.62.1" }, + { name = "django-celery-beat", specifier = "==2.6.0" }, + { name = "django-crispy-forms", specifier = "==2.1" }, + { name = "django-environ", specifier = "==0.11.2" }, + { name = "django-model-utils", specifier = "==4.5.1" }, + { name = "django-redis", specifier = "==5.4.0" }, + { name = "django-storages", specifier = "==1.14.3" }, + { name = "django-stubs", extras = ["compatible-mypy"], specifier = ">=5.0.4" }, + { name = "flower", specifier = "==2.0.1" }, + { name = "gunicorn", specifier = "==22.0.0" }, + { name = "hiredis", specifier = "==2.3.2" }, + { name = "markdown", specifier = "==3.6.0" }, + { name = "pdf2image", specifier = "==1.17.0" }, + { name = "pillow", specifier = "==10.3.0" }, + { name = "psycopg", extras = ["c"], specifier = "==3.1.19" }, + { name = "pypdf2", specifier = "==3.0.1" }, + { name = "python-dotenv", specifier = "==1.0.1" }, + { name = "python-magic", specifier = "==0.4.27" }, + { name = "python-slugify", specifier = "==8.0.4" }, + { name = "redis", specifier = "==5.0.4" }, + { name = "sqlparse", specifier = "==0.5.0" }, + { name = "stripe", specifier = "==11.1.0" }, + { name = "watchfiles", specifier = "==0.21.0" }, + { name = "werkzeug", extras = ["watchdog"], specifier = "==3.0.2" }, + { name = "whitenoise", specifier = "==6.6.0" }, +] + +[package.metadata.requires-dev] +dev = [ + { name = "coverage", specifier = "==7.5.1" }, + { name = "django-coverage-plugin", specifier = "==3.1.0" }, + { name = "factory-boy", specifier = "==3.3.0" }, + { name = "pdbpp", specifier = "==0.10.3" }, + { name = "pytest", specifier = "==8.2.0" }, + { name = "pytest-django", specifier = "==4.8.0" }, + { name = "pytest-sugar", specifier = "==1.0.0" }, + { name = "ruff", specifier = "==0.6.4" }, +] + +[[package]] name = "amqp" version = "5.2.0" source = { registry = "https://pypi.org/simple" } @@ -843,103 +940,6 @@ source = { registry = "https://pypi.org/simple" } sdist = { url = "https://files.pythonhosted.org/packages/64/7e/1b75babba770e9869d27e2aed23ee5d903c9aa748d8dd1ef783c9cca1de5/psycopg_c-3.1.19.tar.gz", hash = "sha256:8e90f53c430e7d661cb3a9298e2761847212ead1b24c5fb058fc9d0fd9616017", size = 562146 } [[package]] -name = "pyblackbird-cc" -version = "0.1.0" -source = { virtual = "." } -dependencies = [ - { name = "argon2-cffi" }, - { name = "boto3" }, - { name = "botocore" }, - { name = "celery" }, - { name = "crispy-bootstrap5" }, - { name = "django" }, - { name = "django-allauth", extra = ["mfa"] }, - { name = "django-celery-beat" }, - { name = "django-crispy-forms" }, - { name = "django-environ" }, - { name = "django-model-utils" }, - { name = "django-redis" }, - { name = "django-storages" }, - { name = "django-stubs", extra = ["compatible-mypy"] }, - { name = "flower" }, - { name = "gunicorn" }, - { name = "hiredis" }, - { name = "markdown" }, - { name = "pdf2image" }, - { name = "pillow" }, - { name = "psycopg", extra = ["c"] }, - { name = "pypdf2" }, - { name = "python-dotenv" }, - { name = "python-magic" }, - { name = "python-slugify" }, - { name = "redis" }, - { name = "sqlparse" }, - { name = "stripe" }, - { name = "watchfiles" }, - { name = "werkzeug", extra = ["watchdog"] }, - { name = "whitenoise" }, -] - -[package.dev-dependencies] -dev = [ - { name = "coverage" }, - { name = "django-coverage-plugin" }, - { name = "factory-boy" }, - { name = "pdbpp" }, - { name = "pytest" }, - { name = "pytest-django" }, - { name = "pytest-sugar" }, - { name = "ruff" }, -] - -[package.metadata] -requires-dist = [ - { name = "argon2-cffi", specifier = "==23.1.0" }, - { name = "boto3", specifier = "==1.34.89" }, - { name = "botocore", specifier = "~=1.34.93" }, - { name = "celery", specifier = "==5.4.0" }, - { name = "crispy-bootstrap5", specifier = "==2024.2" }, - { name = "django", specifier = "==5.0.4" }, - { name = "django-allauth", extras = ["mfa"], specifier = "==0.62.1" }, - { name = "django-celery-beat", specifier = "==2.6.0" }, - { name = "django-crispy-forms", specifier = "==2.1" }, - { name = "django-environ", specifier = "==0.11.2" }, - { name = "django-model-utils", specifier = "==4.5.1" }, - { name = "django-redis", specifier = "==5.4.0" }, - { name = "django-storages", specifier = "==1.14.3" }, - { name = "django-stubs", extras = ["compatible-mypy"], specifier = ">=5.0.4" }, - { name = "flower", specifier = "==2.0.1" }, - { name = "gunicorn", specifier = "==22.0.0" }, - { name = "hiredis", specifier = "==2.3.2" }, - { name = "markdown", specifier = "==3.6.0" }, - { name = "pdf2image", specifier = "==1.17.0" }, - { name = "pillow", specifier = "==10.3.0" }, - { name = "psycopg", extras = ["c"], specifier = "==3.1.19" }, - { name = "pypdf2", specifier = "==3.0.1" }, - { name = "python-dotenv", specifier = "==1.0.1" }, - { name = "python-magic", specifier = "==0.4.27" }, - { name = "python-slugify", specifier = "==8.0.4" }, - { name = "redis", specifier = "==5.0.4" }, - { name = "sqlparse", specifier = "==0.5.0" }, - { name = "stripe", specifier = "==10.10.0" }, - { name = "watchfiles", specifier = "==0.21.0" }, - { name = "werkzeug", extras = ["watchdog"], specifier = "==3.0.2" }, - { name = "whitenoise", specifier = "==6.6.0" }, -] - -[package.metadata.requires-dev] -dev = [ - { name = "coverage", specifier = "==7.5.1" }, - { name = "django-coverage-plugin", specifier = "==3.1.0" }, - { name = "factory-boy", specifier = "==3.3.0" }, - { name = "pdbpp", specifier = "==0.10.3" }, - { name = "pytest", specifier = "==8.2.0" }, - { name = "pytest-django", specifier = "==4.8.0" }, - { name = "pytest-sugar", specifier = "==1.0.0" }, - { name = "ruff", specifier = "==0.6.4" }, -] - -[[package]] name = "pycparser" version = "2.22" source = { registry = "https://pypi.org/simple" } @@ -1198,15 +1198,15 @@ wheels = [ [[package]] name = "stripe" -version = "10.10.0" +version = "11.1.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "requests" }, { name = "typing-extensions" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/61/72/3d210136ec051ca8240af163c9b6960c18715797be20af31e63d3da5ee94/stripe-10.10.0.tar.gz", hash = "sha256:82351f9e1055c2161dc38c08a9bbf5c4b6c7f1caffcf911e999a7012369415e2", size = 1313050 } +sdist = { url = "https://files.pythonhosted.org/packages/97/e1/d867a08081f1627d13310cb55ec27b7c687d731ee0c3c8928a57e0d65739/stripe-11.1.0.tar.gz", hash = "sha256:1fac660dcc3014268cafc94a45ebeac66f1a752365f60019d2263e0c1e0f965b", size = 1339459 } wheels = [ - { url = "https://files.pythonhosted.org/packages/0d/fb/7c39404ed0ca4aaf93b2ae6fffe2de0bc4dc91f5f5b60f9813de93d5d3a8/stripe-10.10.0-py2.py3-none-any.whl", hash = "sha256:36ab5f75e4af790dd6888450d812f502357b3e699a93cd2f1a8fd0014a4b4fca", size = 1553756 }, + { url = "https://files.pythonhosted.org/packages/3f/35/77152065e287e0aa98be205055036ca68835ccc1c1e74cabfd2327f0a6d1/stripe-11.1.0-py2.py3-none-any.whl", hash = "sha256:2cd09ca015dc5ce9d80cf5bbe81cd6a4d528997ddedadd53844e183f36211ace", size = 1590658 }, ] [[package]] |