#codewithoreo
1 messages · Page 1 of 1 (latest)
Hi @chilly idol
Can you share the parameter(s) you're using? Or an API request?
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
Hmm, I'd expect that to work. Can you share a sub_xxx ID generated from that code?
Taking a look
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
Was created via Checkout here: https://dashboard.stripe.com/test/logs/req_vnP5UX8zCgl4he
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Looks like you sent an empty string, which is the equivilent of null (so its unset)
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?
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Thanks I will investigate on that sorry for bothering you
np!