#kelvin_docs

1 messages · Page 1 of 1 (latest)

magic umbraBOT
#

👋 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/1376772344525226037

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

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

lilac prairie
harsh stag
#

yes already did

#

but it just show the viewview in app, and call the redirect url doesn't close the webview

lilac prairie
#

Noted! Give me a moment I am looking into this!

#

Can you share your code?

harsh stag
#

sure

#

this is my init payment sheet setup:

      await initPaymentSheet({
        merchantDisplayName: 'Pelago',
        appearance: customAppearance,
        customerId,
        primaryButtonLabel: payLabel,
        allowsDelayedPaymentMethods: true,
        returnURL,
        defaultBillingDetails: {
          address: {
            country: getCountry() ?? 'SG',
          },
        },
        intentConfiguration: {
          mode: {
            amount: price * 100,
            currencyCode: currentCurrencyId ?? FALLBACK_CURRENCY,
          },
          confirmHandler: confirmHandler,
        },
      })

this is handle url:

  const handleDeepLink = useCallback(
    async (url: string | null) => {
      if (url) {
        const stripeHandled = await handleURLCallback(url)
        if (stripeHandled) {
          console.log('stripe handle')
          // This was a Stripe URL - you can return or add extra handling here as you see fit
        } else {
          const isKFLoginCallback = url.includes('app/KF/callback')
          const isKFRedeemCallback = url.includes('app/KF/redeem')

          if (isKFLoginCallback) {
            kfSignIn(url)
          }

          if (isKFRedeemCallback) {
            const [_, searchQuery] = url.split('?')
            const queryParams = qs.parse(searchQuery, {decode: false})
            pubSub.publish('kfLoginForRedeemComplete', queryParams)
          }
        }
      }
    },
    [handleURLCallback, kfSignIn],
  )

lilac prairie
#

Thanks!

oak wing
#

Hi there, I’m jack and I’m also an engineer from stripe

harsh stag
#

hi Jack

oak wing
#

Is the handleDeeplink function used in your useEffect hook?

harsh stag
#

yes

  useEffect(() => {
    const getUrlAsync = async () => {
      const initialUrl = await Linking.getInitialURL()
      handleDeepLink(initialUrl)
    }

    getUrlAsync()

    const deepLinkListener = Linking.addEventListener(
      'url',
      (event: {url: string}) => {
        handleDeepLink(event.url)
      },
    )

    return () => deepLinkListener.remove()
  }, [handleDeepLink])

oak wing
#

Ok. So you set pelago.com as your returnURL, and your customer will be redirect to pelago.com instead returning to your app?

#

Have you set up universal link for your returnURL?

harsh stag
#

i try to set return url : "pelago://pelago.com/en-SG/checkout/bookingId
but it always go to: "https://pelago.com/en-SG/?payment_intent=xxxxx"
event i try to completely remove returnURL from setup , it also point to "https://pelago.com/en-SG/?payment_intent=xxxxx"
universal link is already setup and work well with google ads, search result, ads link. etc...

Discover and book a wide range of travel activities, attraction tickets, and tours with Pelago by Singapore Airlines. Find the best things to do, events, and sightseeing tours for your next adventure

oak wing
#

Ok. Can you share with an example payment intent ID so that I can check the logs?

harsh stag
#

i try to use pelago:// scheme instead of http scheme because Stripe docs says universal ink aren't support

#

yes: piTransactionId": "pi_3RTF7xEOhqD74pZ21inZgi8Z_secret_3IWAbaaHVJTVlkgUEOHubPhcC

oak wing
harsh stag
#

it's set as urlScheme for StripeProvider

#

can i assume that i need to set urlScheme and returnURL exact the same?

oak wing
#

No, actually urlScheme is optional.

Your customer is redirected to "https://pelago.com" because your server set the return_url to https://traveller.dev.pelago.com

#

Can you remove the return_url from your server side confirmation call, and try again?

harsh stag
#

cool, let me talk to backend team, might i ask what is the expected behaviour when i remove return_url from sever side?

oak wing
#

one sec, let me test it out

#

Once your customer completes the 3DS auth, they'll be redirected to the returnURL, i.e., pelago://pelago.com

harsh stag
#

cool, thank Jack, testing

harsh stag
#

hi Jack, BE team is working, meanwhile might i ask is there any way to force ios open Web App (chrome, safari, etc..) rather than in app WebView for 3ds ?

oak wing
#

Why do you want to navigate your customer to external web browser to for 3DS authentication?

harsh stag
#

for my understanding, even return url is set to pelago://[expected-url-here] it's still a in app WebView so it cannot automatically close itself

#

but if it's an external web browser, it will navigate back and forth, then problem solve