Many PHP developers are working with custom shopping carts or other systems that need to calculate taxes. We have provided some working example code that will allow you to quickly integrate your applications with TaxCloud. The communication between your system and TaxCloud is done through web services. The example code includes all the web service calls, so you can simply call the supplied methods.
The first step is to create a merchant account at TaxCloud.net. After you do that, we will send you a copy of the user guide, which describes how to set up your merchant account and create a test site. Once you have set up your test site, the system will generate your TaxCloud API ID and Key, which identifies you to our system. The guide also describes how to get a USPS ID, which is required for the address verification service.
The next step is to determine where to place the integration in your system. In a shopping cart application, it’s standard to make it part of the checkout process, after the user has entered a shipping address.
The basic process is as follows:
1. Verify the customer’s address using the VerifyAddress service. This will determine the 9-digit zip code for the shipping address, which is necessary to make an accurate tax calculation. If your system already verifies addresses you can skip this step.
2. Look up the taxes for the items in the shopping cart.
3. Once the order has been completed, you call the Authorized and Captured services to complete the transaction in TaxCloud and to record that payment has been made. This follows the standard pattern of a credit card transaction. It is also possible to combine these two calls into one, which is what will be shown in this example. You can determine which method to use based on the design of your system.
That’s it! The TaxCloud system needs to receive a tax identification code (TIC ID) for each product so it can determine the tax rate to use. You will have to store this information along with your product. There is some optional functionality that you may want to include. TaxCloud can also manage exemption certificates for customers and apply them to orders. You can also return part or all of an order. We are just covering the basics in this post.
Read the rest of this entry »