#ceo_code

1 messages ยท Page 1 of 1 (latest)

cosmic driftBOT
#

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

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

ocean sparrowBOT
#

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.

sharp tundra
#

Sorry, not understanding the issue. What is the issue and how is it surfacing in the development of your app?

#

AFAIK, the location of your app developers is irrelevant. The country support for Tap to Pay is only relative to the merchant account country

boreal hedge
#

Hello,
I need some help, I tried to implement connectLocalMobileReader function for tap to pay feature and I recevie this error:

The Tap to Pay reader is not supported in Romania (RO) as determined by the Location this reader is registered to, none - used merchant. For more information about which countries each Terminal reader may be used in, see https://stripe.com/docs/terminal/choosing-reader-and-sdk#availability."

Why and how I can implement whatever my location is ?

Learn about Stripe's pre-certified card readers and Tap to Pay.

sharp tundra
#

So you'll just need to create a 'fake' location with an address in one of those countries

boreal hedge
#

ok, but I done that, I sent to locationId prop from connectLocalMobileReader this location id , which is in US, however the same error

sharp tundra
#

What's the tml_xxx ID? Please paste the full code

boreal hedge
#

Full code here:

const { discoverReaders, discoveredReaders, cancelDiscovering, connectLocalMobileReader } =
useStripeTerminal({
  onUpdateDiscoveredReaders: (readers) => {
    console.log(">>>> readers:", readers)
    handleDiscoverAReader(readers)
    // The `readers` variable will contain an array of all the discovered readers.
  },
  onDidChangeConnectionStatus: (status) => {
    // access to the current connection status
    console.log(">>>> status:", status)
  },
});

const handleDiscoverAReader =async (readerDiscovered:any) =>{
  console.log(">>> handleReader: ", readerDiscovered)
  if (readerDiscovered.length > 0){
    const {reader, error} = await connectLocalMobileReader({
      reader: readerDiscovered[0],
      locationId: readerDiscovered[0]?.locationId
    })
    if (error) {
      console.warn('connectLocalMobileReader error:', error);
      return;
    }
    
    console.warn('Reader connected successfully', reader);
   }
  console.log(">>>> handleDiscoverAReader finished")
}

useEffect(() => {
  console.log('Starting reader discovery...')

  const discover = async () => {
    // console.log('Calling discoverReaders...')

    const { error } = await discoverReaders({
      discoveryMethod: 'localMobile',
      simulated: true, // false gives an error
    })

    if (error) {
      console.log('Error discovering readers:', error)
    } else {
      console.log('discoverReaders called successfully.')
    }
  }
  discover();

  return () => {
    console.log('Cancelling reader discovery...')
    cancelDiscovering()
  }
}, [discoverReaders, cancelDiscovering])
sharp tundra
#

What's the tml_xxx you're using?

boreal hedge
#

I do not understand, so what is this tml_xxx which I have to use ?

sharp tundra
#

readerDiscovered[0]?.locationId

boreal hedge
#

it is a reader - detected by discoveredReaders function , and catch by onUpdateDiscoveredReaders from useStripeTerminal hook

sharp tundra
#

OK, but what does the variable resolve to?

#

What is the actual value

boreal hedge
#

st_simulated

sharp tundra
#

Hmm, I don't think simulated works with Tap to Pay

boreal hedge
#

ok, so how I can set a "fake" location and how I can use it?

sharp tundra
#

What happens if you omit simulated: true from discoverReaders?

boreal hedge
#

simulated: true or false same error

cosmic driftBOT
sharp tundra
#

Can you paste the response of readerDiscovered in the handleDiscoverAReader callback

inner flame
#

๐Ÿ‘‹ you can't use a simulated reader or location to test tap to pay. But faking a location should work fine in development.

#

So next step is to create a location and hard code it

#

And then use an actual device to test

#

Hmm actually one sec

#

I could be wrong here -- you are seeing this error on discoverReaders()? It may be that you can't test tap to pay if you aren't in a supported location since we do error if the device itself doesn't meet criteria

boreal hedge
#

no, I see this error when I try to connectLocalMobileReader

inner flame
#

Yeah but you are trying to use a simulated reader right now?

#

I'd test again with an actual device

boreal hedge
#

dicoverReaders return something , which I was thinking was for testing, something with a locationId: st_simulated

#

that I used it

inner flame
#

Yeah because you are passing simulated: true right? But that is assuming you aren't working on a tap to pay integration here.

#

It is the same call if you were working on a Terminal integration using a different Reader

#

In which case you could test with the simulated reader

#

But you can't do that for tap to pay

boreal hedge
inner flame
#

Next step is to verify that you are passing a locationId for a location in a supported country and then to test on an actual device (make sure you don't have simulated: true )

boreal hedge
#

ok, how I can set a fake location to work with?

inner flame
#

So use a fake US-based address for instance

boreal hedge
#

ok, so I don't need to set something in stripe platform and use a token from there

inner flame
#

You can create locations via your Dashboard as well

#

Does the same thing as doing it via the API

#

Either way works