Closed luc-vocab closed 2 hours ago
I am also running into this issue. It appears to be stemming from the capture_method
field value of automatic_async
which was indeed added in the latest Stripe API: https://docs.stripe.com/upgrades#2024-04-10
I have found that the following migration file, which increases the length of the field to 255 characters temporarily fixes it.
# Generated by Django 5.0.3 on 2024-04-16 12:28
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("djstripe", "0012_2_8"),
]
operations = [
migrations.RunSQL(
"ALTER TABLE djstripe_paymentintent ALTER COLUMN capture_method TYPE varchar(255);"
),
]
A simple solution in the library would be to bump up the length of the field. I will submit a PR for that.
Hello @jleclanche, any update for this? I'm facing the same issue.
Due to the issue I believe we will exceptionally release a 2.8.5 with migrations included.
Thank you for the quick response @Jenselme 👍 we're waiting this updates.
@jleclanche very appreciated, thank you for your work.
@jleclanche would it be helpful for me to add the migration to https://github.com/dj-stripe/dj-stripe/pull/2040?
@czue Yes please go for it.
@jleclanche migration added. also created a PR into the stable/2.8 branch (#2041) as I wasn't totally sure where it should go.
@jleclanche I believe we need to include all migration files in the new release version, the reason is for old dj-stripe versions who had migration files need to clear the django_migrations
table, and then migrate again.
docker exec -it <postgres_container_name_or_id> psql -U <username> <database_name>
DROP TABLE django_migrations;
then;
python manage.py migrate --fake
Hello @jleclanche sorry to ping you again. When we expect the new release will happens? as it impacted the important events for the webhook listener, such as:
charge.succeeded
invoice.payment_succeeded
payment_intent.succeeded
@agusmakmun if you're needing a patch urgently you can always add a migration like the one mentioned above to any of your Django apps. I would expect it to fix the issue and be compatible with any future migration that ships in djstripe
@jleclanche sorry to pester, but just wondering what the steps are to go from https://github.com/dj-stripe/dj-stripe/pull/2040 or https://github.com/dj-stripe/dj-stripe/pull/2041 to a release, and whether there's anything I can do to help move things along?
At the moment anyone who uses this library with a new Stripe account will get all kinds of errors in webhooks (and maybe other places). Not a great experience.
Note that stripe support can downgrade your API level if you ask them, that's another way of getting dj-stripe working right now.
Folks, I'm going to try to get a release to happen ASAP but I'm swamped IRL right now.
If you need to run this in production, you can write the following in your SQL db:
alter table djstripe_paymentintent alter column capture_method type character varying(15);
I haven't tested it but it should work as-is and be forward-compatible with future migrations.
This is fixed in 2.9.0a1 which was released recently, please test that release (note: it has not been tested in production yet, please create issues with all feedback).
Describe the bug processing a checkout.session.completed webhook after a purchase results in an error: value too long for type character varying(9)
This is in test mode on a newly opened stripe account which is on API version 2024-04-10. I previously did a very thorough amount of testing on another stripe account which is on version 2023-08-16 and never encountered that issue. I am purposefully keeping a stripe account in test mode (dev/qa/prod environments). It doesn't appear to be possible to downgrade the API version on a stripe account.
Sentry crash report: https://language-tools.sentry.io/share/issue/f1549f96d5ed42c59af3b21d65e96d01/
Full stack trace:
Here's the the webhook data:
To Reproduce Perform a purchase using the hosted stripe checkout page.
Software versions