GSTSession is a wrapper for class APISession which implements loading of ApiSetting and ApiLoginDetails from Json file. If host application wants to use API enabled controls only for single GSTIN then GSTSession may be used out-of-box.
APISession is base class of GSTSession; i.e. GSTSession class is derived from APISession class and has all properties and methods of APISession class apart from below 2 more properties.
GSTSession constructor takes two parameters
1. LoadAPISettingsFromConfigFile - Default value True
2. LoadAPILoginDetailsFromConfigFile - Default value True
Property
Description
Data Type
LoadAPISettingsFromConfigFile
Flag indicating whether ApiSetting is being loaded from Json config file "ApiSetting.json" in application folder.
bool
LoadAPILoginDetailsFromConfigFile
Flag indicating whether ApiLoginDetails is being loaded from Json config file "ApiLoginDetails.json" in application folder.
bool
NOTE:
On successful GetOTP API call, APIAuthorization control examines LoadAPILoginDetailsFromConfigFile flag and if found True, updates ApiLoginDetails.AppKey value in "ApiSetting.json" config file.
On successful GetAuthToken API call, APIAuthorization control examines LoadAPILoginDetailsFromConfigFile flag and if found True, updates ApiLoginDetails.AuthToken,
ApiLoginDetails.TokenExp, and
ApiLoginDetails.SessionEK
values in "ApiSetting.json" config file.
If LoadAPILoginDetailsFromConfigFile flag is false, wrapper class implementing and managing session has responsibility to handle events GetOTPCompleted, and GetAuthTokenCompleted and update above values in TaxPayers stored API session data.
Methods
Method
Description
LogAPITxn
Parm: TaxProGST.API.
APITxnLogArgs
Implements logging of API Transactions to file "GstApiTxnLog.txt" in program folder