#xor1337_api

1 messages ¡ Page 1 of 1 (latest)

turbid lightBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1357680561166221404

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

winged adder
#

Hi, let me help you with this.

#

For that you need to remove the Stripe-Account header from your request.

hexed fog
#

but that's the point of what I try to accompilsh. This is critical, specify which connected account will receive the payment
and I also want to take fee from that subscription

#

I understand that I should create this customer for the stripe connect merchant, but this is not how I create my app.
Let's say you're on the netflix site and you want to update your billing details because your debit card is expiring. So you want to update them in one place

Every series on netflix comes from other stripe connect sellers, you want to continue watching those series and I'm looking a way to somehow forward customer to these sellers

winged adder
#

I think we need to step back first and review your Stripe Connect setup.
What type of Connected accounts are you using? What type of charges?

hexed fog
#

AccountType = "standard"
I am trying to create a subscription
/v1/subscriptions

#
func (s *stripeService) CreateSubscription(customerUUID, creatorUUID, marketUUID, offerUUID, customerID string, customFee *float64, connectedAccountID string, priceID string) (*stripe.Subscription, error) {
    fee := MerchantFeePercent
    if customFee != nil {
        fee = *customFee
    }

    params := &stripe.SubscriptionParams{
        Customer: stripe.String(customerID),
        Items: []*stripe.SubscriptionItemsParams{
            {
                Price: stripe.String(priceID),
            },
        },
        Metadata: map[string]string{
            "_customerUUID":  customerUUID,
            "_creatorUUID":   creatorUUID,
            "_marketUUID":  marketUUID,
            "_offerUUID":   offerUUID,
        },
        ApplicationFeePercent: stripe.Float64(fee),
    }

    params.SetStripeAccount(connectedAccountID)
    return s.client.Subscriptions.New(params)
}
winged adder
#

Will the customer pay only to your main application/Platform? And you want to pay the funds out to your Connected accounts after? I.e. your customers won't directly interact with the Connected accounts?

hexed fog
#

I understand this resource_missing error. It is kind of separation between my stripe account (I call it host) and stripe connect accounts.
I'm looking a way to forward this customer to the stripe connect (just to make a subscription)

winged adder
#

This will require creating separate Customers for every new Connected account, and Payment Methods can't be easily reused across the Connected accounts, are you sure that's the experience you're looking to achieve?

winged adder
#

Do you have 1 website, or each Connected account has their own app?

hexed fog
winged adder
#

Alright, then you need to create a Customer and a Subscription on the Connected account (using Stripe-Account header).

#

And this customer cus_S4FZJRDYgWTH1a was created on the Platform, which is not correct for your case.

hexed fog
#

hmm this is problematic from a UX point of view
because each subscription comes from a different merchant, so a different stripe connect account
if someone wants to update his payment method, they have to do it several times for each merchant

like userA has 10 subscriptions in 10 merchants on my platform
so he has to update his card 10 times

#

but okay I got it

winged adder
#

Yes, that's why I wasn't sure if this path is correct for you.