#mrdatabase-checkout-metadata

1 messages · Page 1 of 1 (latest)

round siloBOT
placid notch
#

Can you share an example reqeust where it's not correctly setting the metadata?

elfin jolt
#

Sure

#

Create payment intent

    payment_intent = stripe.PaymentIntent.create(
        amount=final_total_price,
        currency='gbp',
        payment_method_types=['card'],
        customer=get_webshop_customer_data[0]['stripe_customer_id'],
        payment_method=default_payment_method,
        off_session=True,
        confirm=True,
        stripe_account=get_business_data[0]['connect_id'],
        metadata={
            "unique_sale_id": unique_sale_id,
            "online_sale": "1"
        }
    )
placid notch
#

No, I need an example request ID or a Payment Intent ID where you're not seeing hte metadata being set

elfin jolt
#

pi_3OfPvY4FheL2Y27n0XxJrdTW

#

is that ok?

placid notch
#

yup that works!

#

That Payment Intent is being created through a Checkout Session - If you want to set metadata on the Payment Intent created from a Checkout Session you need to be setting payment_intent_data.metadata (https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-metadata)

elfin jolt
#

oh ok cool

#

thank you

round siloBOT
#

mrdatabase-checkout-metadata