-
Notifications
You must be signed in to change notification settings - Fork 26
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 #46 from gocardless/template-changes
v1.20.0 - Add support for tax on GoCardless fees
- Loading branch information
Showing
26 changed files
with
366 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,5 @@ | |
|
||
from .client import Client | ||
|
||
__version__ = '1.19.0' | ||
__version__ = '1.20.0' | ||
|
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 |
---|---|---|
|
@@ -41,3 +41,5 @@ | |
|
||
from .subscription import Subscription | ||
|
||
from .tax_rate import TaxRate | ||
|
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,61 @@ | ||
# WARNING: Do not edit by hand, this file was generated by Crank: | ||
# | ||
# https://github.com/gocardless/crank | ||
# | ||
|
||
class TaxRate(object): | ||
"""A thin wrapper around a tax_rate, providing easy access to its | ||
attributes. | ||
Example: | ||
tax_rate = client.tax_rates.get() | ||
tax_rate.id | ||
""" | ||
|
||
def __init__(self, attributes, api_response): | ||
self.attributes = attributes | ||
self.api_response = api_response | ||
|
||
@property | ||
def end_date(self): | ||
return self.attributes.get('end_date') | ||
|
||
|
||
@property | ||
def id(self): | ||
return self.attributes.get('id') | ||
|
||
|
||
@property | ||
def jurisdiction(self): | ||
return self.attributes.get('jurisdiction') | ||
|
||
|
||
@property | ||
def percentage(self): | ||
return self.attributes.get('percentage') | ||
|
||
|
||
@property | ||
def start_date(self): | ||
return self.attributes.get('start_date') | ||
|
||
|
||
@property | ||
def type(self): | ||
return self.attributes.get('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
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,67 @@ | ||
# WARNING: Do not edit by hand, this file was generated by Crank: | ||
# | ||
# https://github.com/gocardless/crank | ||
# | ||
|
||
from . import base_service | ||
from .. import resources | ||
from ..paginator import Paginator | ||
from .. import errors | ||
|
||
class TaxRatesService(base_service.BaseService): | ||
"""Service class that provides access to the tax_rates | ||
endpoints of the GoCardless Pro API. | ||
""" | ||
|
||
RESOURCE_CLASS = resources.TaxRate | ||
RESOURCE_NAME = 'tax_rates' | ||
|
||
|
||
def list(self,params=None, headers=None): | ||
"""List tax rates. | ||
Returns a [cursor-paginated](#api-usage-cursor-pagination) list of all | ||
tax rates. | ||
Args: | ||
params (dict, optional): Query string parameters. | ||
Returns: | ||
TaxRate | ||
""" | ||
path = '/tax_rates' | ||
|
||
|
||
response = self._perform_request('GET', path, params, headers, | ||
retry_failures=True) | ||
return self._resource_for(response) | ||
|
||
def all(self, params=None): | ||
if params is None: | ||
params = {} | ||
return Paginator(self, params) | ||
|
||
|
||
|
||
def get(self,identity,params=None, headers=None): | ||
"""Get a single tax rate. | ||
Retrieves the details of a tax rate. | ||
Args: | ||
identity (string): The unique identifier created by the jurisdiction, tax type and version | ||
params (dict, optional): Query string parameters. | ||
Returns: | ||
ListResponse of TaxRate instances | ||
""" | ||
path = self._sub_url_params('/tax_rates/:identity', { | ||
|
||
'identity': identity, | ||
}) | ||
|
||
|
||
response = self._perform_request('GET', path, params, headers, | ||
retry_failures=True) | ||
return self._resource_for(response) | ||
|
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.