#PGP-terminal

1 messages · Page 1 of 1 (latest)

keen pendant
#

👋 happy to help

rancid lance
#

Thank you, allow me to explain further if you need.

keen pendant
#

yes please do

rancid lance
#

I have a physical terminal here I am trying to "discover" using the function mentioned earlier.
I am unsure where I am falling short

#

I'm a bit new to this so it's possible I'm overlooking something simple.

The code works to discover the sample reader when it's simulated, however the function will not find my location assigned reader when the simulation is ended.

I am connecting the location to the application in server.js with:
const connectionToken = stripe.terminal.connectionTokens.create({
location:'LOCATIONTOKEN'
});

civic warren
#

@rancid lance do you have the tmr_xxx ID of the reader? (should be in the dashboard after you've registered it). You might be using multiple Stripe accounts and got them mixed up, for instance

rancid lance
#

Nope

#

I have it correct

#

I just edited it out in case it was a security thing.

#

do you want me to share the reader id?

civic warren
#

yep

rancid lance
#

tmr_Eqexvwgas02AfI

civic warren
#

I notice that is registered in livemode, but presumably you are using test mode keys in the integration to discover it

rancid lance
#

const stripe = require("stripe")("sk_live_......

#

this line?

civic warren
#

hard to say, if that's the code that calls connectionTokens.create then it's in livemode yep(though I'm unsure why you'd jump from the simulated reader to a livemode payment without first using the test mode API with the physical reader)

#

in any case the reader can be registered in multiple modes, if you want to use it in test mode it has to be registered in test mode(by entering the code on a test mode location on https://dashboard.stripe.com/test/terminal or calling the register API with test mode keys)

rancid lance
#

thanks, I'll make sure it's all on test mode for now as I figure out how to charge the machine

civic warren
#

what do you mean by "charge the machine"?

rancid lance
#

I just mean to capture a charge with the api

#

on the machine

#

the terminal reader

civic warren
#

got it

rancid lance
#

I think I can archive for now because I didn't realize I was in live mode using test keys

#

or mix matched

#

ill ask another question later most likely

civic warren
#

circling back:

I would like to use the discoverReaderHandler() function with the {simulated:false} config, however switching it to true results in no readers being displayed.
not actually understanding this. simulated:true is what you use for testing without a physical reader. It would be totally expected that simulated:true returns nothing in live mode

#

well, have you been able to discover/connect to the reader?

#

I'd like to help you do that before moving on, since it should be simple enough, the discovery is straightforward and should just work

rancid lance
#

nope haven't managed that yet

#

currently putting my api key to test one

#

// Handler for a "Discover readers" button
function discoverReaderHandler() {
var config = {simulated: false};
terminal.discoverReaders(config).then(function(discoverResult) {
if (discoverResult.error) {
console.log('Failed to discover: ', discoverResult.error);
} else if (discoverResult.discoveredReaders.length === 0) {
console.log('No available readers.');
} else {
discoveredReaders = discoverResult.discoveredReaders;
log('terminal.discoverReaders', discoveredReaders);
}
});
}

#

There's a button on the webpage which is labelled "Discover Readers" and when it's pressed, should output one of those console logs, however it wont'.

#

I believe I have switched it to test mode keys and a test mode pos on a test mode location.

civic warren
#

does that code definitely run? you say none of the console.logs from the Promise are called, but can you add some logs/breakpoints to determine if your code even gets to that point of calling discoverReaders?

#

I'm looking at your API logs and such as well right now and it seem like everything is correct on that end in terms of registering the reader + creating the connection token, so that's good at least

rancid lance
#

finally got it to be discovered on test mode, thanks

civic warren
#

great!