#ceo_code
1 messages ยท Page 1 of 1 (latest)
๐ 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.
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.
- ceo_code, 20 hours ago, 24 messages
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
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 ?
Yep, as stated Tap to Pay is only available in certain locations: https://docs.stripe.com/terminal/payments/setup-reader/tap-to-pay?platform=ios#availability
So you'll just need to create a 'fake' location with an address in one of those countries
ok, but I done that, I sent to locationId prop from connectLocalMobileReader this location id , which is in US, however the same error
What's the tml_xxx ID? Please paste the full code
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])
What's the tml_xxx you're using?
I do not understand, so what is this tml_xxx which I have to use ?
readerDiscovered[0]?.locationId
it is a reader - detected by discoveredReaders function , and catch by onUpdateDiscoveredReaders from useStripeTerminal hook
st_simulated
Hmm, I don't think simulated works with Tap to Pay
ok, so how I can set a "fake" location and how I can use it?
What happens if you omit simulated: true from discoverReaders?
simulated: true or false same error
Can you paste the response of readerDiscovered in the handleDiscoverAReader callback
๐ 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
no, I see this error when I try to connectLocalMobileReader
Yeah but you are trying to use a simulated reader right now?
I'd test again with an actual device
dicoverReaders return something , which I was thinking was for testing, something with a locationId: st_simulated
that I used it
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
I was at step 3 on this documentation page https://docs.stripe.com/terminal/payments/connect-reader?reader-type=tap-to-pay, but I am not so sure what is on the backend side, if you asking me right now... I will verify and retry
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 )
ok, how I can set a fake location to work with?
ok, so I don't need to set something in stripe platform and use a token from there