#Tilkinik-subscription-qs

1 messages ยท Page 1 of 1 (latest)

clear trout
#

Hello ๐Ÿ‘‹
How can I help?

narrow robin
#

We have a project like onlyfans, people can subscripe models. I integrated subscriptions but i wanna transfer money between two accounts. If model has a agency, subscription price split between agency connected account and model's connected account.

#

I can that in one-time payment with payment intent's metadata. Using webhooks i take charge and reach "charge's payment intent"

#

But while i create subscriptions, i cannot add metadata to subscription's payment intent

#

My code :

#

i just wanna reach subscription's payment intent for add metadata

#

That's my webhook, i have to use metadata because of non-eu and eu economic zone transfer differences

clear trout
#

Gotcha, so you basically want to make two transfers based on the information stored in the metadata?

narrow robin
#

Yes exactly

clear trout
#

Give me a few to look into it please ๐Ÿ™‚

narrow robin
#

OK i am waitin'

clear trout
#

So as you've already found out, there isn't a way to set the metadata on the PaymentIntent while creating a subscription unfortunately.

#

The workaround would be to go from PaymentIntent -> Invoice -> Subscription and then look at the metadata on subscription object

#

Let me know if that makes sense or if you have a follow up question

narrow robin
#

Can i reach subscription metadata and subscription's charge?

clear trout
#

Not sure what you mean by that
can you elaborate?

narrow robin
#

I mean, i create subscription with metadata and catch with webhooks. In webhooks Can i reach subscription's charge object and transfer money between accounts?

clear trout
#

I believe so, You can look at subscription's latest invoice -> PaymentIntent

#

Ideally, you'd want to listen for invoice.paid event

#

from the invoice object, you'd find the subscription as well as the PaymentIntent

narrow robin
#

Oh i got it i just listen for ChargeSucceeded

#

if i listen invoice.paid i can reach ok i got it

#

thanks for help

clear trout
#

NP! ๐Ÿ™‚ Happy to help

narrow robin
#

Have a good day!