I have an app which stores users cards just prior to placing the first order on the app… this COF is then used for subsequent purchases from various other merchants. Can someone give me a pointer as to where I can find docs which show how to make this payment to the merchant? I assume the locationId (on the CreatePayment) is the identifier for the merchant and the oAuth AccessToken setting somewhere on the client. I am doing this in C#.
I have tried the following when creating the client
1.
NOTE: merchantAccessToken is set as a bearer token in the header…
new Square.SquareClient.Builder()
.AddAdditionalHeader(“Authorization”,$“Bearer {merchantAccessToken}”)
.AccessToken(“squareAccessToken”)
.SquareVersion(“squareVersion”)
.Environment(“squareEnvironment”)
.Build();
I have also tried
NOTE: merchantAccessToken is set as the AccessToken
new Square.SquareClient.Builder()
.AccessToken(“merchantAccessToken”)
.SquareVersion(“squareVersion”)
.Environment(“squareEnvironment”)
.Build();
The first method, I get this error message:
Category: “INVALID_REQUEST_ERROR”
Code: “BAD_REQUEST”
Detail: “Not authorized to take payments with location_id=xxxxxxxxxxx”
Field: null
The second method, I get the message:
Category: “AUTHENTICATION_ERROR”
Code: “FORBIDDEN”
Detail: “Unauthorized to use this card”
Field: “sounce_id”
Can someone nudge me in the right direction please?