-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: Discount expires_at is now DateTime * fix: Replace get_parameters with encoder/to_json
- Loading branch information
1 parent
2def986
commit 8671665
Showing
50 changed files
with
190 additions
and
212 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
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
21 changes: 3 additions & 18 deletions
21
paddle_billing/Resources/Adjustments/Operations/CreateAdjustment.py
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,30 +1,15 @@ | ||
from dataclasses import dataclass | ||
|
||
from paddle_billing.Operation import Operation | ||
|
||
from paddle_billing.Entities.Shared import Action | ||
|
||
from paddle_billing.Resources.Adjustments.Operations import CreateAdjustmentItem | ||
|
||
|
||
@dataclass | ||
class CreateAdjustment: | ||
class CreateAdjustment(Operation): | ||
action: Action | ||
items: list[CreateAdjustmentItem] | ||
reason: str | ||
transaction_id: str | ||
|
||
def get_parameters(self) -> dict: | ||
items = [ | ||
{ | ||
"item_id": item.item_id, | ||
"type": item.type, | ||
"amount": item.amount, | ||
} | ||
for item in self.items | ||
] | ||
|
||
return { | ||
"action": self.action.value, | ||
"items": items, | ||
"reason": self.reason, | ||
"transaction_id": self.transaction_id, | ||
} |
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
8 changes: 3 additions & 5 deletions
8
paddle_billing/Resources/Businesses/Operations/CreateBusiness.py
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,16 +1,14 @@ | ||
from dataclasses import asdict, dataclass | ||
from dataclasses import dataclass | ||
|
||
from paddle_billing.Operation import Operation | ||
from paddle_billing.Undefined import Undefined | ||
from paddle_billing.Entities.Shared import Contacts, CustomData | ||
|
||
|
||
@dataclass | ||
class CreateBusiness: | ||
class CreateBusiness(Operation): | ||
name: str | ||
company_number: str | None | Undefined = Undefined() | ||
tax_identifier: str | None | Undefined = Undefined() | ||
contacts: list[Contacts] | Undefined = Undefined() | ||
custom_data: CustomData | None | Undefined = Undefined() | ||
|
||
def get_parameters(self) -> dict: | ||
return asdict(self) |
8 changes: 3 additions & 5 deletions
8
paddle_billing/Resources/Businesses/Operations/UpdateBusiness.py
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,17 +1,15 @@ | ||
from dataclasses import asdict, dataclass | ||
from dataclasses import dataclass | ||
|
||
from paddle_billing.Operation import Operation | ||
from paddle_billing.Undefined import Undefined | ||
from paddle_billing.Entities.Shared import Contacts, CustomData, Status | ||
|
||
|
||
@dataclass | ||
class UpdateBusiness: | ||
class UpdateBusiness(Operation): | ||
name: str | Undefined = Undefined() | ||
company_number: str | None | Undefined = Undefined() | ||
tax_identifier: str | None | Undefined = Undefined() | ||
contacts: list[Contacts] | Undefined = Undefined() | ||
custom_data: CustomData | None | Undefined = Undefined() | ||
status: Status | Undefined = Undefined() | ||
|
||
def get_parameters(self) -> dict: | ||
return asdict(self) |
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
8 changes: 3 additions & 5 deletions
8
paddle_billing/Resources/Customers/Operations/CreateCustomer.py
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,15 +1,13 @@ | ||
from dataclasses import asdict, dataclass | ||
from dataclasses import dataclass | ||
|
||
from paddle_billing.Operation import Operation | ||
from paddle_billing.Undefined import Undefined | ||
from paddle_billing.Entities.Shared import CustomData | ||
|
||
|
||
@dataclass | ||
class CreateCustomer: | ||
class CreateCustomer(Operation): | ||
email: str | ||
name: str | None | Undefined = Undefined() | ||
custom_data: CustomData | None | Undefined = Undefined() | ||
locale: str | Undefined = Undefined() | ||
|
||
def get_parameters(self) -> dict: | ||
return asdict(self) |
Oops, something went wrong.