Closed freshteapot closed 9 months ago
@freshteapot Github issues are limited to bugs or feature requests with the stripe-go SDK itself. Here this is an integration support question better directed at our support team for 1:1 help instead: https://support.stripe.com/contact
To unblock you, this is all expected behaviour. Metadata apply to the specific object they are set on and don't usually propagate to other objects. We have a handful of exceptions such as PaymentIntent passing its metadata to the Charge on creation but that's extremely rare.
Here you set the metadata on the Checkout Session so you will only see metadata on that Checkout Session and nothing else. If you want to see metadata on the PaymentIntent, you need to explicitly set the payement_intent_data[metadata]
parameter instead.
If you have follow up questions, please work with our support team for help: https://support.stripe.com/contact
Thank you for the detailed response.
I am going to embrace the PaymentIntentData and see if that does what I want.
PaymentIntentData: &stripe.CheckoutSessionPaymentIntentDataParams{
Metadata: map[string]string{
"tier": tierName,
"user_uuid": userUUID,
"product_id": productID,
"price_id": priceReferenceID,
},
}
Describe the bug
(not sure if it is a bug)
When I create a checkout session with metadata. The "checkout complete" contains the metadata. But the "payment_intent.created" does not
To Reproduce
Using github.com/stripe/stripe-go/v76
And then looking at the event stream for the succesful purchase in the stripe dashboard
https://dashboard.stripe.com/test/payments/pi_XXX
Expected behavior
I assumed (possibly the problem) that setting the metadata in stripe.CheckoutSessionParams would cause all events for this payment to include the metadata.
Code snippets
No response
OS
macOS
Go version
1.21.1
stripe-go version
v76.4.0
API version
2023-10-16
Additional context
No response