-
Notifications
You must be signed in to change notification settings - Fork 0
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
create metadata field #33
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -61,6 +62,8 @@ export interface PayParams { | |||
preferredChains?: number[]; | |||
/** Preferred tokens. These appear first in the token list. */ | |||
preferredTokens?: { chain: number; address: Address }[]; | |||
/** Developer metadata. E.g. correlation 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.
Metadata associated with this payment. Use eg. to track correlated IDs.
@@ -61,6 +62,8 @@ export interface PayParams { | |||
preferredChains?: number[]; | |||
/** Preferred tokens. These appear first in the token list. */ | |||
preferredTokens?: { chain: number; address: Address }[]; | |||
/** Developer metadata. E.g. correlation ID. */ | |||
metadata?: DaimoPayUserMetadata; |
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.
confirming that we don't expose our previous metadata
anywhere... fortunately, it looks like we don't
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.
userMetadata looks solid
- what's a possible use case for userMetadata other than storing a single external ID?
- good chance the extra flexibility is valuable
do we need a way for DaimoPayButton to generate a unique payment?
rn I think we have this in the API (say you pass myCartId as metadata + also as the Idempotency-Key = guarantees you get exactly one payment per cart id, and the webhook will tell you which cart was paid)
but as far as I can tell we don't have it when using DaimoPayButton directly
@@ -399,6 +402,8 @@ export function usePaymentState({ | |||
preferredTokens: payParams.preferredTokens, | |||
}, | |||
}, | |||
externalId: payParams.externalId, | |||
userMetadata: payParams.metadata, |
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.
👍
No description provided.