GithubHelp home page GithubHelp logo

value too long for type character varying(9) when processing checkout.session.completed webhook (possible stripe API version 2024-04-10 issue) about dj-stripe HOT 17 CLOSED

luc-vocab avatar luc-vocab commented on June 24, 2024 1
value too long for type character varying(9) when processing checkout.session.completed webhook (possible stripe API version 2024-04-10 issue)

from dj-stripe.

Comments (17)

jleclanche avatar jleclanche commented on June 24, 2024 2

Due to the issue I believe we will exceptionally release a 2.8.5 with migrations included.

from dj-stripe.

jleclanche avatar jleclanche commented on June 24, 2024 1

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).

from dj-stripe.

czue avatar czue commented on June 24, 2024

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.

from dj-stripe.

agusmakmun avatar agusmakmun commented on June 24, 2024

Hello @jleclanche, any update for this? I'm facing the same issue.

from dj-stripe.

agusmakmun avatar agusmakmun commented on June 24, 2024

Thank you for the quick response @Jenselme 👍 we're waiting this updates.

from dj-stripe.

luc-vocab avatar luc-vocab commented on June 24, 2024

@jleclanche very appreciated, thank you for your work.

from dj-stripe.

czue avatar czue commented on June 24, 2024

@jleclanche would it be helpful for me to add the migration to #2040?

from dj-stripe.

jleclanche avatar jleclanche commented on June 24, 2024

@czue Yes please go for it.

from dj-stripe.

czue avatar czue commented on June 24, 2024

@jleclanche migration added. also created a PR into the stable/2.8 branch (#2041) as I wasn't totally sure where it should go.

from dj-stripe.

agusmakmun avatar agusmakmun commented on June 24, 2024

@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

from dj-stripe.

agusmakmun avatar agusmakmun commented on June 24, 2024

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

from dj-stripe.

czue avatar czue commented on June 24, 2024

@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

from dj-stripe.

czue avatar czue commented on June 24, 2024

@jleclanche sorry to pester, but just wondering what the steps are to go from #2040 or #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.

from dj-stripe.

luc-vocab avatar luc-vocab commented on June 24, 2024

Note that stripe support can downgrade your API level if you ask them, that's another way of getting dj-stripe working right now.

from dj-stripe.

jleclanche avatar jleclanche commented on June 24, 2024

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.

from dj-stripe.

czue avatar czue commented on June 24, 2024

@jleclanche awesome, thanks! What's the easiest way for me to see what else is in that release?

from dj-stripe.

jleclanche avatar jleclanche commented on June 24, 2024

It's all here: https://github.com/dj-stripe/dj-stripe/blob/stable/2.9/docs/history/2_9_0.md

from dj-stripe.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.