0

I used this metadata as array of object [{},{},{}]

const sessionData = {
      payment_method_types: ["card"],
      shipping_address_collection: {
        allowed_countries: ["US", "CA", "KE"],
      },
      line_items: [
        {
          price_data: {
            currency: "USD",
            product_data: {
              name: title,
              description: description,
              metadata: {
                endpoints: JSON.stringify(data),
              },
            },
            unit_amount: totalPrice.toFixed(0) * 100,
          },
          quantity: 1,
        },
      ],
      mode: "payment",
      customer: customer.id,
      success_url: `${getBaseClientUrl}/stripe/success`,
      cancel_url: `${getBaseClientUrl}/stripe/cancel`,
    };

    const session = await createCheckoutSession(sessionData);

but it render only title price and description on the checkout session on stripe ui , any one can help me over there , thank you in advance.

i want to return the metadata on the stripe checkout session ui

Abhi
  • 1
  • 4

1 Answers1

0

Metadata is data that you typically use for your own reference. It won't be displayed on the Stripe hosted page which customers access to make payment. If you have additional information that you would like to display to the customer, you can consider adding it in https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-custom_text.

alex
  • 1,923
  • 11
  • 9
  • can you also guide me over this , to add total price and list the product in the line items. – Abhi Apr 10 '23 at 08:13