#djarfur_api

1 messages ¡ Page 1 of 1 (latest)

placid merlinBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1285989381508698133

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

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.

vestal valley
#

Hello, when I get this question it is typically because metadata can be in one of two places: on the Checkout Session or on the SetupIntent. We don't automatically copy metadata between objects like that, so you need to make sure you are setting it in the same place that you are looking for it later. If you set it as metadata it will appear on the session and if you set it as subscription_data.metadata it will appear on the setup intent https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-setup_intent_data-metadata

placid merlinBOT
winged heart
#

checkout_session = stripe.checkout.Session.create(
mode="setup",
currency="eur",
customer=stripeuser.stripe_id, # Attach this session to the customer
success_url="https://your-stable.de/success/", # URL to redirect after successful payment
cancel_url="https://your-stable.de/cancel/", # URL to redirect after payment cancellation
metadata={ # Include metadata with your UserStripe ID
"user_stripe_id": str(stripeuser.id), # Pass the UserStripe ID here
}
)

#

like this, it wont work

vestal valley
#

That code is setting the metadata on the Checkout Session. Are you retrieving the Checkout Session itself and the metadata is not showing up? If so can you provide the ID of a checkout session that you are seeing this on?

winged heart
#

no, i am giving the url to a mobile device aand it doesnt work anymore, when i erase metadata i works again

vestal valley
#

Can you tell me more about what you mean by doesn't work? Are you seeing an error somewhere?

winged heart
#

yeah, it says The data couldnt be read because it isnt in the correct format

#

when no metadata

#

it works just fine

#

checkout_session = stripe.checkout.Session.create(
mode="setup",
currency="eur",
customer=stripeuser.stripe_id, # Attach this session to the customer
success_url="https://your-stable.de/success/", # URL to redirect after successful payment
cancel_url="https://your-stable.de/cancel/", # URL to redirect after payment cancellation
metadata={"userid": "str(stripeuser.id)"}
)

#

like this

#

it works just fine

vestal valley
winged heart
#

id = str(stripeuser.id)

    checkout_session = stripe.checkout.Session.create(
        mode="setup",
        currency="eur",
        customer=stripeuser.stripe_id,  # Attach this session to the customer
        success_url="https://your-stable.de/success/",  # URL to redirect after successful payment
        cancel_url="https://your-stable.de/cancel/",  # URL to redirect after payment cancellation
        metadata={"userid": id}
    )
#

like this not

#

whats the problem

#

it has somethin todo with str

compact rampart
#

Hello! I'm taking over and catching up...

#

Can you provide the exact error message you're seeing and let me know where you're seeing it?

winged heart
#

i think its just a intern problem with the id. I hope i can resolve the issue, but thank you a lot.