#bwurtz999-terminal-reader
1 messages · Page 1 of 1 (latest)
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
You say they're not in the Dashboard?
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
Which Dashboard are you checking on?
I have access to both - mine and the Dashboard of the connected account
I get There was an error loading this location.
tml_Ejk7rALI6WkCyl is on acct_1JXT2IFfB5Eb2cTl: https://dashboard.stripe.com/terminal/locations/tml_Ejk7rALI6WkCyl
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
Can you share the ID of an API request that is failing? Your code is difficult to interpret as there's variables everywhere
I'm sorry I'm an idiot
No you aren't 🙂
I was looking in the wrong spot
All sorted?
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
Can you share the code where you're attempting to connect to the reader?
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
Can I see the backend call that API is making?
I found the issue. It's not directing that API call properly. Not a Stripe issue!
Perfect!
Thank you for your help and patience!
Of course!