-
Notifications
You must be signed in to change notification settings - Fork 436
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b3b477a
commit bf852fd
Showing
6 changed files
with
128 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v237 | ||
v275 |
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,8 @@ | ||
# -*- coding: utf-8 -*- | ||
# File generated from our OpenAPI spec | ||
from __future__ import absolute_import, division, print_function | ||
|
||
# flake8: noqa | ||
|
||
from stripe.api_resources.tax.calculation import Calculation | ||
from stripe.api_resources.tax.transaction import Transaction |
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,45 @@ | ||
# -*- coding: utf-8 -*- | ||
# File generated from our OpenAPI spec | ||
from __future__ import absolute_import, division, print_function | ||
|
||
from stripe import util | ||
from stripe.api_resources.abstract import CreateableAPIResource | ||
|
||
|
||
class Calculation(CreateableAPIResource): | ||
""" | ||
A Tax `Calculation` allows you to calculate the tax to collect from your customer. | ||
""" | ||
|
||
OBJECT_NAME = "tax.calculation" | ||
|
||
@classmethod | ||
def _cls_list_line_items( | ||
cls, | ||
calculation, | ||
api_key=None, | ||
stripe_version=None, | ||
stripe_account=None, | ||
**params | ||
): | ||
return cls._static_request( | ||
"get", | ||
"/v1/tax/calculations/{calculation}/line_items".format( | ||
calculation=util.sanitize_id(calculation) | ||
), | ||
api_key=api_key, | ||
stripe_version=stripe_version, | ||
stripe_account=stripe_account, | ||
params=params, | ||
) | ||
|
||
@util.class_method_variant("_cls_list_line_items") | ||
def list_line_items(self, idempotency_key=None, **params): | ||
return self._request( | ||
"get", | ||
"/v1/tax/calculations/{calculation}/line_items".format( | ||
calculation=util.sanitize_id(self.get("id")) | ||
), | ||
idempotency_key=idempotency_key, | ||
params=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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# -*- coding: utf-8 -*- | ||
# File generated from our OpenAPI spec | ||
from __future__ import absolute_import, division, print_function | ||
|
||
from stripe import util | ||
from stripe.api_resources.abstract import CreateableAPIResource | ||
|
||
|
||
class Transaction(CreateableAPIResource): | ||
""" | ||
A Tax `Transaction` records the tax collected from or refunded to your customer. | ||
""" | ||
|
||
OBJECT_NAME = "tax.transaction" | ||
|
||
@classmethod | ||
def create_from_calculation( | ||
cls, api_key=None, stripe_version=None, stripe_account=None, **params | ||
): | ||
return cls._static_request( | ||
"post", | ||
"/v1/tax/transactions/create_from_calculation", | ||
api_key=api_key, | ||
stripe_version=stripe_version, | ||
stripe_account=stripe_account, | ||
params=params, | ||
) | ||
|
||
@classmethod | ||
def create_reversal( | ||
cls, api_key=None, stripe_version=None, stripe_account=None, **params | ||
): | ||
return cls._static_request( | ||
"post", | ||
"/v1/tax/transactions/create_reversal", | ||
api_key=api_key, | ||
stripe_version=stripe_version, | ||
stripe_account=stripe_account, | ||
params=params, | ||
) | ||
|
||
@classmethod | ||
def _cls_list_line_items( | ||
cls, | ||
transaction, | ||
api_key=None, | ||
stripe_version=None, | ||
stripe_account=None, | ||
**params | ||
): | ||
return cls._static_request( | ||
"get", | ||
"/v1/tax/transactions/{transaction}/line_items".format( | ||
transaction=util.sanitize_id(transaction) | ||
), | ||
api_key=api_key, | ||
stripe_version=stripe_version, | ||
stripe_account=stripe_account, | ||
params=params, | ||
) | ||
|
||
@util.class_method_variant("_cls_list_line_items") | ||
def list_line_items(self, idempotency_key=None, **params): | ||
return self._request( | ||
"get", | ||
"/v1/tax/transactions/{transaction}/line_items".format( | ||
transaction=util.sanitize_id(self.get("id")) | ||
), | ||
idempotency_key=idempotency_key, | ||
params=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