Toolkit Nuget token method

This method supports to authenticating the taxpayers POS systems to facilitate the submission of receipts through the POS.

Initialize method Refresh cache method

Overview

Toolkit will communicate to the eReceipt’s authentication method to acquire authentication. Authentication will establish the connection to refreshing lookups/cache/submission/synching get submission details and so on.,
Couple of options available to acquire token:
Option 1 - only clientid & clientscecret will aquire token.
Option 2 - all the details like clientid, clientsecret, posserial, pososversion, possharedkey, posmodelframework(optional in case of pos) will acquire token.
In both the above cases upon validity token will be issued & persisted until it expires.

  1. Internally it will call the login taxpayer API to generate an access token and that will be used to authenticate the POS.
  2. To be able to authenticate the POS, the developer must provide the client ID and client secret that were provided when registering the POS.
  3. It will return the token which is an encoded JWT token structure. If the credentials are saved, token will be re-generate automatically from the background service, if the credentials are not opted for save and expires then the newly requested command will fail due to token unavailability.

Note! • PosSerial value to be filled with your POS Serial number value and it should be the equal value in all the configurations. • Optional and required parameters validation implemented.
• Saved credentials will be stored in encrypted format.
• Generated token will be persisted in credentials table of sql lite local db, if the user opted for it.
Toolkit will only support single point of sale integration not for the multiple point of sale integrations.

Signature

Signature: AuthenticateResponseDto respose = await _toolkitHandler.Authenticate(authenticateRequestDto)

These are the sample input values for authenticateRequestDto object. You need to try with your actual values.

var authenticateRequestDto = new AuthenticateRequestDto
{
ClientId = "64645972-4318-4c50-8abb-66a401cbfecd",
ClientSecret = "b081618e-187d-478e-b4b9-c8602626bc22",
PosSerial = "1235648",
PosOsVersion = "Windows",
PosModelFramework = "",
PresharedKey = "1234567990"
};

public class AuthenticateResponseDto : BaseResponseDto
{
 public string Token { get; set; } = null!;
}
public class BaseResponseDto {
 public string? CorrelationId { get; set; }
 public string? Target { get; set; }
 public string? Code { get; set; }
 public string? Message { get; set; }
 public object? Details { get; set; }
}

Inputs

authenticateRequestDto method contains these fields:

Input parameter Type Description Value example
ClientId String Specific client_id d0394a9f-0607-40de-a978-2d3eb8375b04
ClientSecret String specific client_secret 6d62315e-d65a-4e41-9112-4195ea834edf
PosSerial String This is POS Serial Number 1234567899
PosOsVersion String This is POS Version Number os
PosModelFramework String This is POS Model Framework Number 1
PresharedKey string This is POS Pre shared key 03ac674216f3e1…

Outputs

Output parameter Type Description Value example
Token String generated toolkit token eyJhbGciOiJSUzI1NiIsImtpZCI6Ijk2RjNBNjU2OEFEQzY0MzZDNjVBNDg1MUQ5REM0NTlFQTlCM0I1NTQiLCJ0eXAiOiJhdCtqd3QiLCJ4NXQiOiJsdk9tVm9yY1pEYkdXa2hSMmR4Rm5xbXp0VlEifQ.eyJuYmYiOjE2Njc0MDI0NjQsImV4cCI6MTY2NzQwNjA2NCwiaXNzIjoiaHR0cHM6Ly9pZC50ZXN0LmV0YS5nb3YuZWciLCJhdWQiOiJJbnZvaWNpbmdBUEkiLCJjbGllbnRfaWQiOiI2NDY0NTk3Mi00MzE4LTRjNTAtOGFiYi02NmE0MDFjYmZlZGMiLCJJc1RheFJlcHJlcyI6IjEiLCJJc0ludGVybWVkaWFyeSI6IjAiLCJuYW1lIjoiNzI5MTA0NjU2OjY0NjQ1OTcyLTQzMTgtNGM1MC04YWJiLTY2YTQwMWNiZmVkYzoxMjM0NTY4IiwiU1NJZCI6IjhhZThiZDBjLTIyZjUtNTVkMy1mNWNkLWJkNzBhODBlMjU4MCIsInByZWZlcnJlZF91c2VybmFtZSI6IlZlbmRvclNyaW5EZXZpY2UiLCJUYXhJZCI6IjMyIiwiVGF4UmluIjoiNzI5MTA0NjU2IiwiUHJvZklkIjoiNjUxMSIsIlBvc1NlcmlhbCI6IjEyMzQ1NjgiLCJEZXZpY2VJZCI6IjY1MTEiLCJJc1RheEFkbWluIjoiMCIsIklzU3lzdGVtIjoiMSIsIk5hdElkIjoiIiwiVGF4UHJvZlRhZ3MiOiJCMkMiLCJzY29wZSI6WyJJbnZvaWNpbmdBUEkiXX0.llgZCIQ1KXpH6Uyv-p1THdLZs1hnbqECIdXYX8uPtskOkbWApAZEgm1e72mlAYXvwl_4ELDQa57gEai9flYyqazsz-u6evfaXns5HVxsJWZHJQPnDfZC265F28LDEdURSTGNmfm6e3rhwe_q3x5kmORVlUPok-v_I9weOO9FETI4VSmEcvMdwKg9BYQmR2sgpuHRdwVk7J8NTuxNGVSed8flqfIfN6z1TUPT4QkU21E37T7cGUkWYNI7vw6PRB01lu9xEoL1YBjY1PfthhZtQehMlKglNT8UThLhp6Oxmb6tngi58LQsR36Y-slsb2apmuaL_COTnr3–UD_jz3iMA
CorrelationId String CorrelationId is a unique number for the request. It has nothing to do with the receipt. It gets a value only in case of an error.  
Target String Output target.  
Code String Code is an error code, and it’s only sent if there is an error. 404 / 500 etc.,
Message String Error message.  
Details String Details of the error.