Drupal Development

Drupal 8 Commerce Tax for VAT and Sales Tax

Today I have been working through an issue with commerce tax.  I had to apply a patch that allows me to configure taxes a bit more.

The patch allows Drupal commerce to decouple the tax calculation with the store address.  That way the Drupal commerce store can have multiple tax rates instead of one tax rate for the state the store is located in.  

Drupal Issue: https://www.drupal.org/project/commerce/issues/3005440

Exchange Rates API

Wow, what a great little API.  Exchange Rates API is a free API that helps with currency conversion rates.  

All that needs to be sent is the base currency and the currency that you want to convert.  Then the conversion rate is returned.  Making it simple. 

Example

GET Request: https://api.exchangeratesapi.io/latest?base=USD&symbols=GBP

Result: {"base":"EUR","rates":{"USD":1.1264,"GBP":0.86168},"date":"2019-04-11"}