#SciAndy

1 messages · Page 1 of 1 (latest)

modest depotBOT
rigid wolf
jaunty basin
#

Oh wow thanks, I didnt even know about the second one. I am doing the first one, I will change it to the subscription_data one.

So like

stripe.checkout.Session.create(
  success_url="https://example.com/success",
  line_items=[
    {
      "price": "price_H5ggYwtDq4fbrJ",
      "quantity": 2,
    },
  ],
  subscription_data.metadata = {"user_id": "useridhere"}
  mode="payment",
)```

Does that look right?
rigid wolf
#

there's no harm in putting it in both places really. You can try running your code and checking the resulting Subscription object after payment is completed

#

also, mode should be subscription, not payment

jaunty basin
#

thanks, gonna try it now with

    "metadata": {"user_id": user_id},
},``` hopefully that is right, what I gave earlier is not