#moanie-webhooks

1 messages · Page 1 of 1 (latest)

slender shale
#

This sounds like its outside the scope of your stripe integration, unless i misunderstand

#

You can set up any endpoint your like for stripe to send your events to, and from your own server you can process events from any source you like

rapid slate
#

@ancient ether I am not the stripe support, but had similar thing to do - I would go with saving metadata on the Stripe payment (https://stripe.com/docs/api/metadata)

When you receive a webhook, you can try to fetch the metada from stripe and then select metadata you want, at least it worked on my project

slender shale
#

Yea it sounds like you want to do that, put your custom info in metadata

#

How are you creating payments @ancient ether ?

rapid slate
#

(corrected as I didn't meant the customer but rather actual payment, not sure if customer accepts metadata obj)

slender shale
#

Ah, with payment links you can't set custom metadata like that.

#

What were you trying to include exactly?

#

Yea there isn't a way to include that custom info, you have no opportunity to customize the payment when a user clicks a link

#

With payment links, because it starts as just a link (which is easy and great) not custom for any specific customer

#

You need to do something else user-specific to get their discord ID somehow and associate it with a Checkout session or payment intent, if you built a custom flow.

mild apex
#

Hello! What kind of example would you like exactly? Is there a particular language you want it in, for example?

#

And do you want it for creating a Checkout Session with metadata?

#
stripe.checkout.Session.create(
  success_url="https://example.com/success",
  cancel_url="https://example.com/cancel",
  payment_method_types=["card"],
  line_items=[
    {
      "price": "price_123",
      "quantity": 1,
    },
  ],
  mode="payment",
  metadata={
    "foo": "bar,
  },
)