#aaron_stripe-app-application-fee

1 messages ยท Page 1 of 1 (latest)

quaint bronzeBOT
#

๐Ÿ‘‹ 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/1273711949305085995

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

neon solstice
#

Basically we want to charge a 1% fee for successful checkout sessions created through our app. The app is a Stripe App installed on a customers Stripe account.

Is there a way to do this?

lost tapir
#

Hi ๐Ÿ‘‹

How does your app create checkout sessions? Can you share a request?

neon solstice
# lost tapir Hi ๐Ÿ‘‹ How does your app create checkout sessions? Can you share a request?

For sure.

    async createCheckoutSession(params = {}) {
        params["method"] = "POST";
        const response = await this.#stripeRequest(StripeUrls.stripeCheckoutSessionsUrl(), params);
        const responseData = await response.json();
        if (response.ok) {
            console.log(responseData)
            return responseData;
        } else {
            const error = responseData["error"];
            throw new StripeAPIError(`${error.type}: ${error.message}`)
        }
    }

    async #stripeRequest(url, params = {}) {
        const accessToken = await this.#refreshToken();
        const method = params["method"] || "GET";
        const headers = {
            "Authorization": `Bearer ${accessToken}`,
            "Content-Type": "application/x-www-form-urlencoded"
        };
        const data = params["data"] || {};
        url = `${url}?${new URLSearchParams(data)}`;
        let response = await fetch(url, {
            method: method,
            headers: headers
        });
        return response;
    }```
#

We basically just create a checkout session on the users account using their access_token, then direct users to that session URL

quaint bronzeBOT
full urchin
#

Hi there ๐Ÿ‘‹ catching up here as my teammate needed to step away.

quaint bronzeBOT
#

aaron_stripe-app-application-fee

full urchin
#

I'm looking around, because offhand I'm not sure you can charge for the usage of a Stripe App like that.

neon solstice
#

But they use the legacy Stripe Extentions so I'm not sure if that's different. I'm also not sure if they made all their customers Stripe Connect Accounts, if that's something we can even do while letting them keeping their account.

full urchin
#

Ah, good point about extensions, let me see how they did it and whether you can try to roll that forward to an App.

#

What mode are you creating the Checkout Sessions in?