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

missing metadata in stripe #20

Open
stefanwerner87 opened this issue Dec 28, 2023 · 0 comments
Open

missing metadata in stripe #20

stefanwerner87 opened this issue Dec 28, 2023 · 0 comments

Comments

@stefanwerner87
Copy link

hi there,

in order to have metadata available in stripe you need to provide payment_intent_data in the stripeSession

const stripeSession = await stripe.checkout.sessions.create({
  success_url: `${process.env.NEXT_PUBLIC_SERVER_URL}/thank-you?orderId=${order.id}`,
  cancel_url: `${process.env.NEXT_PUBLIC_SERVER_URL}/cart`,
  payment_method_types: ["card", "paypal"],
  mode: "payment",
  metadata: {
    userId: user.id,
    orderId: order.id
  },
  line_items,
  payment_intent_data: {
    metadata: {
      userId: user.id,
      orderId: order.id
    }
  }
});

image

cheers

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

No branches or pull requests

1 participant