-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from gocardless/template-changes
v4.4.0 - Added support for tax
- Loading branch information
Showing
21 changed files
with
321 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
/** | ||
* WARNING: Do not edit by hand, this file was generated by Crank: | ||
* | ||
* https://github.com/gocardless/crank | ||
*/ | ||
|
||
namespace GoCardlessPro\Resources; | ||
|
||
/** | ||
* A thin wrapper around a tax_rate, providing access to its | ||
* attributes | ||
* | ||
* @property-read $end_date | ||
* @property-read $id | ||
* @property-read $jurisdiction | ||
* @property-read $percentage | ||
* @property-read $start_date | ||
* @property-read $type | ||
*/ | ||
class TaxRate extends BaseResource | ||
{ | ||
protected $model_name = "TaxRate"; | ||
|
||
/** | ||
* Date at which GoCardless stopped applying the tax rate for the | ||
* jurisdiction. | ||
*/ | ||
protected $end_date; | ||
|
||
/** | ||
* The unique identifier created by the jurisdiction, tax type and version | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* The jurisdiction this tax rate applies to | ||
*/ | ||
protected $jurisdiction; | ||
|
||
/** | ||
* The percentage of tax that is applied onto of GoCardless fees | ||
*/ | ||
protected $percentage; | ||
|
||
/** | ||
* Date at which GoCardless started applying the tax rate in the | ||
* jurisdiction. | ||
*/ | ||
protected $start_date; | ||
|
||
/** | ||
* The type of tax applied by this rate | ||
*/ | ||
protected $type; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<?php | ||
/** | ||
* WARNING: Do not edit by hand, this file was generated by Crank: | ||
* | ||
* https://github.com/gocardless/crank | ||
*/ | ||
|
||
namespace GoCardlessPro\Services; | ||
|
||
use \GoCardlessPro\Core\Paginator; | ||
use \GoCardlessPro\Core\Util; | ||
use \GoCardlessPro\Core\ListResponse; | ||
use \GoCardlessPro\Resources\TaxRate; | ||
use \GoCardlessPro\Core\Exception\InvalidStateException; | ||
|
||
|
||
/** | ||
* Service that provides access to the TaxRate | ||
* endpoints of the API | ||
* | ||
* @method list() | ||
* @method get() | ||
*/ | ||
class TaxRatesService extends BaseService | ||
{ | ||
|
||
protected $envelope_key = 'tax_rates'; | ||
protected $resource_class = '\GoCardlessPro\Resources\TaxRate'; | ||
|
||
|
||
/** | ||
* List tax rates | ||
* | ||
* Example URL: /tax_rates | ||
* | ||
* @param string[mixed] $params An associative array for any params | ||
* @return ListResponse | ||
**/ | ||
protected function _doList($params = array()) | ||
{ | ||
$path = "/tax_rates"; | ||
if(isset($params['params'])) { $params['query'] = $params['params']; | ||
unset($params['params']); | ||
} | ||
|
||
|
||
$response = $this->api_client->get($path, $params); | ||
|
||
|
||
return $this->getResourceForResponse($response); | ||
} | ||
|
||
/** | ||
* Get a single tax rate | ||
* | ||
* Example URL: /tax_rates/:identity | ||
* | ||
* @param string $identity The unique identifier created by the jurisdiction, tax type | ||
and version | ||
* @param string[mixed] $params An associative array for any params | ||
* @return TaxRate | ||
**/ | ||
public function get($identity, $params = array()) | ||
{ | ||
$path = Util::subUrl( | ||
'/tax_rates/:identity', | ||
array( | ||
|
||
'identity' => $identity | ||
) | ||
); | ||
if(isset($params['params'])) { $params['query'] = $params['params']; | ||
unset($params['params']); | ||
} | ||
|
||
|
||
$response = $this->api_client->get($path, $params); | ||
|
||
|
||
return $this->getResourceForResponse($response); | ||
} | ||
|
||
/** | ||
* List tax rates | ||
* | ||
* Example URL: /tax_rates | ||
* | ||
* @param string[mixed] $params | ||
* @return Paginator | ||
**/ | ||
public function all($params = array()) | ||
{ | ||
return new Paginator($this, $params); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.