#Ali Ahmed
1 messages ยท Page 1 of 1 (latest)
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 ?
https://stripe.com/docs/terminal/payments/connect-reader
Thats link code was implemented
Sorry, could you please explain in more detail what are you trying to achieve?
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?
You should be getting the readers in the callback: https://stripe.com/docs/terminal/payments/connect-reader?terminal-sdk-platform=react-native&reader-type=bluetooth#discover-readers
You should provide one of those objects to the connectBluetoothReader() method
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
Could you please share the exact error?
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?
we would need to see your complete code to be able to say why that's happening.
onPress={() => {
handleDiscoverReaders();
handleConnectBluetoothReader(discoveredReaders[0].id);
}}>
that seems wrong to me, you should not be trying to connect immediately.
How to implement this?
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.
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"}
Do you mean, with Tap To Pay on Android? https://stripe.com/terminal/tap-to-pay
Have you made sure you the reader object is not null?
You will need to contact Stripe Support to have Tap to Pay on Android enabled for your account: https://support.stripe.com/?contact=true