paddle-python-sdk 1.19.0__py3-none-any.whl → 1.20.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- paddle_billing/Client.py +1 -1
- paddle_billing/Entities/Reports/PaymentAttemptsReportType.py +11 -0
- paddle_billing/Entities/Reports/ReportFilter.py +1 -1
- paddle_billing/Entities/Reports/ReportFilterName.py +4 -0
- paddle_billing/Entities/Reports/ReportType.py +1 -0
- paddle_billing/Entities/Reports/__init__.py +3 -0
- paddle_billing/Notifications/Entities/Reports/ReportFilter.py +1 -1
- paddle_billing/Notifications/Entities/Reports/ReportFilterName.py +4 -0
- paddle_billing/Notifications/Entities/Reports/ReportType.py +1 -0
- paddle_billing/Resources/Products/Operations/ListProducts.py +8 -2
- paddle_billing/Resources/Reports/Operations/CreatePaymentAttemptsReport.py +39 -0
- paddle_billing/Resources/Reports/Operations/Filters/Filter.py +2 -2
- paddle_billing/Resources/Reports/Operations/Filters/IsCustomerPresentFilter.py +18 -0
- paddle_billing/Resources/Reports/Operations/Filters/IsNpaIncludedFilter.py +18 -0
- paddle_billing/Resources/Reports/Operations/Filters/IsSuccessfulFilter.py +18 -0
- paddle_billing/Resources/Reports/Operations/Filters/PaymentAttemptCreatedAtFilter.py +34 -0
- paddle_billing/Resources/Reports/Operations/Filters/__init__.py +12 -0
- paddle_billing/Resources/Reports/Operations/__init__.py +3 -0
- {paddle_python_sdk-1.19.0.dist-info → paddle_python_sdk-1.20.0.dist-info}/METADATA +1 -1
- {paddle_python_sdk-1.19.0.dist-info → paddle_python_sdk-1.20.0.dist-info}/RECORD +25 -19
- tests/Functional/Resources/Products/test_ProductsClient.py +27 -1
- tests/Functional/Resources/Reports/test_ReportsClient.py +74 -0
- {paddle_python_sdk-1.19.0.dist-info → paddle_python_sdk-1.20.0.dist-info}/WHEEL +0 -0
- {paddle_python_sdk-1.19.0.dist-info → paddle_python_sdk-1.20.0.dist-info}/licenses/LICENSE +0 -0
- {paddle_python_sdk-1.19.0.dist-info → paddle_python_sdk-1.20.0.dist-info}/top_level.txt +0 -0
paddle_billing/Client.py
CHANGED
|
@@ -247,7 +247,7 @@ class Client:
|
|
|
247
247
|
"Authorization": f"Bearer {self.__api_key}",
|
|
248
248
|
"Content-Type": "application/json",
|
|
249
249
|
"Paddle-Version": str(self.use_api_version),
|
|
250
|
-
"User-Agent": "PaddleSDK/python 1.
|
|
250
|
+
"User-Agent": "PaddleSDK/python 1.20.0",
|
|
251
251
|
}
|
|
252
252
|
)
|
|
253
253
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from paddle_billing.PaddleStrEnum import (
|
|
2
|
+
PaddleStrEnum as PaddleStrEnum,
|
|
3
|
+
PaddleStrEnumMeta as PaddleStrEnumMeta,
|
|
4
|
+
member as member,
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
from paddle_billing.Entities.Reports.ReportType import ReportType as ReportType
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class PaymentAttemptsReportType(PaddleStrEnum, metaclass=PaddleStrEnumMeta):
|
|
11
|
+
PaymentAttempts: "PaymentAttemptsReportType" = member(ReportType.PaymentAttempts.value)
|
|
@@ -10,7 +10,7 @@ from paddle_billing.Entities.Reports.ReportFilterOperator import ReportFilterOpe
|
|
|
10
10
|
class ReportFilter:
|
|
11
11
|
name: ReportFilterName
|
|
12
12
|
operator: ReportFilterOperator | None
|
|
13
|
-
value: list[Any] | str
|
|
13
|
+
value: list[Any] | str | bool
|
|
14
14
|
|
|
15
15
|
@staticmethod
|
|
16
16
|
def from_dict(data: dict[str, Any]) -> ReportFilter:
|
|
@@ -13,7 +13,11 @@ class ReportFilterName(PaddleStrEnum, metaclass=PaddleStrEnumMeta):
|
|
|
13
13
|
CollectionMode: "ReportFilterName" = member("collection_mode")
|
|
14
14
|
CurrencyCode: "ReportFilterName" = member("currency_code")
|
|
15
15
|
CustomerCountryCode: "ReportFilterName" = member("customer_country_code")
|
|
16
|
+
IsCustomerPresent: "ReportFilterName" = member("is_customer_present")
|
|
17
|
+
IsNpaIncluded: "ReportFilterName" = member("is_npa_included")
|
|
18
|
+
IsSuccessful: "ReportFilterName" = member("is_successful")
|
|
16
19
|
Origin: "ReportFilterName" = member("origin")
|
|
20
|
+
PaymentAttemptCreatedAt: "ReportFilterName" = member("payment_attempt_created_at")
|
|
17
21
|
PriceStatus: "ReportFilterName" = member("price_status")
|
|
18
22
|
PriceType: "ReportFilterName" = member("price_type")
|
|
19
23
|
PriceUpdatedAt: "ReportFilterName" = member("price_updated_at")
|
|
@@ -16,3 +16,4 @@ class ReportType(PaddleStrEnum, metaclass=PaddleStrEnumMeta):
|
|
|
16
16
|
PayoutReconciliation: "ReportType" = member("payout_reconciliation")
|
|
17
17
|
Checkouts: "ReportType" = member("checkouts")
|
|
18
18
|
Subscriptions: "ReportType" = member("subscriptions")
|
|
19
|
+
PaymentAttempts: "ReportType" = member("payment_attempts")
|
|
@@ -3,6 +3,9 @@ from paddle_billing.Entities.Reports.BalanceMovementType import BalanceMovementT
|
|
|
3
3
|
from paddle_billing.Entities.Reports.BalanceReportType import BalanceReportType as BalanceReportType
|
|
4
4
|
from paddle_billing.Entities.Reports.CheckoutsReportType import CheckoutsReportType as CheckoutsReportType
|
|
5
5
|
from paddle_billing.Entities.Reports.DiscountsReportType import DiscountsReportType as DiscountsReportType
|
|
6
|
+
from paddle_billing.Entities.Reports.PaymentAttemptsReportType import (
|
|
7
|
+
PaymentAttemptsReportType as PaymentAttemptsReportType,
|
|
8
|
+
)
|
|
6
9
|
from paddle_billing.Entities.Reports.PayoutReconciliationReportType import (
|
|
7
10
|
PayoutReconciliationReportType as PayoutReconciliationReportType,
|
|
8
11
|
)
|
|
@@ -12,7 +12,7 @@ from paddle_billing.Notifications.Entities.Reports.ReportFilterOperator import (
|
|
|
12
12
|
class ReportFilter:
|
|
13
13
|
name: ReportFilterName
|
|
14
14
|
operator: ReportFilterOperator | None
|
|
15
|
-
value: list[Any] | str
|
|
15
|
+
value: list[Any] | str | bool
|
|
16
16
|
|
|
17
17
|
@staticmethod
|
|
18
18
|
def from_dict(data: dict[str, Any]) -> ReportFilter:
|
|
@@ -13,7 +13,11 @@ class ReportFilterName(PaddleStrEnum, metaclass=PaddleStrEnumMeta):
|
|
|
13
13
|
CollectionMode: "ReportFilterName" = member("collection_mode")
|
|
14
14
|
CurrencyCode: "ReportFilterName" = member("currency_code")
|
|
15
15
|
CustomerCountryCode: "ReportFilterName" = member("customer_country_code")
|
|
16
|
+
IsCustomerPresent: "ReportFilterName" = member("is_customer_present")
|
|
17
|
+
IsNpaIncluded: "ReportFilterName" = member("is_npa_included")
|
|
18
|
+
IsSuccessful: "ReportFilterName" = member("is_successful")
|
|
16
19
|
Origin: "ReportFilterName" = member("origin")
|
|
20
|
+
PaymentAttemptCreatedAt: "ReportFilterName" = member("payment_attempt_created_at")
|
|
17
21
|
PriceStatus: "ReportFilterName" = member("price_status")
|
|
18
22
|
PriceType: "ReportFilterName" = member("price_type")
|
|
19
23
|
PriceUpdatedAt: "ReportFilterName" = member("price_updated_at")
|
|
@@ -16,3 +16,4 @@ class ReportType(PaddleStrEnum, metaclass=PaddleStrEnumMeta):
|
|
|
16
16
|
PayoutReconciliation: "ReportType" = member("payout_reconciliation")
|
|
17
17
|
Checkouts: "ReportType" = member("checkouts")
|
|
18
18
|
Subscriptions: "ReportType" = member("subscriptions")
|
|
19
|
+
PaymentAttempts: "ReportType" = member("payment_attempts")
|
|
@@ -17,6 +17,10 @@ ProductIncludes = _ProductIncludes
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class ListProducts(HasParameters):
|
|
20
|
+
"""
|
|
21
|
+
Deprecated: `product_ids` is deprecated, use `ids` instead. It is merged into the `id` filter.
|
|
22
|
+
"""
|
|
23
|
+
|
|
20
24
|
def __init__(
|
|
21
25
|
self,
|
|
22
26
|
pager: Pager | None = None,
|
|
@@ -38,6 +42,7 @@ class ListProducts(HasParameters):
|
|
|
38
42
|
# Validation
|
|
39
43
|
validations: list[tuple[str, list[Any], type]] = [
|
|
40
44
|
("ids", self.ids, str),
|
|
45
|
+
("product_ids", self.product_ids, str),
|
|
41
46
|
("includes", self.includes, ProductIncludes),
|
|
42
47
|
("statuses", self.statuses, Status),
|
|
43
48
|
("tax_categories", self.tax_categories, TaxCategory),
|
|
@@ -54,8 +59,9 @@ class ListProducts(HasParameters):
|
|
|
54
59
|
parameters = {}
|
|
55
60
|
if self.pager:
|
|
56
61
|
parameters.update(self.pager.get_parameters())
|
|
57
|
-
|
|
58
|
-
|
|
62
|
+
ids = list(dict.fromkeys([*self.ids, *self.product_ids]))
|
|
63
|
+
if ids:
|
|
64
|
+
parameters["id"] = ",".join(ids)
|
|
59
65
|
if self.includes:
|
|
60
66
|
parameters["include"] = ",".join(map(enum_stringify, self.includes))
|
|
61
67
|
if self.statuses:
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from dataclasses import dataclass, field
|
|
2
|
+
from typing import Type
|
|
3
|
+
|
|
4
|
+
from paddle_billing.Entities.Reports import PaymentAttemptsReportType as PaymentAttemptsReportType
|
|
5
|
+
|
|
6
|
+
from paddle_billing.Resources.Reports.Operations.Filters import (
|
|
7
|
+
CustomerCountryCodeFilter as CustomerCountryCodeFilter,
|
|
8
|
+
IsCustomerPresentFilter as IsCustomerPresentFilter,
|
|
9
|
+
IsNpaIncludedFilter as IsNpaIncludedFilter,
|
|
10
|
+
IsSuccessfulFilter as IsSuccessfulFilter,
|
|
11
|
+
PaymentAttemptCreatedAtFilter as PaymentAttemptCreatedAtFilter,
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
from paddle_billing.Resources.Reports.Operations.CreateReport import CreateReport as CreateReport
|
|
15
|
+
from paddle_billing.Resources.Reports.Operations.Filters.Filter import Filter as Filter
|
|
16
|
+
|
|
17
|
+
PaymentAttemptsReportFilter = (
|
|
18
|
+
PaymentAttemptCreatedAtFilter
|
|
19
|
+
| CustomerCountryCodeFilter
|
|
20
|
+
| IsNpaIncludedFilter
|
|
21
|
+
| IsCustomerPresentFilter
|
|
22
|
+
| IsSuccessfulFilter
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@dataclass
|
|
27
|
+
class CreatePaymentAttemptsReport(CreateReport[PaymentAttemptsReportType, PaymentAttemptsReportFilter]):
|
|
28
|
+
type: PaymentAttemptsReportType
|
|
29
|
+
filters: list[PaymentAttemptsReportFilter] = field(default_factory=list)
|
|
30
|
+
|
|
31
|
+
@staticmethod
|
|
32
|
+
def get_allowed_filters() -> tuple[Type[Filter], ...]:
|
|
33
|
+
return (
|
|
34
|
+
PaymentAttemptCreatedAtFilter,
|
|
35
|
+
CustomerCountryCodeFilter,
|
|
36
|
+
IsNpaIncludedFilter,
|
|
37
|
+
IsCustomerPresentFilter,
|
|
38
|
+
IsSuccessfulFilter,
|
|
39
|
+
)
|
|
@@ -9,7 +9,7 @@ from paddle_billing.Entities.Reports import ReportFilterName as ReportFilterName
|
|
|
9
9
|
|
|
10
10
|
@dataclass
|
|
11
11
|
class Filter(ABC):
|
|
12
|
-
def to_json(self) -> dict[str, str | list[str] | ReportFilterName | ReportFilterOperator | None]:
|
|
12
|
+
def to_json(self) -> dict[str, str | list[str] | bool | ReportFilterName | ReportFilterOperator | None]:
|
|
13
13
|
return {
|
|
14
14
|
"name": self.get_name(),
|
|
15
15
|
"operator": self.get_operator(),
|
|
@@ -22,7 +22,7 @@ class Filter(ABC):
|
|
|
22
22
|
pass
|
|
23
23
|
|
|
24
24
|
@abstractmethod
|
|
25
|
-
def get_value(self) -> str | list[str]:
|
|
25
|
+
def get_value(self) -> str | list[str] | bool:
|
|
26
26
|
pass
|
|
27
27
|
|
|
28
28
|
def get_operator(self) -> ReportFilterOperator | None:
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
|
|
4
|
+
from paddle_billing.Resources.Reports.Operations.Filters.Filter import Filter as Filter
|
|
5
|
+
|
|
6
|
+
from paddle_billing.Entities.Reports import ReportFilterName as ReportFilterName
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class IsCustomerPresentFilter(Filter):
|
|
11
|
+
value: bool
|
|
12
|
+
|
|
13
|
+
@staticmethod
|
|
14
|
+
def get_name() -> ReportFilterName:
|
|
15
|
+
return ReportFilterName.IsCustomerPresent
|
|
16
|
+
|
|
17
|
+
def get_value(self) -> bool:
|
|
18
|
+
return self.value
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
|
|
4
|
+
from paddle_billing.Resources.Reports.Operations.Filters.Filter import Filter as Filter
|
|
5
|
+
|
|
6
|
+
from paddle_billing.Entities.Reports import ReportFilterName as ReportFilterName
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class IsNpaIncludedFilter(Filter):
|
|
11
|
+
value: bool
|
|
12
|
+
|
|
13
|
+
@staticmethod
|
|
14
|
+
def get_name() -> ReportFilterName:
|
|
15
|
+
return ReportFilterName.IsNpaIncluded
|
|
16
|
+
|
|
17
|
+
def get_value(self) -> bool:
|
|
18
|
+
return self.value
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
|
|
4
|
+
from paddle_billing.Resources.Reports.Operations.Filters.Filter import Filter as Filter
|
|
5
|
+
|
|
6
|
+
from paddle_billing.Entities.Reports import ReportFilterName as ReportFilterName
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class IsSuccessfulFilter(Filter):
|
|
11
|
+
value: bool
|
|
12
|
+
|
|
13
|
+
@staticmethod
|
|
14
|
+
def get_name() -> ReportFilterName:
|
|
15
|
+
return ReportFilterName.IsSuccessful
|
|
16
|
+
|
|
17
|
+
def get_value(self) -> bool:
|
|
18
|
+
return self.value
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
|
|
4
|
+
from paddle_billing.Entities.DateTime import DateTime as DateTime
|
|
5
|
+
|
|
6
|
+
from paddle_billing.Entities.Reports import ReportFilterOperator as ReportFilterOperator
|
|
7
|
+
|
|
8
|
+
from paddle_billing.Resources.Reports.Operations.Filters.Filter import Filter as Filter
|
|
9
|
+
|
|
10
|
+
from paddle_billing.Entities.Reports import ReportFilterName as ReportFilterName
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass
|
|
14
|
+
class PaymentAttemptCreatedAtFilter(Filter):
|
|
15
|
+
operator: ReportFilterOperator
|
|
16
|
+
value: DateTime
|
|
17
|
+
|
|
18
|
+
@staticmethod
|
|
19
|
+
def get_name() -> ReportFilterName:
|
|
20
|
+
return ReportFilterName.PaymentAttemptCreatedAt
|
|
21
|
+
|
|
22
|
+
def get_operator(self) -> ReportFilterOperator | None:
|
|
23
|
+
return self.operator
|
|
24
|
+
|
|
25
|
+
def get_value(self) -> str:
|
|
26
|
+
return self.value.format()
|
|
27
|
+
|
|
28
|
+
@staticmethod
|
|
29
|
+
def gte(value: DateTime) -> PaymentAttemptCreatedAtFilter:
|
|
30
|
+
return PaymentAttemptCreatedAtFilter(value=value, operator=ReportFilterOperator.Gte)
|
|
31
|
+
|
|
32
|
+
@staticmethod
|
|
33
|
+
def lt(value: DateTime) -> PaymentAttemptCreatedAtFilter:
|
|
34
|
+
return PaymentAttemptCreatedAtFilter(value=value, operator=ReportFilterOperator.Lt)
|
|
@@ -28,6 +28,18 @@ from paddle_billing.Resources.Reports.Operations.Filters.DiscountStatusFilter im
|
|
|
28
28
|
from paddle_billing.Resources.Reports.Operations.Filters.DiscountTypeFilter import (
|
|
29
29
|
DiscountTypeFilter as DiscountTypeFilter,
|
|
30
30
|
)
|
|
31
|
+
from paddle_billing.Resources.Reports.Operations.Filters.IsCustomerPresentFilter import (
|
|
32
|
+
IsCustomerPresentFilter as IsCustomerPresentFilter,
|
|
33
|
+
)
|
|
34
|
+
from paddle_billing.Resources.Reports.Operations.Filters.IsNpaIncludedFilter import (
|
|
35
|
+
IsNpaIncludedFilter as IsNpaIncludedFilter,
|
|
36
|
+
)
|
|
37
|
+
from paddle_billing.Resources.Reports.Operations.Filters.IsSuccessfulFilter import (
|
|
38
|
+
IsSuccessfulFilter as IsSuccessfulFilter,
|
|
39
|
+
)
|
|
40
|
+
from paddle_billing.Resources.Reports.Operations.Filters.PaymentAttemptCreatedAtFilter import (
|
|
41
|
+
PaymentAttemptCreatedAtFilter as PaymentAttemptCreatedAtFilter,
|
|
42
|
+
)
|
|
31
43
|
from paddle_billing.Resources.Reports.Operations.Filters.PriceStatusFilter import PriceStatusFilter as PriceStatusFilter
|
|
32
44
|
from paddle_billing.Resources.Reports.Operations.Filters.PriceTypeFilter import PriceTypeFilter as PriceTypeFilter
|
|
33
45
|
from paddle_billing.Resources.Reports.Operations.Filters.PriceUpdatedAtFilter import (
|
|
@@ -8,6 +8,9 @@ from paddle_billing.Resources.Reports.Operations.CreateCheckoutsReport import (
|
|
|
8
8
|
from paddle_billing.Resources.Reports.Operations.CreateDiscountsReport import (
|
|
9
9
|
CreateDiscountsReport as CreateDiscountsReport,
|
|
10
10
|
)
|
|
11
|
+
from paddle_billing.Resources.Reports.Operations.CreatePaymentAttemptsReport import (
|
|
12
|
+
CreatePaymentAttemptsReport as CreatePaymentAttemptsReport,
|
|
13
|
+
)
|
|
11
14
|
from paddle_billing.Resources.Reports.Operations.CreatePayoutReconciliationReport import (
|
|
12
15
|
CreatePayoutReconciliationReport as CreatePayoutReconciliationReport,
|
|
13
16
|
)
|
|
@@ -5,7 +5,7 @@ examples/event_polling.py,sha256=580dg_8CFrSCA89Mr1ny4V1gtB3-hk-LfePTbI7DT5w,217
|
|
|
5
5
|
examples/get_products.py,sha256=9jLvKZlWLCpyYEt3voWjy50961-Uhdr0JlWD34ILxeQ,2176
|
|
6
6
|
examples/logger.py,sha256=nt7COp_4ChaIP-dhJ4rGHmj981-N4O41FDFzI8VlAFc,1041
|
|
7
7
|
examples/webhook_verification.py,sha256=qkNscNdNZUAgxEIk83tCiljN2VmfePZ_k8zTliKz2QY,1205
|
|
8
|
-
paddle_billing/Client.py,sha256=
|
|
8
|
+
paddle_billing/Client.py,sha256=KDRS6wYSASzPvZdhUP_YWnJu3vU0gUMUBc1aRZh_Rw8,12581
|
|
9
9
|
paddle_billing/EnumStringify.py,sha256=iDvKULZat3jx9A-_PhvoN6CbFGf2pyxrQeYZxqX9n8M,48
|
|
10
10
|
paddle_billing/Environment.py,sha256=3e53sNcXjV4Rfr3pC9mqNvkBPBEW_Xbu4hUVYWF7J1s,506
|
|
11
11
|
paddle_billing/FiltersNone.py,sha256=ErOjaTfxtELXrXdxUvFF9DJI_Yl31iseO4K56qTDR54,303
|
|
@@ -189,18 +189,19 @@ paddle_billing/Entities/Reports/BalanceMovementType.py,sha256=6RsszHAJWGOOuEtzmq
|
|
|
189
189
|
paddle_billing/Entities/Reports/BalanceReportType.py,sha256=HNps38D-F5dpDiXeLLTBmpC81nywnRSTlXH6J0ax_TE,367
|
|
190
190
|
paddle_billing/Entities/Reports/CheckoutsReportType.py,sha256=fHxMMKMuqSiHZeGc4Fp5z1a_fvaA-_c7Ays2_EW3Z6k,375
|
|
191
191
|
paddle_billing/Entities/Reports/DiscountsReportType.py,sha256=CEyiYVsms2z7VVGu7HYgZw7rXSoZ0hHal-_e-DlKChc,375
|
|
192
|
+
paddle_billing/Entities/Reports/PaymentAttemptsReportType.py,sha256=G9DoFrcvCnufSyckl2WzMDy5dpzPiHfwm7B0CqUTvvM,399
|
|
192
193
|
paddle_billing/Entities/Reports/PayoutReconciliationReportType.py,sha256=XeTDPOvPB-xdBKubW2vOJyUzSmcCx-Idap07PPz5i0U,419
|
|
193
194
|
paddle_billing/Entities/Reports/ProductsPricesReportType.py,sha256=LW5braKIi-bjLZjj4WhsL_Sw5vaNIUCjtV6hW0QZXLw,395
|
|
194
|
-
paddle_billing/Entities/Reports/ReportFilter.py,sha256=
|
|
195
|
-
paddle_billing/Entities/Reports/ReportFilterName.py,sha256=
|
|
195
|
+
paddle_billing/Entities/Reports/ReportFilter.py,sha256=5BSZ34-gwbvFNV2c0qWA9uy5geu0QznNL1WppwN4aE0,549
|
|
196
|
+
paddle_billing/Entities/Reports/ReportFilterName.py,sha256=0koIQHmXGl5unyeYtXTlGXp5FCCLixLbEVxOGh_SxWc,2003
|
|
196
197
|
paddle_billing/Entities/Reports/ReportFilterOperator.py,sha256=WRarcMh4-nhR0W95R_2zxmBmWud9XSnZ6Z7Ym8OuHEo,315
|
|
197
198
|
paddle_billing/Entities/Reports/ReportStatus.py,sha256=x4p-j5Rx9xk1-rdu0edH4Ytw3xS1FrSZwiHfnczhtv8,399
|
|
198
|
-
paddle_billing/Entities/Reports/ReportType.py,sha256=
|
|
199
|
+
paddle_billing/Entities/Reports/ReportType.py,sha256=J6uLnL7MLEYeVZRp9gi_-ZV06-XgEFKC3JlsaUJy850,868
|
|
199
200
|
paddle_billing/Entities/Reports/SubscriptionScheduledChangeActionFilterValue.py,sha256=f2XitfV_VIIP01q4Rw94TdXm7JRH1DcdRafXfrzqWAU,555
|
|
200
201
|
paddle_billing/Entities/Reports/SubscriptionStatusFilterValue.py,sha256=3jelVk0yesGj3dR9Orv-kbcP-LnmkjrYCYf0P1dfDgk,556
|
|
201
202
|
paddle_billing/Entities/Reports/SubscriptionsReportType.py,sha256=tQrKgs0w_1JqXFp2TT5HQUG-49r9o174PUXa2fCxKOo,391
|
|
202
203
|
paddle_billing/Entities/Reports/TransactionsReportType.py,sha256=dqTE0TyuOJz9Vcg4F8MwhauXp1m9upX6L5R2_3u1kxY,486
|
|
203
|
-
paddle_billing/Entities/Reports/__init__.py,sha256=
|
|
204
|
+
paddle_billing/Entities/Reports/__init__.py,sha256=HmpGMgFfAGmnr432Fq7mmH66mnKPD2QT8yPBRFK8NpM,1981
|
|
204
205
|
paddle_billing/Entities/Settings/AudienceOptIn.py,sha256=Cooas8g9Z9IWhTE87By0KhDiQSUb2kZmW5KZqas232k,306
|
|
205
206
|
paddle_billing/Entities/Settings/BalanceCurrency.py,sha256=k9pLkuqvF2GHyN7blyXfr1OIXqkwLGEuskxYeGQTIT0,738
|
|
206
207
|
paddle_billing/Entities/Settings/BalanceCurrencyCode.py,sha256=3cji52_9TTOmL8D1eoKwgSlE86W2kJV5qCRyHH3ApNE,455
|
|
@@ -494,11 +495,11 @@ paddle_billing/Notifications/Entities/Discounts/DiscountType.py,sha256=fJ3CVneP9
|
|
|
494
495
|
paddle_billing/Notifications/Entities/Discounts/__init__.py,sha256=RlV5XDTx0yZ77tGjiGZP_O01Xp6OrHvXAYF5uT2SMso,312
|
|
495
496
|
paddle_billing/Notifications/Entities/Payouts/PayoutStatus.py,sha256=bQZUxFtBzPgTi5NU2keYLCAQD-wiBh5j22P5madjM4M,301
|
|
496
497
|
paddle_billing/Notifications/Entities/Payouts/__init__.py,sha256=5tukKgoUqakns6zVJKnK3dgUZqYXV7fHr0E7vO89f_Q,100
|
|
497
|
-
paddle_billing/Notifications/Entities/Reports/ReportFilter.py,sha256=
|
|
498
|
-
paddle_billing/Notifications/Entities/Reports/ReportFilterName.py,sha256=
|
|
498
|
+
paddle_billing/Notifications/Entities/Reports/ReportFilter.py,sha256=y1qUo0VCvYHjceuJ6Upmr97_dE_e04A2dLDf4_7cBUo,586
|
|
499
|
+
paddle_billing/Notifications/Entities/Reports/ReportFilterName.py,sha256=0koIQHmXGl5unyeYtXTlGXp5FCCLixLbEVxOGh_SxWc,2003
|
|
499
500
|
paddle_billing/Notifications/Entities/Reports/ReportFilterOperator.py,sha256=WRarcMh4-nhR0W95R_2zxmBmWud9XSnZ6Z7Ym8OuHEo,315
|
|
500
501
|
paddle_billing/Notifications/Entities/Reports/ReportStatus.py,sha256=x4p-j5Rx9xk1-rdu0edH4Ytw3xS1FrSZwiHfnczhtv8,399
|
|
501
|
-
paddle_billing/Notifications/Entities/Reports/ReportType.py,sha256=
|
|
502
|
+
paddle_billing/Notifications/Entities/Reports/ReportType.py,sha256=J6uLnL7MLEYeVZRp9gi_-ZV06-XgEFKC3JlsaUJy850,868
|
|
502
503
|
paddle_billing/Notifications/Entities/Reports/__init__.py,sha256=CHaer-X1BmgXdjiE7k9bBz3zLXgP8QF5Qc1e5lPZbI8,539
|
|
503
504
|
paddle_billing/Notifications/Entities/Shared/Action.py,sha256=qJCBrxwUkM82X_i-Ui5VkPcI_WA7gLFcFAiYC_6zE0w,594
|
|
504
505
|
paddle_billing/Notifications/Entities/Shared/AddressPreview.py,sha256=MSPfgYwjeU99IAEcPNMFfi_9VY2Pn05hkA5erqUpco8,510
|
|
@@ -784,7 +785,7 @@ paddle_billing/Resources/PricingPreviews/Operations/__init__.py,sha256=Y7qNPI3MA
|
|
|
784
785
|
paddle_billing/Resources/Products/ProductsClient.py,sha256=40xe4DzkBXUdtZvmY3XqwZlETr5taa9G4K_4jZLeO8o,2856
|
|
785
786
|
paddle_billing/Resources/Products/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
786
787
|
paddle_billing/Resources/Products/Operations/CreateProduct.py,sha256=8Wb3XLQGtlfq6OLSD7hYXJ-PCSFh7RTZKvDYpLkoDWE,607
|
|
787
|
-
paddle_billing/Resources/Products/Operations/ListProducts.py,sha256=
|
|
788
|
+
paddle_billing/Resources/Products/Operations/ListProducts.py,sha256=k55aHpaXAOUPPgKP4Fk336eKnZXX4vZdKYa1yrMqgts,3177
|
|
788
789
|
paddle_billing/Resources/Products/Operations/UpdateProduct.py,sha256=oCQiTXVNyzewp_kglGj4Egb6ywdHT9-ggpFS8-OGAq0,726
|
|
789
790
|
paddle_billing/Resources/Products/Operations/__init__.py,sha256=pdO4Lige6stnCZeabiNPyGp5alHg1OBGzvPy4S8CnL0,620
|
|
790
791
|
paddle_billing/Resources/Products/Operations/List/Includes.py,sha256=2csOBO16QA3WrqLoziVmieN8MW1reIekL42N5OaQLEw,251
|
|
@@ -795,13 +796,14 @@ paddle_billing/Resources/Reports/Operations/CreateAdjustmentsReport.py,sha256=Qp
|
|
|
795
796
|
paddle_billing/Resources/Reports/Operations/CreateBalanceReport.py,sha256=q5qLjtZ8T52NkLiuan12KJ7Gch4tOoXa90AaOHDlc_E,810
|
|
796
797
|
paddle_billing/Resources/Reports/Operations/CreateCheckoutsReport.py,sha256=dOnB7rmpabYYQekuAwzL29S_g36P9Mv4eDFKLLUafCI,967
|
|
797
798
|
paddle_billing/Resources/Reports/Operations/CreateDiscountsReport.py,sha256=d9pNM63kBDMD6e46mHccgQo9yIqFi7cyJTsfK9YNMG0,1028
|
|
799
|
+
paddle_billing/Resources/Reports/Operations/CreatePaymentAttemptsReport.py,sha256=vWOKjNx0cANV_KVa3CD-IaG2PyHyLUNo96Q_y7smvyg,1401
|
|
798
800
|
paddle_billing/Resources/Reports/Operations/CreatePayoutReconciliationReport.py,sha256=RilW8_sQAWCZOJsfn8yVcfqltVnyjrh8IRejYgo0Lw4,1390
|
|
799
801
|
paddle_billing/Resources/Reports/Operations/CreateProductsAndPricesReport.py,sha256=eIzxkGYRlu99FCH2DddLRx3gtCoQu31fa-knu8x5e58,1548
|
|
800
802
|
paddle_billing/Resources/Reports/Operations/CreateReport.py,sha256=k-CcVOIpHwNQ0xLA8hk0PDtes4nycJREc2B1PfswkqA,1879
|
|
801
803
|
paddle_billing/Resources/Reports/Operations/CreateSubscriptionsReport.py,sha256=fgMSpk3Y3K480Iz8-fyJSLH5b1rpK1Rea_TXq7uLNgM,1473
|
|
802
804
|
paddle_billing/Resources/Reports/Operations/CreateTransactionsReport.py,sha256=2yxoW-nF801WBv-Gw88hOw4dvLUt5ub3Y0JzNbFmVT8,1370
|
|
803
805
|
paddle_billing/Resources/Reports/Operations/ListReports.py,sha256=h1EskY_nN8wS--EIIcovx8KpwG4jA6yd6yfFd2pOnL4,1379
|
|
804
|
-
paddle_billing/Resources/Reports/Operations/__init__.py,sha256=
|
|
806
|
+
paddle_billing/Resources/Reports/Operations/__init__.py,sha256=sVGQ3inp_3Jn15wiGqqvk8m2pDrux2pGGwDK9l1OwjI,1486
|
|
805
807
|
paddle_billing/Resources/Reports/Operations/Filters/AdjustmentActionFilter.py,sha256=gs7KSiNPlR7d_Nklkh15bJpwF1KBxAQEKohe5xDRn24,652
|
|
806
808
|
paddle_billing/Resources/Reports/Operations/Filters/AdjustmentStatusFilter.py,sha256=rmK4F1qErBgp7G8axnkpoZaUKJ578lhlNJ6SJU2Jq90,694
|
|
807
809
|
paddle_billing/Resources/Reports/Operations/Filters/BalanceMovementDateFilter.py,sha256=iKVUbwQ-u8YUW6ha5XbLqnj-gRqk7vvqHth-D2dRn78,1106
|
|
@@ -812,7 +814,11 @@ paddle_billing/Resources/Reports/Operations/Filters/CurrencyCodeFilter.py,sha256
|
|
|
812
814
|
paddle_billing/Resources/Reports/Operations/Filters/CustomerCountryCodeFilter.py,sha256=V3HxedCpmLS7a_cNdrV625bX5-NNFajEtX_gUKwQri0,700
|
|
813
815
|
paddle_billing/Resources/Reports/Operations/Filters/DiscountStatusFilter.py,sha256=a0zKFXYbwA_uD_7hSAoBEwnJFzRRBwcSTDNcqh9XTVA,687
|
|
814
816
|
paddle_billing/Resources/Reports/Operations/Filters/DiscountTypeFilter.py,sha256=xTxzfsCou2mXeIND5L9bU6hM5pByBCZq8aA5Oc9jClY,669
|
|
815
|
-
paddle_billing/Resources/Reports/Operations/Filters/Filter.py,sha256=
|
|
817
|
+
paddle_billing/Resources/Reports/Operations/Filters/Filter.py,sha256=o9Ggw0ka6IELZoYfYpYAvCMhzCcdB46IbQTTUyTckQg,823
|
|
818
|
+
paddle_billing/Resources/Reports/Operations/Filters/IsCustomerPresentFilter.py,sha256=HRCwAEsRYkKLGuaSeshKEDNunQb9qTQgvCDtKf3tqLQ,477
|
|
819
|
+
paddle_billing/Resources/Reports/Operations/Filters/IsNpaIncludedFilter.py,sha256=EYKO7dl6eg0dKYJ2kMnF4y-B2p97y0nIeH461bCg-DQ,469
|
|
820
|
+
paddle_billing/Resources/Reports/Operations/Filters/IsSuccessfulFilter.py,sha256=okUkY32osIOUNKPrJlzvIodbjsuu4053d_jTYkWMxPA,467
|
|
821
|
+
paddle_billing/Resources/Reports/Operations/Filters/PaymentAttemptCreatedAtFilter.py,sha256=xmQunOgt7sPF4GVohl849DvtUqDeRA-6WDjmmJmwZMw,1130
|
|
816
822
|
paddle_billing/Resources/Reports/Operations/Filters/PriceStatusFilter.py,sha256=hauN07WcogNrp8QdIZghMhe0gY5Z-LdB9PP1QGRM794,654
|
|
817
823
|
paddle_billing/Resources/Reports/Operations/Filters/PriceTypeFilter.py,sha256=N4vRI_9nupItML8CUnkhUHoGwzxr0RkeiIrxmneT8C4,664
|
|
818
824
|
paddle_billing/Resources/Reports/Operations/Filters/PriceUpdatedAtFilter.py,sha256=RqfYLyOZB3-rl9-2ha5ae4ySHgkVRN4CDoRcx59I1FA,1076
|
|
@@ -827,7 +833,7 @@ paddle_billing/Resources/Reports/Operations/Filters/TransactionOriginFilter.py,s
|
|
|
827
833
|
paddle_billing/Resources/Reports/Operations/Filters/TransactionStatusFilter.py,sha256=USt0rvJD5aoLJaO44uSXExGUQfkPbb9ZgnVeE0DGZV8,699
|
|
828
834
|
paddle_billing/Resources/Reports/Operations/Filters/TransactionUpdatedAtFilter.py,sha256=rRKDHx6Jt4VuAZnyxD4rDGzs6QAIZFWQTwdBcoG6AVQ,1112
|
|
829
835
|
paddle_billing/Resources/Reports/Operations/Filters/UpdatedAtFilter.py,sha256=kcUYdtnq5sEa7o2I83YevCvLCo-X0jE3GP44koVPl00,1046
|
|
830
|
-
paddle_billing/Resources/Reports/Operations/Filters/__init__.py,sha256=
|
|
836
|
+
paddle_billing/Resources/Reports/Operations/Filters/__init__.py,sha256=YgEXosW3f5RQo5Z-urw4W4ahGeowN5q4EqL2C0CPirY,4033
|
|
831
837
|
paddle_billing/Resources/Settings/SettingsClient.py,sha256=ack0Mg8ixD_34Ry222qKjyhxWzACggPgIApmN-rsNgQ,6401
|
|
832
838
|
paddle_billing/Resources/Settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
833
839
|
paddle_billing/Resources/Settings/Operations/UpdateBalanceCurrency.py,sha256=TAC4nsX2_jmxG6cXbbxfN0Nr26GxeQ9iHGuSrBt7nlU,357
|
|
@@ -955,7 +961,7 @@ paddle_billing/Resources/Verifications/VerificationsClient.py,sha256=IIcxBVwa_WX
|
|
|
955
961
|
paddle_billing/Resources/Verifications/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
956
962
|
paddle_billing/Resources/Verifications/Operations/ListVerifications.py,sha256=x7L98i9lMNb1xRnC0mCNIsHHY5g5J3fswlIYKE7-XQY,1485
|
|
957
963
|
paddle_billing/Resources/Verifications/Operations/__init__.py,sha256=07Ir5TPNA8sOz0WTVH48fBClRW6XaIZW0-cPmGIpt28,119
|
|
958
|
-
paddle_python_sdk-1.
|
|
964
|
+
paddle_python_sdk-1.20.0.dist-info/licenses/LICENSE,sha256=e5Sn9mzCdpjnqCLxXpGHNKdYB6JlRSTLhN_CD4WSO6w,10770
|
|
959
965
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
960
966
|
tests/conftest.py,sha256=K_rWFm4jOBGVpoQP9llOwQwyYrXThbF3CBvood_hNRU,127
|
|
961
967
|
tests/Functional/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -1012,9 +1018,9 @@ tests/Functional/Resources/Prices/test_PricesClient.py,sha256=sx-oCO0w2OOYXQB2KO
|
|
|
1012
1018
|
tests/Functional/Resources/PricingPreviews/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1013
1019
|
tests/Functional/Resources/PricingPreviews/test_PricingPreviewsClient.py,sha256=MGmfdNlNJTqeVeZmq2jHcHLt2508srJDiULtsWC2phQ,4085
|
|
1014
1020
|
tests/Functional/Resources/Products/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1015
|
-
tests/Functional/Resources/Products/test_ProductsClient.py,sha256=
|
|
1021
|
+
tests/Functional/Resources/Products/test_ProductsClient.py,sha256=y1TNP-Wwbo_tp7SIjQ-pVLef9ES73xF3tHy-B0kMLYg,12596
|
|
1016
1022
|
tests/Functional/Resources/Reports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1017
|
-
tests/Functional/Resources/Reports/test_ReportsClient.py,sha256=
|
|
1023
|
+
tests/Functional/Resources/Reports/test_ReportsClient.py,sha256=BBvvJU_R1GqgH3IaUeojZhmlssPrGUYPqu8o6-nDlmE,22381
|
|
1018
1024
|
tests/Functional/Resources/Settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
1019
1025
|
tests/Functional/Resources/Settings/test_SettingsClient.py,sha256=K4Vg1MGteL7Vm6m2bQvJvJ3OyF98XqcPwRMydWD5sCw,19708
|
|
1020
1026
|
tests/Functional/Resources/SimulationRunEvents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -1048,7 +1054,7 @@ tests/Utils/ReadsFixture.py,sha256=3CQ_8XHji3kuR28Ktlmw1Kip565UycocUytldWtuAyw,1
|
|
|
1048
1054
|
tests/Utils/TestClient.py,sha256=-wc7hJMuR6WC-ukw0c7I59b5-8hj_-nzq__-2M81elg,1453
|
|
1049
1055
|
tests/Utils/TestLogger.py,sha256=pFO9x711buRmg-8DAqpzIJP_hr21JPty1_ZQRcwoGKk,554
|
|
1050
1056
|
tests/Utils/__init__.py,sha256=JtqJNPKqbNZ9exlpXlF3yj_9cfylPGlvopjQYi7yYTA,37
|
|
1051
|
-
paddle_python_sdk-1.
|
|
1052
|
-
paddle_python_sdk-1.
|
|
1053
|
-
paddle_python_sdk-1.
|
|
1054
|
-
paddle_python_sdk-1.
|
|
1057
|
+
paddle_python_sdk-1.20.0.dist-info/METADATA,sha256=CEFwslTzLHtsGBskyrK4Six3bqSwrT9Ph5YdCYhurb0,9232
|
|
1058
|
+
paddle_python_sdk-1.20.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
|
|
1059
|
+
paddle_python_sdk-1.20.0.dist-info/top_level.txt,sha256=9a07VPng7o5wK8VAXkl6NC30xrNbW9zff_02jHyHi4c,30
|
|
1060
|
+
paddle_python_sdk-1.20.0.dist-info/RECORD,,
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
from json import loads
|
|
2
|
-
from pytest import mark
|
|
2
|
+
from pytest import mark, raises
|
|
3
3
|
from urllib.parse import unquote
|
|
4
4
|
|
|
5
5
|
from paddle_billing.Entities.Collections import ProductCollection
|
|
6
6
|
from paddle_billing.Entities.Product import Product
|
|
7
7
|
from paddle_billing.Entities.Shared import CustomData, Status, TaxCategory
|
|
8
8
|
|
|
9
|
+
from paddle_billing.Exceptions.SdkExceptions.InvalidArgumentException import InvalidArgumentException
|
|
9
10
|
from paddle_billing.Resources.Products.Operations import CreateProduct, ListProducts, UpdateProduct, ProductIncludes
|
|
10
11
|
from paddle_billing.Resources.Shared.Operations import Pager
|
|
11
12
|
|
|
@@ -179,6 +180,24 @@ class TestProductsClient:
|
|
|
179
180
|
200,
|
|
180
181
|
"/products?id=pro_01gsz4s0w61y0pp88528f1wvvb,pro_01h1vjes1y163xfj1rh1tkfb65",
|
|
181
182
|
),
|
|
183
|
+
(
|
|
184
|
+
ListProducts(product_ids=["pro_01gsz4s0w61y0pp88528f1wvvb"]),
|
|
185
|
+
200,
|
|
186
|
+
"/products?id=pro_01gsz4s0w61y0pp88528f1wvvb",
|
|
187
|
+
),
|
|
188
|
+
(
|
|
189
|
+
ListProducts(ids=["pro_01gsz4s0w61y0pp88528f1wvvb"], product_ids=["pro_01h1vjes1y163xfj1rh1tkfb65"]),
|
|
190
|
+
200,
|
|
191
|
+
"/products?id=pro_01gsz4s0w61y0pp88528f1wvvb,pro_01h1vjes1y163xfj1rh1tkfb65",
|
|
192
|
+
),
|
|
193
|
+
(
|
|
194
|
+
ListProducts(
|
|
195
|
+
ids=["pro_01gsz4s0w61y0pp88528f1wvvb", "pro_01h1vjes1y163xfj1rh1tkfb65"],
|
|
196
|
+
product_ids=["pro_01h1vjes1y163xfj1rh1tkfb65", "pro_01gsz4s0w61y0pp88528f1wvvb", "pro_02new"],
|
|
197
|
+
),
|
|
198
|
+
200,
|
|
199
|
+
"/products?id=pro_01gsz4s0w61y0pp88528f1wvvb,pro_01h1vjes1y163xfj1rh1tkfb65,pro_02new",
|
|
200
|
+
),
|
|
182
201
|
(
|
|
183
202
|
ListProducts(tax_categories=[TaxCategory.DigitalGoods, TaxCategory.Standard]),
|
|
184
203
|
200,
|
|
@@ -193,6 +212,9 @@ class TestProductsClient:
|
|
|
193
212
|
"List products filtered by status",
|
|
194
213
|
"List products filtered by id",
|
|
195
214
|
"List products filtered by multiple ids",
|
|
215
|
+
"List products filtered by product_ids",
|
|
216
|
+
"List products filtered by ids and product_ids",
|
|
217
|
+
"List products merges duplicate ids and product_ids preserving order",
|
|
196
218
|
"List products filtered by tax categories",
|
|
197
219
|
"List products with includes",
|
|
198
220
|
],
|
|
@@ -219,6 +241,10 @@ class TestProductsClient:
|
|
|
219
241
|
unquote(last_request.url) == expected_url
|
|
220
242
|
), "The URL does not match the expected URL, verify the query string is correct"
|
|
221
243
|
|
|
244
|
+
def test_list_products_rejects_non_string_product_ids(self):
|
|
245
|
+
with raises(InvalidArgumentException):
|
|
246
|
+
ListProducts(product_ids=[123]) # type: ignore[list-item]
|
|
247
|
+
|
|
222
248
|
@mark.parametrize(
|
|
223
249
|
"product_id, includes, expected_response_status, expected_response_body, expected_url",
|
|
224
250
|
[
|
|
@@ -11,6 +11,7 @@ from paddle_billing.Entities.Reports import (
|
|
|
11
11
|
BalanceReportType,
|
|
12
12
|
CheckoutsReportType,
|
|
13
13
|
DiscountsReportType,
|
|
14
|
+
PaymentAttemptsReportType,
|
|
14
15
|
PayoutReconciliationReportType,
|
|
15
16
|
ProductsPricesReportType,
|
|
16
17
|
SubscriptionScheduledChangeActionFilterValue,
|
|
@@ -20,6 +21,7 @@ from paddle_billing.Entities.Reports import (
|
|
|
20
21
|
ReportFilterName,
|
|
21
22
|
ReportFilterOperator,
|
|
22
23
|
ReportStatus,
|
|
24
|
+
ReportType,
|
|
23
25
|
TransactionsReportType,
|
|
24
26
|
)
|
|
25
27
|
|
|
@@ -36,6 +38,10 @@ from paddle_billing.Resources.Reports.Operations.Filters import (
|
|
|
36
38
|
CustomerCountryCodeFilter,
|
|
37
39
|
DiscountStatusFilter,
|
|
38
40
|
DiscountTypeFilter,
|
|
41
|
+
IsCustomerPresentFilter,
|
|
42
|
+
IsNpaIncludedFilter,
|
|
43
|
+
IsSuccessfulFilter,
|
|
44
|
+
PaymentAttemptCreatedAtFilter,
|
|
39
45
|
PriceStatusFilter,
|
|
40
46
|
PriceTypeFilter,
|
|
41
47
|
PriceUpdatedAtFilter,
|
|
@@ -76,6 +82,7 @@ from paddle_billing.Resources.Reports.Operations import (
|
|
|
76
82
|
CreateBalanceReport,
|
|
77
83
|
CreateCheckoutsReport,
|
|
78
84
|
CreateDiscountsReport,
|
|
85
|
+
CreatePaymentAttemptsReport,
|
|
79
86
|
CreatePayoutReconciliationReport,
|
|
80
87
|
CreateProductsAndPricesReport,
|
|
81
88
|
CreateSubscriptionsReport,
|
|
@@ -206,6 +213,26 @@ class TestReportsClient:
|
|
|
206
213
|
ReadsFixtures.read_raw_json_fixture("request/create_checkouts_full"),
|
|
207
214
|
CheckoutsReportType,
|
|
208
215
|
),
|
|
216
|
+
(
|
|
217
|
+
CreatePaymentAttemptsReport(type=PaymentAttemptsReportType.PaymentAttempts),
|
|
218
|
+
ReadsFixtures.read_raw_json_fixture("request/create_payment_attempts_basic"),
|
|
219
|
+
PaymentAttemptsReportType,
|
|
220
|
+
),
|
|
221
|
+
(
|
|
222
|
+
CreatePaymentAttemptsReport(
|
|
223
|
+
type=PaymentAttemptsReportType.PaymentAttempts,
|
|
224
|
+
filters=[
|
|
225
|
+
PaymentAttemptCreatedAtFilter.gte(DateTime("2023-12-30")),
|
|
226
|
+
PaymentAttemptCreatedAtFilter.lt(DateTime("2024-12-30T12:30:01.123456Z")),
|
|
227
|
+
CustomerCountryCodeFilter([CountryCode.US, CountryCode.GB]),
|
|
228
|
+
IsNpaIncludedFilter(True),
|
|
229
|
+
IsCustomerPresentFilter(False),
|
|
230
|
+
IsSuccessfulFilter(True),
|
|
231
|
+
],
|
|
232
|
+
),
|
|
233
|
+
ReadsFixtures.read_raw_json_fixture("request/create_payment_attempts_full"),
|
|
234
|
+
PaymentAttemptsReportType,
|
|
235
|
+
),
|
|
209
236
|
(
|
|
210
237
|
CreateSubscriptionsReport(type=SubscriptionsReportType.Subscriptions),
|
|
211
238
|
ReadsFixtures.read_raw_json_fixture("request/create_subscriptions_basic"),
|
|
@@ -263,6 +290,8 @@ class TestReportsClient:
|
|
|
263
290
|
"Create payout reconciliation report with filters",
|
|
264
291
|
"Create checkouts report with basic data",
|
|
265
292
|
"Create checkouts report with filters",
|
|
293
|
+
"Create payment attempts report with basic data",
|
|
294
|
+
"Create payment attempts report with filters",
|
|
266
295
|
"Create subscriptions report with basic data",
|
|
267
296
|
"Create subscriptions report with filters",
|
|
268
297
|
"Create payout reconciliation report with balance movement filters",
|
|
@@ -306,6 +335,18 @@ class TestReportsClient:
|
|
|
306
335
|
str(expected_response_body)
|
|
307
336
|
), "The response JSON doesn't match the expected fixture JSON"
|
|
308
337
|
|
|
338
|
+
def test_create_payment_attempts_report_validates_allowed_filters(self):
|
|
339
|
+
with raises(InvalidArgumentException) as exception_info:
|
|
340
|
+
CreatePaymentAttemptsReport(
|
|
341
|
+
type=PaymentAttemptsReportType.PaymentAttempts,
|
|
342
|
+
filters=[CheckoutCreatedAtFilter.gte(DateTime("2023-12-30"))],
|
|
343
|
+
)
|
|
344
|
+
|
|
345
|
+
assert (
|
|
346
|
+
str(exception_info.value)
|
|
347
|
+
== "Expected 'filters' to only contain types 'PaymentAttemptCreatedAtFilter', 'CustomerCountryCodeFilter', 'IsNpaIncludedFilter', 'IsCustomerPresentFilter', 'IsSuccessfulFilter' ('CheckoutCreatedAtFilter' given)"
|
|
348
|
+
)
|
|
349
|
+
|
|
309
350
|
def test_create_report_validates_allowed_filters(self):
|
|
310
351
|
with raises(InvalidArgumentException) as exception_info:
|
|
311
352
|
CreateTransactionsReport(
|
|
@@ -466,3 +507,36 @@ class TestReportsClient:
|
|
|
466
507
|
assert response_json == loads(
|
|
467
508
|
str(expected_response_body)
|
|
468
509
|
), "The response JSON generated by ResponseParser() doesn't match the expected fixture JSON"
|
|
510
|
+
|
|
511
|
+
def test_list_reports_parses_payment_attempts_report(self, test_client, mock_requests):
|
|
512
|
+
expected_url = f"{test_client.base_url}/reports"
|
|
513
|
+
mock_requests.get(
|
|
514
|
+
expected_url, status_code=200, text=ReadsFixtures.read_raw_json_fixture("response/list_payment_attempts")
|
|
515
|
+
)
|
|
516
|
+
|
|
517
|
+
response = test_client.client.reports.list()
|
|
518
|
+
|
|
519
|
+
report = next(iter(response))
|
|
520
|
+
|
|
521
|
+
assert report.type == ReportType.PaymentAttempts
|
|
522
|
+
assert [filter.name for filter in report.filters] == [
|
|
523
|
+
ReportFilterName.PaymentAttemptCreatedAt,
|
|
524
|
+
ReportFilterName.CustomerCountryCode,
|
|
525
|
+
ReportFilterName.IsSuccessful,
|
|
526
|
+
]
|
|
527
|
+
assert report.filters[2].value is True
|
|
528
|
+
|
|
529
|
+
def test_get_payment_attempts_report_parses_boolean_filter_value(self, test_client, mock_requests):
|
|
530
|
+
expected_url = f"{test_client.base_url}/reports/rep_01hhq4c3b03g3x2kpkj8aecjv6"
|
|
531
|
+
mock_requests.get(
|
|
532
|
+
expected_url,
|
|
533
|
+
status_code=200,
|
|
534
|
+
text=ReadsFixtures.read_raw_json_fixture("response/payment_attempts_entity"),
|
|
535
|
+
)
|
|
536
|
+
|
|
537
|
+
response = test_client.client.reports.get("rep_01hhq4c3b03g3x2kpkj8aecjv6")
|
|
538
|
+
|
|
539
|
+
assert response.type == ReportType.PaymentAttempts
|
|
540
|
+
assert response.filters[2].name == ReportFilterName.IsSuccessful
|
|
541
|
+
assert response.filters[2].operator is None
|
|
542
|
+
assert response.filters[2].value is True
|
|
File without changes
|
|
File without changes
|
|
File without changes
|