Toolkit Configuration

It will be useful to the developers to configure toolkit into their solution.

Overview

This section gives an idea about the various toolkit configurations like toolkit appsettings static configuration, visual studio core application related middleware configuration and toolkit dynamic configuration through initalize API(/toolkitapi/01-initialize/).

How to config toolkit using Visual Studio

Visual studio configuration

Sample Prod configuration url’s filled here.
Click here to know more about other environment’s and their configuration url’s.
Here are the details of the config attributes and the sample inputs
1- Add configuration section to apsettings.json
PosSerialNumber - This config value to be filled with your POS Serial number value and it should be the equal value in all the configurations.
Toolkit will only support single point of sale integration not for the multiple point of sale integrations.

 "ToolkitConfig":
 {
  // connection string of sqllit database
  "LocalConnectionsString": "Data Source=D:\LocalReceipts.db;",
 //Egypt tax authority configuration section
 "EtaConfig":
 {
   // identity service url to acquire access token to invoicing APIs
   "IdentityServiceUrl": "https://id.eta.gov.eg/connect/token",
   // invoicing service base url, will be used while submission and syncing receipts
   "InvoicingServiceBaseUrl": "https://api.invoicing.eta.gov.eg",
   // invoicing portal base url, will be used while generation of QR codes
   "InvoicingPortalBaseUrl": "https://invoicing.eta.gov.eg",
   // version of invoicing service
   "InvoicingServiceVersion": "1",
   // The involved POS while integration with invoicing through nuget
   "PosSerial": "__PosSerialNumber__"
 }
 }

2- Add it to service collection using extension method
// By calling this service u can inject IToolkitHandler service
// and use any of its exposed functionality like issue, submit, sync … and so on
  services.AddToolkit(configuration); Usage Notes:
  1- You can combine the previous two steps in one step by calling the following line of code where you pass configuration object apart from your configuration file:
  services.AddToolkit(configuration, ToolkitConfig);

  2- You can delegate the creation of SQLite database to nuget by adding the following line of code in application startup:
  app.MigrateToolkitLocalStorage();

Toolkit Initialize Configuration

Toolkit initalize API should be useful to configure toolkit for the first time.
Read more…