-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[stripe] Use AttributionID metadata when querying for customers #12762
Conversation
// userId is deprecated, use attributionId where possible | ||
userId: user.id, | ||
attributionId: AttributionId.render({ kind: "user", userId: user.id }), | ||
ATTRIBUTION_ID_METADATA_KEY: AttributionId.render({ kind: "user", userId: user.id }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is going to work (you're creating an object key that's literally "ATTRIBUTION_ID_METADATA_KEY"
).
If you really want to make ATTRIBUTION_ID_METADATA_KEY
configurable with a global const in this file, you'd want to first create a const customerSpec = { email, name, metadata: {} }
and then set customerSpec.metadata[ATTRIBUTION_ID_METADATA_KEY] = ...
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, I don't think it's useful to factor out ATTRIBUTION_ID_METADATA_KEY
. So, maybe it's simpler to just use attributionId
everywhere in-line. (This is unlikely to change in the future, but still easy to change if needed.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert is here. Thanks for spotting this. I applied Go style thinking it would use it as a key, not as a literal..
@easyCZ @andrew-farries FYI, this breaks the creation of new customers (please see comment above). This could have been caught immediately with a deployed preview + minimal "How to test" instructions. |
Description
Customers in staging & prod have been updated with this metadata.
Counterpart PR for usage component is here #12755
Related Issue(s)
Fixes #
How to test
Release Notes
Documentation
Werft options: