In this conclusion to a five-part article series on adding checkout and order processing capabilities to an ecommerce website with Ruby on Rails, you will learn how to add the close order user story, which involves adding the ability to calculate shipping costs and other details. This article is excerpted from chapter nine of the book Practical Rails Projects, written by Eldon Alameda (Apress; ISBN: 1590597818).
Checkout and Order Processing: the User Side - Calculating Taxes (Page 3 of 3 )
Taxes vary from country to country and from state to state. Check your local tax system for how to calculate taxes.
As an example, if you live in the US and buy goods from an out-of-state store, then you are not required to pay sales tax. But, if you buy goods from a store located in your own state, the store charges you a sales tax, which is different for each state. Some goods are also exempt from sales taxes. Seehttp://en.wikipedia.org/wiki/ Sales_taxes_in_the_United_Statesfor more information about sales taxes in the US. For general information about sales taxes, seehttp://en.wikipedia.org/wiki/Sales_tax.
In Europe, most countries use a tax system called value-added tax (VAT). The VAT rate is different in each country. For example, in Finland, the standard VAT rate is 22%. Seehttp://en.wikipedia.org/wiki/Value_added_taxfor more information about VAT.
In the first part of this chapter, we built a checkout page that can be used by Emporium’s customers for placing orders. We also demonstrated how to bill the customer by integrating with PayPal and Authorize.Net, using the Active Merchant plugin and the Payment gem.
In the second part of the chapter we built an order-processing administration interface, which can be used to view and change the status of orders. At the end, we briefly explained how you can calculate shipping costs and taxes.
In the next chapter, we’ll show you how to add support for multiple languages, which is useful for increasing your customer base.
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.