-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
License Key Value Stored in config/project/project.yaml #30
Comments
+1 |
Good idea @curtismorte! We'll add this. |
As a side note, Per the documentation you can get around this by:
An example configuration file: ( <?php
use craft\helpers\App;
/**
* Avatax plugin for Craft CMS 3.x
*
* Calculate and add sales tax to an order's base tax using Avalara's AvaTax service.
*
* @link http://surprisehighway.com
* @copyright Copyright (c) 2019 Surprise Highway
*/
/**
* Avatax config.php
*
* This file exists only as a template for the Avatax settings.
* It does nothing on its own.
*
* Don't edit this file, instead copy it to 'craft/config' as 'avatax.php'
* and make your changes there to override default settings.
*
* Once copied to 'craft/config', this file will be multi-environment aware as
* well, so you can have different settings groups for each environment, just as
* you do for 'general.php'
*/
return [
'*' => [
// Enable debugging - true or false
'debug' => false,
// The address you will be posting from.
'shipFromName' => '',
'shipFromStreet1' => '',
'shipFromStreet2' => '',
'shipFromStreet3' => '',
'shipFromCity' => '',
'shipFromState' => '',
'shipFromZipCode' => '',
'shipFromCountry' => '',
// The default Avalara Tax Code to use for Products.
'defaultTaxCode' => '',
// The default Avalara Tax Code to use for Shipping.
'defaultShippingCode' => 'FR',
// The default Avalara Tax Code to use for Discounts.
'defaultDiscountCode' => 'OD010000',
// Production account information.
'accountId' => App::env('AVALARA_ACCOUNT_ID'),
'licenseKey' => App::env('AVALARA_LICENSE_KEY'),
'companyCode' => App::env('AVALARA_COMPANY_CODE'),
// Sandbox account information.
'sandboxAccountId' => App::env('AVALARA_SANDBOX_ACCOUNT_ID'),,
'sandboxLicenseKey' => App::env('AVALARA_SANDBOX_LICENSE_KEY'),
'sandboxCompanyCode' => App::env('AVALARA_SANDBOX_COMPANY_CODE'),
// AvaTax options - true or false
'enableTaxCalculation' => true,
'enableCommitting' => false,
'enableAddressValidation' => true,
'enablePartialRefunds' => true,
],
'dev' => [
// Enable debugging - true or false
'debug' => true,
// Environment - 'production' or 'sandbox'.
'environment' => 'sandbox',
],
'stage' => [
// Environment - 'production' or 'sandbox'.
'environment' => 'sandbox',
],
'production' => [
// Environment - 'production' or 'sandbox'.
'environment' => 'production',
// AvaTax options - true or false
'enableCommitting' => true,
],
];
|
Should this have been closed? Ideally, this plugin would utilize https://craftcms.com/docs/3.x/extend/environmental-settings.html#autosuggest-inputs |
@knynkwl @curtismorte - Just pushed v2.1.4 which addresses these issues. In the plugin settings I've made the account info fields autosuggest fields that will suggest ENV variables. On the project config side it turns out if you do something like
Updated in the readme here: Great ideas all around, thanks! |
Hey Guys,
Great plugin!
I happened to notice that the
sandboxLicenseKey
andlicenseKey
value is getting stored into the project configuration file (/config/project/project.yaml
). A solution to avoid committing sensitive values into version control is to use an environmental configuration.Per the Craft documentation:
For example, the current Avatax definition is:
With the environment settings specified above, that could turn into:
The text was updated successfully, but these errors were encountered: