Hello,
My friends, forgive me if I am doing wrong. Trying to revoke access token using version 2022-02-16. It was working fine with version 2022-01-20.
Can someone tell me how to specify Square version when creating Square client using c# please?
Api explorer shows example for curl specifying version as ‘Square-Version: 2022-02-16’.
I could modify my code using curl but there are too many lines already in my code.
Below is my c# code specifying square version when creating client.
private SquareClient client;
this.client = new SquareClient.Builder()
.SquareVersion(“2022-01-20”) //<— Does not work.
.Environment(Program.squareproduction ? Square.Environment.Production : Square.Environment.Sandbox)
.AccessToken(Program.squareproduction ? Properties.Resources.squareAccessToken : Properties.Resources.squareAccessTokenSandbox)
.Build();
Using Properties.Resources value is OK in my case because this application is heavily obfuscated.
The problem is…
My code was working ok on version “2022-01-20” when revoking access token (sending merchant_id without access_token as guided by API document) but new version “2022-02-16” 's Revoke Token API does not work when merchant_id is provided without access_token for calling Revoke Token API. I think this is Square API error for the version “2022-02-16”.
I also tried API explorer with hard coded. Result is error. Error message is asking basically I need provide access token. API document and API explorer says ‘do not send access token when sending merchant id.’
I could just send merchant’s access token instead of merchant id. However, I need to know [How to specify Square Version in c#] in case Square API version updates.
Can someone answer this please?
Thanks,