Skip to content

Instantly share code, notes, and snippets.

@Migweld
Created May 19, 2015 13:57
Show Gist options
  • Save Migweld/956751ac7e4e3dba0ea8 to your computer and use it in GitHub Desktop.
Save Migweld/956751ac7e4e3dba0ea8 to your computer and use it in GitHub Desktop.
public function getTaxRate()
{
if(Input::has('country')){
//Get our inputs to send to Quaderno
$country = Input::get('country');
$vat = Input::get('vat');
$data = array('vat_number' => $vat, 'country' => $country);
QuadernoBase::init(Config::get('quaderno.sandbox_secret_key'), Config::get('quaderno.sandbox_url'));
$tax = QuadernoTax::calculate($data);
return $tax->rate;
} else {
return $this->createResponseFail('A country code is needed to process this request');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment