#limit_docs

1 messages ยท Page 1 of 1 (latest)

delicate swanBOT
#

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

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

steel stream
#

Hello
Yeah that sounds contradicting.. I'm actually not 100% sure about the current state. I believe we do support Universal Links.. Have you already tried it and are seeing errors?

vapid carbon
#

yeah i have set the success and cancel urls with my app uri, but im getting a 500 error

steel stream
#

That doesn't seem like a Universal link though? That is just your custom URL scheme?

#

We support Custom URL Scheme for Payment flows. We recommend using Universal links for Onboarding

vapid carbon
#

Sorry, im terribly new to app development. I am also referring to this documentation

steel stream
#

The doc you're looking at is a complete doc that covers onboarding + payment flows

vapid carbon
#

which it mentions that universal links arent supported

#

i was following this section

#

which i presume to put the deep link instead

steel stream
#

Ah that's a totally different doc than you originally shared ๐Ÿ˜…

vapid carbon
#

yes im referring to both at once, sorry about that

steel stream
#

All good. So like I said above, we do support universal link for account onboarding.. Are you using Stripe Connect? (As in are you building a platform?)

#

IF not, we can focus on just the payment flows and debug the issue

vapid carbon
#

for context, im trying to get checkouts enabled in my ios app.

i have a backend that syncs to a webapp that generates the checkout session and redirects the user to the checkout url. im using the same api for my app

#

this is the snippet of the backend

// Handler for POST /subscription/checkout
const createCheckoutHandler: express.RequestHandler = async (req, res) => {
    try {
        const { userId } = getAuth(req)
        if (!userId) {
            res.status(401).json({ error: "Unauthorized" })
            return
        }

        const { tier, successUrl, cancelUrl } = req.body

        if (!tier || !successUrl || !cancelUrl) {
            res.status(400).json({ error: "Missing required fields: tier, successUrl, cancelUrl" })
            return
        }

        const user = await prisma.user.findUnique({ where: { id: userId } })
        if (!user) {
            res.status(404).json({ error: "User not found" })
            return
        }

        const session = await createCheckoutSession({ user, tier, successUrl, cancelUrl })
        res.json({ url: session.url })
    } catch (error) {
        console.error("Database error fetching user or creating session:", error)
        res.status(500).json({ error: "Failed to process checkout request" })
        return
    }
}```
steel stream
#

Gotcha. Are you planning to use a WebView for Checkout?

#

in your app

vapid carbon
#

yes, i dont plan to integrate my own checkout ui in the app

steel stream
#

Got it. Checkout Sessions API does not support custom URL scheme. You'd need to provide a Universal Link there instead.

If you were to integrate Mobile Payment Element and build your own UI then you could use custom URL scheme but with Checkout + WebView; you need to use Universal Link

vapid carbon
steel stream
#

Correct

vapid carbon
#

okay perfect. let me try that real quick