#Ali Ahmed

1 messages ยท Page 1 of 1 (latest)

meager orbitBOT
safe hawk
#

I want Help to integrate Stripe Terminal

#

Hi, how can I help?

earnest siren
#

I am implementing contactless payment in react native app on android but i have some issues

#

When i run app and initialized the terminal then we get response from didupdateddiscoveredReaders how to set in my state this response?

#

And how to get readers ?

safe hawk
#

Sorry, could you please explain in more detail what are you trying to achieve?

earnest siren
#

I want to implement contactless payment in react native android and i want when i scan card our payment successfully deduct from card and also for this achievement i implement stripe terminal in my react native app

#

but the issue is this i could not understand how to get reader ?

#

This is the response didupdatedcovered readers

#

Now how to save this reader in my local storage? or save in usestate?

earnest siren
#

is this readers?

#

If readers how to use this?

safe hawk
#

You should provide one of those objects to the connectBluetoothReader() method

earnest siren
#

const handleConnectBluetoothReader = async id => {
console.log(id, 'IDDDDDDDDS');
const {reader, error} = await connectBluetoothReader({
readerId: discoveredReaders[0].id,
// Since the simulated reader is not associated with a real location, we recommend
// specifying its existing mock location.
locationId: discoveredReaders[0].locationId,
});
console.log(reader, 'Documnetation Reader');
if (error) {
console.log('connectBluetoothReader error', error);
return;
}

console.log('Reader connected successfully', reader);

};

#

send the reader id and reader location is this code is right?

#

NO reader found in console from this method

safe hawk
#

Could you please share the exact error?

earnest siren
#

LOG Discover readers error: READER_ERROR.READER_BUSY, Could not execute discoverReaders because the SDK is busy with another command: discoverReaders.

#

First time reader get but when i call this function again give me this error why?

manic mist
#

we would need to see your complete code to be able to say why that's happening.

earnest siren
#

here is three files thats i am implement in my project

manic mist
#
onPress={() => {
          handleDiscoverReaders();
          handleConnectBluetoothReader(discoveredReaders[0].id);
        }}>

that seems wrong to me, you should not be trying to connect immediately.

earnest siren
#

How to implement this?

manic mist
#

look at the example app and do what it does

#

for now I'd suggest just running the exact example app and get that working before writing your own code.

earnest siren
#

OK Thanks

#

Can you tell me is contactless payment supported in android react native without connect harware device(READER)

#

I have implement this code but connectBluetoothReader error {"code": "INTEGRATION_ERROR.INVALID_REQUIRED_PARAMETER", "message": "You must provide a reader"}

safe hawk
earnest siren
#

Yes on Android Platform in react native

#

YES Reader object is not null

safe hawk
earnest siren
#

Here is readers Reader object is not null