-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathquaderno_tax_rate.php
More file actions
45 lines (39 loc) · 922 Bytes
/
quaderno_tax_rate.php
File metadata and controls
45 lines (39 loc) · 922 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* Quaderno Tax Rate
*
* @package Quaderno PHP
* @author Quaderno <support@quaderno.io>
* @copyright Copyright (c) 2021, Quaderno
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
*/
class QuadernoTaxRate extends QuadernoModel
{
static protected $model = 'tax_rates';
static protected $error = null;
/**
* @param array|null $params
* @param callable|null $errorCallback
*
* @return false|QuadernoTaxRate
*/
public static function calculate($params, $errorCallback = null) {
$return = false;
$response = QuadernoBase::apiCall('GET', 'tax_rates', 'calculate', $params);
if (QuadernoBase::responseIsValid($response)) {
$return = new self($response['data']);
}
if (is_callable($errorCallback)) {
$errorCallback($response);
}
return $return;
}
/**
* @return string|null
*/
public static function getError()
{
return self::$error;
}
}
?>