digitalhippo icon indicating copy to clipboard operation
digitalhippo copied to clipboard

missing metadata in stripe

Open stefanwerner87 opened this issue 1 year ago • 0 comments

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

stefanwerner87 avatar Dec 28 '23 14:12 stefanwerner87