/// <summary> /// Initializes a new instance of the <see cref="TaxJarTaxationGatewayMethod"/> class. /// </summary> /// <param name="taxMethod"> /// The tax method. /// </param> /// <param name="extendedData"> /// The extended Data collection from the provider. /// </param> public TaxJarTaxationGatewayMethod(ITaxMethod taxMethod, ExtendedDataCollection extendedData) : base(taxMethod) { _settings = extendedData.GetTaxJarProviderSettings(); _taxjarService = new TaxJarTaxService(_settings); }
public TaxJarTaxService(TaxJarProviderSettings settings) { _apiToken = settings.ApiToken; _apiVersion = settings.ApiVersion; }
/// <summary> /// Serializes the <see cref="TaxJarProviderSettings"/> and saves them in the extend data collection. /// </summary> /// <param name="extendedData"> /// The extended data. /// </param> /// <param name="settings"> /// The settings. /// </param> public static void SaveProviderSettings(this ExtendedDataCollection extendedData, TaxJarProviderSettings settings) { extendedData.SetValue(TaxJarProviderSettings.ExtendedDataKey, JsonConvert.SerializeObject(settings)); }