#bwurtz999-terminal-reader

1 messages · Page 1 of 1 (latest)

leaden mason
#

Hey, can you share the Terminal reader ID?

worn salmon
#

tmr_Ejk8OwajHHeW6X

#

Also, this is the terminal location that was created but I can't find it in the dashboard

#

tml_Ejk7rALI6WkCyl

#

I got the success message on the reader itself that it could now accept payments, but when I reopened the app it said no readers available

leaden mason
#

You say they're not in the Dashboard?

worn salmon
#

The new location was not. I created a location for a connected account

// create the location
        $location = $stripe->terminal->locations->create([
            'display_name' => $this->location['name'],
            'address' => [
              'line1' => $this->location['address'],
              'city' => $this->location['city'],
              'state' => $this->location['state'],
              'postal_code' => $this->location['zip'],
              'country' => 'US',
            ],
        ], [
            'stripe_account' => $this->stripe_act,
        ]);

        // add the terminal to the location
        $stripe->terminal->readers->create([
            'registration_code' => $this->reader,
            'location' => $location->id,
        ], [
            'stripe_account' => $this->stripe_act,
        ]);

        // update cafe info
        $cafe = Cafe::where('stripe_act', $this->stripe_act)->first();
        $cafe->direct_charge = true;
        $cafe->terminal_location_id = $location->id;
        $cafe->save();
#

This request went through successfully, twice

#

But the reader was never able to be discovered by my app

leaden mason
#

Which Dashboard are you checking on?

worn salmon
#

I have access to both - mine and the Dashboard of the connected account

#

I get There was an error loading this location.

leaden mason
worn salmon
#

Yes it is

#

But I'm trying to facilitate direct charges, so I used the gist above to create a location for the connected account and assign the reader to that location

#

It worked locally and in staging

#

I moved it back after it didn't work

leaden mason
#

Can you share the ID of an API request that is failing? Your code is difficult to interpret as there's variables everywhere

worn salmon
#

I'm sorry I'm an idiot

leaden mason
#

No you aren't 🙂

worn salmon
#

I was looking in the wrong spot

leaden mason
#

All sorted?

worn salmon
#

The location is created successfully

#

well yes and no

#

the location is created with the reader

#

but my app still says no readers available

#

I'm sure the issue is on my end but I can't figure it out

leaden mason
#

Can you share the code where you're attempting to connect to the reader?

worn salmon
#
function fetchConnectionToken() {
  // Your backend should call /v1/terminal/connection_tokens and return the JSON response from Stripe
  return fetch("{{ route('location-stripe-connection') }}?useCaseId={{ $useCaseId }}&organizationId={{ $organization_id }}&locationId={{ $location_id }}", { method: "POST" })
    .then(function(response) {
      return response.json();
    })
    .then(function(data) {
      return data.secret;
    });
}

I use the documentation from Stripe. This currently works at other locations. And it works when I switch back to not using direct charges

#

Oh I think I found the issue. I don't think my connection token function is working correctly

leaden mason
#

Can I see the backend call that API is making?

worn salmon
#

I found the issue. It's not directing that API call properly. Not a Stripe issue!

leaden mason
#

Perfect!

worn salmon
#

Thank you for your help and patience!

leaden mason
#

Of course!