angular-avatax
v0.0.2
Published
AngularJS service Avalara Avatax API
Downloads
3
Readme
Angular Avatax API
Unofficial Angular service to communicate with Avalara Avatax API
Installation
Bower
bower install --save angular-avatax
npm
npm install --save angular-avatax
yarn
yarn add angular-avatax
Usage
Include avalara into your angular module
angular.module('app', ['avalara'])
Configure Avatax by using AvataxProvider
. You can choose to supply username/password or accountId/licenseKey as well as environment (sandbox/ production). If no environment is provided, it will default to production
.
E.g. Sandbox environment using usernam/password
angular.module('app').config(AppConfig);
/* @ngInject */
function AppConfig(AvataxProvider) {
AvataxProvider.init({
username: '<YOUR USERNAME>',
password: '<YOUR PASSWORD>',
env: 'sandbox'
});
}
E.g. Production environment using accountId/licenseKey
angular.module('app').config(AppConfig);
/* @ngInject */
function AppConfig(AvataxProvider) {
AvataxProvider.init({
accountId: '<YOUR ACCOUNT ID>',
licenseKey: '<YOUR LICENSE KEY>'
});
}
Use Avatax
from a controller or service.
angular.module('app').controller('taxController', taxController);
/* @ngInject */
function taxController(Avatax) {
Avatax.transactions
.createTransactions({...})
.then(function (response) {
//do with response
});
}