#vadim70
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- vadim70, 6 days ago, 5 messages
checkout_session = stripe.checkout.Session.create(
line_items=[
{
# Provide the exact Price ID (for example, pr_1234) of the product you want to sell
'price': 'my_price_id',
'quantity': 1,
},
],
mode='payment',
success_url=YOUR_DOMAIN, #+ '?success=true',
cancel_url=YOUR_DOMAIN,# + '?canceled=true',
automatic_tax={'enabled': False},
custom_fields=[
{
"web": True,
}
]
)
in python it should be something like:
custom_fields=[
{
"key": "web",
"label": ...,
"type": ...,
},
I recommend reading this: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-custom_fields
I used the exact docs, that is wrong with my fields?
did you see my code above? it's very different from your code
you can't "web": True. you have to use "key": "web", and then set label and type.
I guess I've misunderstood this docs. My objective is to add my own filed not to customer's checkout form but for my endpoint, so incoming event will contain that field. How can I achieve that?
then you should use metadata for this
you can learn more about this here: https://docs.stripe.com/api/metadata
Got it, thanks