#fm0-paymentlink-metadata

1 messages · Page 1 of 1 (latest)

upbeat ruinBOT
sour thicket
#

Can you say more about what you're trying to achieve here?

#

You can put metadata on a payment link, but i suppose that is not doing what you want

dark dome
#

Is there a way to add this straight through the UI

velvet halo
#

In the payment intent you can add the property "metada as follow:

  metadata: {
    order_id: '141416',
    test: 'one test'
  }
dark dome
#

I want my customers to add an API key to my service that will be be used for auth and do actions on their behalf

#

inside the metadata field

dark dome
#

but I want to know if there’s a way to do it from the UI

#

Basically they add my server as a webhook to listen events from and then I use the api key in the metadata to authenticate them and do actions for them whenever they get money

sour thicket
dark dome
#

The create a payment link

#

button

sour thicket
velvet halo
#

It should be easy... The logic to do that is in your side... Find the way to modify those the metadata proprety..... something like:

let pi = {
currency: "mxn",
amount: 1700 * 100,
automatic_payment_methods: { enabled: true },
description: 'Test de pago',
metadata: {
order_id: '141416',
test: 'one test'
}
}

let newData = {
//some props here....
}

pi.metadata = {...newData}

dark dome
#

I tried building a stripe app but there was it was extremely confusing

#

so doing this in the meantime so I can have something working

#

but all I need is this metadata attached

#

then the user sends the webhook to my server

upbeat ruinBOT
sour thicket
dark dome
#

The field you sent me before

#

Was exactly what I want

#

i press create payment link

#

I was wondering if there is a way to add preconfigured metadata here

#

So that every purchase made using this link has a metadata attached to it

#

(That’s not visible to the customer actually paying)

tropic aspen
#

fm0-paymentlink-metadata

#

@dark dome there's no way to propagate metadata automatically from a PaymentLink down to a Subscription, its underlying Invoices and PaymentIntents or Charges. This is mostly impossible.

#

You're going to have to write some code to do that in some way I think. I'm just struggling to grasp what the metadata of a PaymentLink (that can be used by an infinite number of different customers) has to do with it and I must be missing something in your end goal

dark dome
#

sure

tropic aspen
#

Who is creating the PaymentLink in the Dashboard? Is it you, or one of your "users" because you're a plugin/connector or a platform maybe?

dark dome
#

ya sure np

I am making a connector app which does actions on behalf of my customer whenever on of their customers (pays / disputes / refunds)

My app -> them (my customer) -> my customers customers (their customer)

So since as far as I can tell the charge object webhook does not have the stripe account ID.

I provide users with an API key for auth purposes. This is so I can tell who they are. I plan on having every customer adding my service to their webhooks section (so my service will be getting webhooks from many stripe accounts). The link will be created by my customer. I want them to add their API key to their payment link so when I receive their webhook I can identify who each customer is so I can do actions on their behalf

#

btw I think the metadata does propgate:

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to metadata. Metadata associated with this Payment Link will automatically be copied to checkout sessions created by this payment link.

https://stripe.com/docs/api/payment_links/payment_links/create

tropic aspen
#

So since as far as I can tell the charge object webhook does not have the stripe account ID.
Are you using Stripe Connect?

dark dome
#

how do i use that

tropic aspen
#

It's not about how to use it, it's asking if you are

dark dome
#

no

tropic aspen
#

Okay so why would you care about the account id?

#

I assume you are a connector that people install on their own server and enter their API keys?

dark dome
#

i can use stripe connect if it provides an account_id

dark dome
#

I tried making a stripe app but got blocked on that because I can't install my app on other stripe accounts

#

still waiting on stripe support for that

#

basically my service will support multiple connectors

stripe / shopify / gumroad etc

#

best way to tie all of them together is to provide an ID (my customer, not their customer) that would work for any of those services

#

if that makes sense

tropic aspen
#

I'm really sorry, none of that makes sense just yet unfortunately 😦

dark dome
#

sure what part doesn't make sense

tropic aspen
#

all of it sadly

#

Those people have a Stripe account right? Like they go in their own Dashboard and they create PaymentLinks. And you want to receive the Events from their account on your webhook endpoint right?

dark dome
#

but

#

i need to be able to differentiate between different stripe merchants

#

since multiple stripe merchants will be hooking into my flow

#

if that makes sense

#

hence

#

I give unique API key

#

so when I receive the payment webhook

#

its just there

#

and I know who they are

tropic aspen
#

Sorry, Discord is super busy. Please don't send sentences with 3 words in it over and over and over. Try to take a step back, breathe, and then explain clearly what you are building all in one message clearly organized so that I can understand it

#

How are you going to access their account or their API if you don't have their Secret API key?

dark dome
#

I would have them put my service as a webhook endpoint

api.faris-service.com/stripe/webhook

sorry for sending lots of messages, not trying to irratate you or anything my bad, i just normally type like this, i'll try to put everything in one message now

do you suggest making a stripe connect webhook instead?

tropic aspen
#

All good, I know we all communicate differently, but since your set up is uncommon it's important to set the right context to help you and that's easier in one clear message.

So okay,basically you wrote code on your own server that you host. And you ask those individual account owners to enter your server's URL as their webhook endpoint and everyone does that does you by hand and then when you get those Events you want to know which account they come from but you can't because that's not how we designed Events and webhooks at all.
Mostly becuase your set up is incorrect and that's really not how you should have designed your app, that's why you're stuck right now

dark dome
#

Ya sounds about right. I was wondering if I can use stripe connect to fix this problem

tropic aspen
#

The idea is that every person will "approve" a connection of their account to your app. After that, as the platform, you have full access to their account and API and you can see everything that happens. One specific thing is that you can create your own webhook endpoint on your own account that listens to every Event from all your connected accounts. And each Event will come with a clear account: 'acct_123' as the id of the connected account it comes from. Which solves your problem (and a whole lot of others you never thought of yet like API versioning being different for each account with your current set up)

dark dome
#

appreciate it, so once this is setup im good until the user revokes access right