#Bart - connect requests
1 messages · Page 1 of 1 (latest)
The request is being made by this account acct_1M4wHMK5hOX6qDIa but the resource is owned by this account acct_1M9wXQGfEmwQN0CF
that sholdnt be happening tho
That's the API request you made
Did you mean to pass the Stripe Account header in your request?
DisplayName: stripe.String(Operating_Name),
Address: &stripe.AddressParams{
Line1: stripe.String(line1),
City: stripe.String(city),
State: stripe.String(state),
Country: stripe.String(Country),
PostalCode: stripe.String(postal),
},
}
param.SetStripeAccount(Stripe_Account_ID)
resultloc, err := location.New(param)
if err != nil {
return "", errors.New(err.Error())
}```
yes i am
What about this location id: tml_E4S9Cg47VIV02T it should be connected to acct_1MA0vf2fCuSnvU8z
Okay but that creates the location. When you tried to retrieve it you didn't provide a Stripe Account
Neither the account making the request nor the account that owns the location matches that ID
l, _ := location.Get(
"tml_E4S9Cg47VIV02T",
nil,
)
fmt.Println(l)```
That doesn't tell me anything as I don't know who that key belong to
stripe.Key belong to my account
im trying to get the location information from one of my connected accounts
but what about creating the location ID
youre saying its making it for my account
when im trying to make it for the connected account id
tml_E4S9Cg47VIV02T
can you check what account ID owns that location id?
it should belong to acct_1MA0vf2fCuSnvU8z
Okay yes that one is owned by that account
DO you still get an error when attempting to retrieve that one with your own API key?
but im not making one with my own API key for my self
im using my API key to create a location id For my connected account
That won't work
Whatever account you create the location on needs to be the same account making the request to retrieve the location
wait what
im lost
im following this
im doing exactly this
Do you have a request ID?
I'm confused because you have shared 1 request error response. It was specific to retrieving a location. I told you the request was made on a separate account from the account that owns the location.
solemme get this straight,
Master account -> Connected Account -> Connected Account Location ID
i can no retrive the connected account id information
The location created with the code snippet you shared will be owned by the account specified as the Stripe Account. The request to retrieve that location. must also include that parameter
You need to make the retrieve request as the connect account
how would i do that
l, _ := location.Get(
"tml_E4S9Cg47VIV02T",
nil,
)
l.SetStripeAccount("acct_1MA0vf2fCuSnvU8z")
fmt.Println(l)```
this dosent work
The same way you do with any Stripe request, set the account before you make the request
Bart - connect requests
func main() {
stripe.Key = "sk_test_51M4mvOxcCi00Lzqy6IUs"
params := &stripe.TerminalLocationParams{}
params.SetStripeAccount("acct_1M4wHMK5hOX6qDIa")
l, _ := location.Get(
"tml_E4S9Cg47VIV02T",
params,
)
fmt.Println(l)
}
i tried this too
And you get the same result?
[ERROR] Request error from Stripe (status 404): {"code":"resource_missing","doc_url":"https://stripe.com/docs/error-codes/resource-missing","status":404,"message":"No such location: 'tml_E4S9Cg47VIV02T'","request_id":"req_gFQGpDalkvSUsF","request_log_url":"https://dashboard.stripe.com/test/logs/req_gFQGpDalkvSUsF?t=1669856768","type":"invalid_request_error"}
yes
and on the swift side of things
connectLocalMobileReader failed: Error Domain=com.stripe-terminal Code=9020 "No such location: 'tml_E4TACANHN0qbVN'" UserInfo={com.stripe-terminal:StripeAPIDocUrl=https://stripe.com/docs/error-codes/resource-missing, com.stripe-terminal:Message=No such location: 'tml_E4TACANHN0qbVN', com.stripe-terminal:HttpStatusCode=404, NSLocalizedDescription=No such location: 'tml_E4TACANHN0qbVN', com.stripe-terminal:StripeAPIRequestId=req_QV6ceCN3o9N77f, com.stripe-terminal:StripeAPIErrorType=invalid_request_error, com.stripe-terminal:StripeAPIErrorCode=resource_missing}
same error when attempting to use the location id and account id
👋 taking over here
hey there
so here is the run down
in my backend im creating an account id from the input values my client uses, then i create their connected account which shows up on my dashboard on stripe for connected accounts, then i use that account_id i get back to create a location ID, then when i enter the account_id and location_id in the app i get the following error```
connectLocalMobileReader failed: Error Domain=com.stripe-terminal Code=9020 "No such location: 'tml_E4TACANHN0qbVN'" UserInfo={com.stripe-terminal:StripeAPIDocUrl=https://stripe.com/docs/error-codes/resource-missing, com.stripe-terminal:Message=No such location: 'tml_E4TACANHN0qbVN', com.stripe-terminal:HttpStatusCode=404, NSLocalizedDescription=No such location: 'tml_E4TACANHN0qbVN', com.stripe-terminal:StripeAPIRequestId=req_QV6ceCN3o9N77f, com.stripe-terminal:StripeAPIErrorType=invalid_request_error, com.stripe-terminal:StripeAPIErrorCode=resource_missing}
Yeah I see the request https://dashboard.stripe.com/test/logs/req_gFQGpDalkvSUsF from acct_1M4wHMK5hOX6qDIa , but the location belongs to the account acct_1MA0vf2fCuSnvU8z
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
acct_1MA0vf2fCuSnvU8z | tml_E4S9Cg47VIV02T do these belong to each other
params.SetStripeAccount("acct_1M4wHMK5hOX6qDIa")
I think here you will need acct_1MA0vf2fCuSnvU8z instead
Yes acct_1MA0vf2fCuSnvU8z is a Connected Account, belongs to acct_1M4wHMK5hOX6qDIa which is a Platform Account
hmmm interesting
Country: stripe.String(Country),
Email: stripe.String(Email),
Type: stripe.String("express"),
DefaultCurrency: stripe.String(Currency),
BusinessType: stripe.String(Business_Type),
Settings: &stripe.AccountSettingsParams{
Payments: &stripe.AccountSettingsPaymentsParams{
StatementDescriptor: stripe.String(Operating_Name),
},
},
Individual: &stripe.PersonParams{
FirstName: stripe.String(First_Name),
LastName: stripe.String(Last_Name),
Phone: stripe.String(Phone_Number),
},
}
a, err := account.New(params)
if err != nil {
return "", errors.New("error creating stripe account - individual")
}
//Assigns the returned account id that was created
Stripe_Account_ID = a.ID```
this i mycode for creating a connected account
i get back the a.ID
then i create the location id
DisplayName: stripe.String(Operating_Name),
Address: &stripe.AddressParams{
Line1: stripe.String(line1),
City: stripe.String(city),
State: stripe.String(state),
Country: stripe.String(Country),
PostalCode: stripe.String(postal),
},
}
param.SetStripeAccount(Stripe_Account_ID)
resultloc, err := location.New(param)
if err != nil {
return "", errors.New(err.Error())
}
Locations := fmt.Sprintf("%s", resultloc.ID)```
i create the location ID using the stripe account id of the connected account
so why is it not working?
Right, that's great and expected. The location Id now belongs to the Connected Account
It's just the last step, when you want to get the location Id, you need to get in "on behalf of" the Connected Account. Because only Connected Account would understand it (only the Connected Account has a clue that it owns such a location object)
And you do that by specifying the Stripe Account header (SetStripeAccount) to the Connected Account Id (acct_1MA0vf2fCuSnvU8z)
Yeah but what's the value of Stripe_Account_ID in the line param.SetStripeAccount(Stripe_Account_ID) ?
its the account id of when i created the connected account
Yes, but looking at the log req_gFQGpDalkvSUsF, it seems still coming from your Platform account acct_1M4wHMK5hOX6qDIa (Taplyly)
Can you find the log at your Dashboard request log? https://dashboard.stripe.com/test/logs
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
params.SetStripeAccount("acct_1MA1Z6Gfsbf0tXx9")
l, _ := location.Get(
"tml_E4TGlwtEgZwpYg",
params,
)
fmt.Println(l)
}
this seems to work it gives me the connected account name
&{{0xc000326060} 0xc000326000 false Shadi Nach tml_E4TGlwtEgZwpYg false map[] terminal.location}
like its creating the account
and when i use the location id and the account id
it retrieves the data
like idk whats going on
param := &stripe.TerminalLocationParams{
DisplayName: stripe.String("1231231231231231"),
Address: &stripe.AddressParams{
Line1: stripe.String("111 S Connie Cir"),
City: stripe.String("Anaheim"),
State: stripe.String("CA"),
Country: stripe.String("US"),
PostalCode: stripe.String("92806"),
},
}
param.SetStripeAccount("acct_1MA1Z6Gfsbf0tXx9")
resultloc, err := location.New(param)
if err != nil {
fmt.Println(err)
}
fmt.Println(resultloc.ID)
}
even when i try this
dosent work
?
Hey, sorry will be back in a few mins
alright
no matter what i do it dosent work man
params := &stripe.TerminalLocationParams{}
params.SetStripeAccount("acct_1MA20vGasdZtfEll")
l, _ := location.Get(
"tml_E4TPjwJdpZJqX8",
params,
)
fmt.Println(l)
}```
when i do this it WORKS
but when i do it in swift
i get this error
connectLocalMobileReader failed: Error Domain=com.stripe-terminal Code=9020 "No such location: 'tml_E4TPjwJdpZJqX8'" UserInfo={com.stripe-terminal:StripeAPIDocUrl=https://stripe.com/docs/error-codes/resource-missing, com.stripe-terminal:Message=No such location: 'tml_E4TPjwJdpZJqX8', com.stripe-terminal:HttpStatusCode=404, NSLocalizedDescription=No such location: 'tml_E4TPjwJdpZJqX8', com.stripe-terminal:StripeAPIRequestId=req_QV6ceCN3o9N77f, com.stripe-terminal:StripeAPIErrorType=invalid_request_error, com.stripe-terminal:StripeAPIErrorCode=resource_missing}
So it works on backend, but not from Swift? How are you sending the request in Swift?
I think you just miss the part of setting the Stripe Account Header
like the code here, returns this &{{0xc0001086c0} 0xc000108660 false **** ******* tml_E4TQkwuGwxzARZ false map[] terminal.location}
so it works
hmm
I am a bit confused. That's not Swift code
yes im saying the golang code
to retrieve the location ID information based on the connected account id works
but when i attempt to do the same in transaction in swift using account id and location id
it returns the error i sent
here is my swift code
it returns connectLocalMobileReader failed: Error Domain=com.stripe-terminal Code=9020 "No such location: 'tml_E4TPjwJdpZJqX8'" UserInfo={com.stripe-terminal:StripeAPIDocUrl=https://stripe.com/docs/error-codes/resource-missing, com.stripe-terminal:Message=No such location: 'tml_E4TPjwJdpZJqX8', com.stripe-terminal:HttpStatusCode=404, NSLocalizedDescription=No such location: 'tml_E4TPjwJdpZJqX8', com.stripe-terminal:StripeAPIRequestId=req_QV6ceCN3o9N77f, com.stripe-terminal:StripeAPIErrorType=invalid_request_error, com.stripe-terminal:StripeAPIErrorCode=resource_missing}
So I think the onBehalfOf part is not how you specify the Connected Account
So if you look at your dashboard request log https://dashboard.stripe.com/test/logs you will still see the request on log req_QV6ceCN3o9N77f
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
If it has been done correctly, it should appear on the ConnectedAccount requests log
how is it does correctly
i cant find docs on it
im following this exactly
thats how it should be
Hey I am looking at it, there should be a way to passing in the stripeAccount into LocalMobileConnectionConfiguration...
yes but do you know the way ive been trying for the past 4 hours, the documentation is engrained in my head now
Taking a step back, why do you create a location belongs of a Connected Account to follow this specific Doc? https://stripe.com/docs/terminal/payments/connect-reader?reader-type=tap-to-pay-on-iphone. It probably only works with Destination Charge, which is a bit different
yes i do exactly that
acct_1MA2EK2fdyCgG0bf
tml_E4TQkwuGwxzARZ
here is my code
see the exact same
Yes, the issue is SetStripeAccount in Go lang, is correct, but the onBehalfOf in Swift, is not
what
ofc it is
im making the location in backeend
and im putting it in swift
but swift keeps throwing the errori sent you
Yeah, because the location is made belongs to the Connected Account, and we need to find a way to make Swift to understand it
Gimme a few mins
sure thing, im doing what youre saying but its just not working
see this works like the account id works and stuff
Yeah that's perfect (for the Go lang part)
yes the code works perfectly for golang, im able to check the location id based on conneccted accouunt id
but what about the swift code
Hi, can you double check when you create the Connection Token (before ever doing all these steps): https://stripe.com/docs/terminal/payments/setup-integration?terminal-sdk-platform=ios#initialize
Did the ConnectionToken created in backend with the StripeAccount header?
// In a new endpoint on your server, create a ConnectionToken and return the
// `secret` to your app. The SDK needs the `secret` to connect to a reader.
params := &stripe.TerminalConnectionTokenParams{}
ct, err := connectiontoken.New(params)
if err != nil {
return ResponseReturn("unable to create connection token", 500), nil
}
Token := fmt.Sprintf("%s", ct.Secret)
return ResponseReturn(Token, 200), nil```
yes
i did my connection token correctly
Here, the token doesn't include the Stripe Account. We want to use the Stripe Account and point to the Connected Account
in the params, can you also do
params.SetStripeAccount("acct_xxx")
so i have to include that in connection token too?
Yes, let's try it
alright i will in a bit thank you