Skip to content
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

Merged
merged 4 commits into from
Feb 18, 2025
Merged

create metadata field #33

merged 4 commits into from
Feb 18, 2025

Conversation

andrewliu08
Copy link

No description provided.

Copy link

vercel bot commented Feb 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
daimo-pay-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 18, 2025 1:02am

@@ -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. */
Copy link
Member

@dcposch dcposch Feb 12, 2025

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;
Copy link
Member

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

Copy link
Member

@dcposch dcposch left a 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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@andrewliu08 andrewliu08 merged commit 6ca9f5a into main Feb 18, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants