Skip to content

Commit

Permalink
Merge pull request #8 from anyarms/master
Browse files Browse the repository at this point in the history
Added composer.json and adapted readme to reflect
  • Loading branch information
Anya Stettler committed Aug 20, 2014
2 parents 646fda2 + 9193ad9 commit 24b9e4a
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 41 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,9 @@ pip-log.txt

# Mac crap
.DS_Store

# Composer stuff
Samples/composer.json
Samples/vendor/
Samples/composer.lock
vendor/
55 changes: 34 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,10 @@ This is a PHP sample demonstrating the [AvaTax REST API](http://developer.avalar
[tax/get POST](http://developer.avalara.com/api-docs/rest/tax/post/), [tax/get GET](http://developer.avalara.com/api-docs/rest/tax/get), [tax/cancel POST](http://developer.avalara.com/api-docs/rest/tax/cancel), and [address/validate GET](http://developer.avalara.com/api-docs/rest/address-validation).

For more information on the use of these methods and the AvaTax product, please visit our [developer site](http://developer.avalara.com/) or [homepage](http://www.avalara.com/)

Contents:
----------

<table>
<th colspan="2" align=left>Sample Files</th>
<tr><td>CancelTaxTest.php</td><td>Demonstrates the <a href="http://developer.avalara.com/api-docs/rest/tax/cancel">CancelTax</a> method used to <a href="http://developer.avalara.com/api-docs/api-reference/canceltax">void a document</a>.</td></tr>
<tr><td>EstimateTaxTest.php</td><td>Demonstrates the <a href="http://developer.avalara.com/api-docs/rest/tax/get">EstimateTax</a> method used for product- and line- indifferent tax estimates.</td></tr>
<tr><td>GetTaxTest.php</td><td>Demonstrates the <a href="http://developer.avalara.com/api-docs/rest/tax/post">GetTax</a> method used for product- and line- specific <a href="http://developer.avalara.com/api-docs/api-reference/gettax">calculation</a>.</td></tr>
<tr><td>PingTest.php</td><td>Uses a hardcoded EstimateTax call to test connectivity and credential information.</td></tr>
<tr><td>ValidateAddressTest.php</td><td>Demonstrates the <a href="http://developer.avalara.com/api-docs/rest/address-validation">ValidateAddress</a> method to <a href="http://developer.avalara.com/api-docs/api-reference/address-validation">normalize an address</a>.</td></tr>
<th colspan="2" align=left>Other Files</th>
<tr><td>AvaTaxClasses/</td><td>Contains the core classes that make the service calls.</td></tr>
<tr><td>.gitattributes</td><td>-</td></tr>
<tr><td>.gitignore</td><td>-</td></tr>
<tr><td>LICENSE.md</td><td>-</td></tr>
<tr><td>README.md</td><td>-</td></tr>
</table>

Dependencies:
-----------
- PHP 5.3 or later
- Not tested on versions older than PHP 5.3
- PHP 5.3 or later (not tested on versions older than PHP 5.3)

Requirements:
----------
Expand All @@ -44,4 +25,36 @@ for your system, uncomment ONE of the following two options in that file:
// To set the path manually, uncomment the following two lines. If you choose to manually set the path, make sure you have commented out the line above
// that tells curl to NOT use SSL.
//$ca = "C:/curl/curl-ca-bundle.crt";
//curl_setopt($curl, CURLOPT_CAINFO, $ca);
//curl_setopt($curl, CURLOPT_CAINFO, $ca);

- If you would like to use these core classes as part of a project and manage your depencies through [composer](https://getcomposer.org/), the Avatax classes can be added to your existing project by adding
```
"repositories": [
{
"type": "vcs",
"url": "https://github.com/avadev/AvaTax-Calc-REST-PHP"
}
],
"require": {
"avalara/avatax": "*"
}
```
to your composer.json file and run `php composer.phar update` from your command line.

Contents:
----------

<table>
<th colspan="2" align=left>Sample Files</th>
<tr><td>CancelTaxTest.php</td><td>Demonstrates the <a href="http://developer.avalara.com/api-docs/rest/tax/cancel">CancelTax</a> method used to <a href="http://developer.avalara.com/api-docs/api-reference/canceltax">void a document</a>.</td></tr>
<tr><td>EstimateTaxTest.php</td><td>Demonstrates the <a href="http://developer.avalara.com/api-docs/rest/tax/get">EstimateTax</a> method used for product- and line- indifferent tax estimates.</td></tr>
<tr><td>GetTaxTest.php</td><td>Demonstrates the <a href="http://developer.avalara.com/api-docs/rest/tax/post">GetTax</a> method used for product- and line- specific <a href="http://developer.avalara.com/api-docs/api-reference/gettax">calculation</a>.</td></tr>
<tr><td>PingTest.php</td><td>Uses a hardcoded EstimateTax call to test connectivity and credential information.</td></tr>
<tr><td>ValidateAddressTest.php</td><td>Demonstrates the <a href="http://developer.avalara.com/api-docs/rest/address-validation">ValidateAddress</a> method to <a href="http://developer.avalara.com/api-docs/api-reference/address-validation">normalize an address</a>.</td></tr>
<th colspan="2" align=left>Other Files</th>
<tr><td>AvaTaxClasses/</td><td>Contains the core classes that make the service calls.</td></tr>
<tr><td>.gitattributes</td><td>-</td></tr>
<tr><td>.gitignore</td><td>-</td></tr>
<tr><td>LICENSE.md</td><td>-</td></tr>
<tr><td>README.md</td><td>-</td></tr>
</table>
9 changes: 5 additions & 4 deletions CancelTaxTest.php → Samples/CancelTaxTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php
require('AvaTaxClasses/AvaTax.php');
require('../AvaTaxClasses/AvaTax.php');
include 'configuration.php';

// Header Level Elements
// Required Header Level Elements
$serviceURL = "https://development.avalara.net";
$accountNumber = "1234567890";
$licenseKey = "A1B2C3D4E5F6G7H8";
$serviceURL = $configuration['serviceURL'];
$accountNumber = $configuration['accountNumber'];
$licenseKey = $configuration['licenseKey'];

$taxSvc = new TaxServiceRest($serviceURL, $accountNumber, $licenseKey);
$cancelTaxRequest = new CancelTaxRequest();
Expand Down
9 changes: 5 additions & 4 deletions EstimateTaxTest.php → Samples/EstimateTaxTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php
require('AvaTaxClasses/AvaTax.php');
require('../AvaTaxClasses/AvaTax.php');
include 'configuration.php';

// Header Level Elements
// Required Header Level Elements
$serviceURL = "https://development.avalara.net";
$accountNumber = "1234567890";
$licenseKey = "A1B2C3D4E5F6G7H8";
$serviceURL = $configuration['serviceURL'];
$accountNumber = $configuration['accountNumber'];
$licenseKey = $configuration['licenseKey'];

$taxSvc = new TaxServiceRest($serviceURL, $accountNumber, $licenseKey);

Expand Down
9 changes: 5 additions & 4 deletions GetTaxTest.php → Samples/GetTaxTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php
require('AvaTaxClasses/AvaTax.php');
require('../AvaTaxClasses/AvaTax.php');
include 'configuration.php';

// Header Level Elements
// Required Header Level Elements
$serviceURL = "https://development.avalara.net";
$accountNumber = "1234567890";
$licenseKey = "A1B2C3D4E5F6G7H8";
$serviceURL = $configuration['serviceURL'];
$accountNumber = $configuration['accountNumber'];
$licenseKey = $configuration['licenseKey'];

$taxSvc = new TaxServiceRest($serviceURL, $accountNumber, $licenseKey);
$getTaxRequest = new GetTaxRequest();
Expand Down
9 changes: 5 additions & 4 deletions PingTest.php → Samples/PingTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php
require('AvaTaxClasses/AvaTax.php');
require('../AvaTaxClasses/AvaTax.php');
include 'configuration.php';

// Header Level Elements
// Required Header Level Elements
$serviceURL = "https://development.avalara.net";
$accountNumber = "1234567890";
$licenseKey = "A1B2C3D4E5F6G7H8";
$serviceURL = $configuration['serviceURL'];
$accountNumber = $configuration['accountNumber'];
$licenseKey = $configuration['licenseKey'];

$taxSvc = new TaxServiceRest($serviceURL, $accountNumber, $licenseKey);

Expand Down
9 changes: 5 additions & 4 deletions ValidateAddressTest.php → Samples/ValidateAddressTest.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php
require('AvaTaxClasses/AvaTax.php');
require('../AvaTaxClasses/AvaTax.php');
include 'configuration.php';

// Header Level Elements
// Required Header Level Elements
$serviceURL = "https://development.avalara.net";
$accountNumber = "1234567890";
$licenseKey = "A1B2C3D4E5F6G7H8";
$serviceURL = $configuration['serviceURL'];
$accountNumber = $configuration['accountNumber'];
$licenseKey = $configuration['licenseKey'];

$addressSvc = new AddressServiceRest($serviceURL, $accountNumber, $licenseKey);
$address = new Address();
Expand Down
8 changes: 8 additions & 0 deletions Samples/configuration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

$configuration = Array();
$configuration['accountNumber'] = "1234567890";
$configuration['licenseKey'] = "A1B2C3D4E5F6G7H8";
$configuration['serviceURL'] = "https://development.avalara.net";

?>
9 changes: 9 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "avalara/avatax",
"version": "14.4.2",
"description": "A set of classes to assist with integration to the Avalara AvaTax REST API.",
"require": {
"php": ">=5.3.0"
},
"minimum-stability": "dev"
}

0 comments on commit 24b9e4a

Please sign in to comment.