#codewithoreo

1 messages · Page 1 of 1 (latest)

short locustBOT
slow olive
#

Hi @chilly idol

chilly idol
#

Can you share the parameter(s) you're using? Or an API request?

slow olive
#

So to give more informations the code looks like this:

#
checkout_session = stripe.checkout.Session.create(
            line_items=[
                {
                    'price': price_id,
                    'quantity': 1,
                },
            ],
            subscription_data={
                "trial_period_days": 10,
                "metadata": {
                    "promocode": "HELLO"
                }
            },
            mode='subscription',
            client_reference_id=request.user.id,
            customer_email=request.user.email,
            locale=get_language(),
            success_url=settings.MYDOMAIN + reverse('subscriptions:checkout_success'),
            cancel_url=settings.MYDOMAIN + reverse('accounts:mysubscriptions'),
            allow_promotion_codes=False
        )
#

the subscription is well saved so the base is ok it's just that when I retrieve the subscription the metadata is not here

chilly idol
#

Hmm, I'd expect that to work. Can you share a sub_xxx ID generated from that code?

slow olive
#

Yep let me find that for you

#

this one for example: sub_1NQCcPLNSqtKef5aLlZA1Q56

chilly idol
#

Taking a look

slow olive
#

So as you can see the subscription is saved, the trial period days as well but not the MD

#

(promocode: 1 has been added through the dashboard by hand for testing)

#

Oh wait

#

I think I did a mistake

#

Stop investigating give me 5 minutes to recheck that it's probably on my side :S

chilly idol
#

Looks like you sent an empty string, which is the equivilent of null (so its unset)

slow olive
#

Yeah I think I did a mistake just 2 minutes to try the fix and I come back to you

#

hmmm may I know hoe to find the logs like you sent me?

chilly idol
slow olive
#

Thanks I will investigate on that sorry for bothering you

chilly idol
#

np!

slow olive
#

Ok so I'm really sorry the mistake was on my side

#

So problem fixed. Thanks a lot for your time