python-terminusgps 51.1.0__tar.gz → 52.0.0__tar.gz
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.
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/.gitignore +1 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/PKG-INFO +2 -2
- python_terminusgps-52.0.0/htmlcov/.gitignore +2 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/pyproject.toml +3 -2
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/terminusgps/authorizenet/api/address_profiles.py +13 -33
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/terminusgps/authorizenet/api/customer_profiles.py +47 -59
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/terminusgps/authorizenet/api/payment_profiles.py +21 -25
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/terminusgps/authorizenet/api/subscriptions.py +8 -8
- python_terminusgps-52.0.0/tests/__init__.py +0 -0
- python_terminusgps-52.0.0/tests/test_authorizenet.py +653 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/uv.lock +142 -54
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/.github/workflows/sphinx.yml +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/.python-version +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/COPYING +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/README.md +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/dist/.gitignore +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/docs/Makefile +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/docs/make.bat +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/docs/requirements.txt +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/docs/source/authorizenet/api.rst +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/docs/source/authorizenet/constants.rst +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/docs/source/authorizenet/index.rst +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/docs/source/authorizenet/service.rst +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/docs/source/conf.py +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/docs/source/index.rst +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/docs/source/mixins.rst +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/docs/source/validators.rst +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/docs/source/wialon/constants.rst +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/docs/source/wialon/exceptions.rst +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/docs/source/wialon/index.rst +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/docs/source/wialon/items.rst +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/docs/source/wialon/session.rst +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/docs/source/wialon/usage.rst +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/docs/source/wialon/utils.rst +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/terminusgps/__init__.py +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/terminusgps/authorizenet/__init__.py +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/terminusgps/authorizenet/api/__init__.py +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/terminusgps/authorizenet/api/transactions.py +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/terminusgps/authorizenet/constants.py +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/terminusgps/authorizenet/service.py +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/terminusgps/default_settings.py +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/terminusgps/mixins.py +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/terminusgps/validators.py +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/terminusgps/wialon/__init__.py +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/terminusgps/wialon/constants.py +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/terminusgps/wialon/flags.py +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/terminusgps/wialon/session.py +0 -0
- {python_terminusgps-51.1.0 → python_terminusgps-52.0.0}/terminusgps/wialon/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-terminusgps
|
|
3
|
-
Version:
|
|
3
|
+
Version: 52.0.0
|
|
4
4
|
Summary: Provides abstractions/utilities for working with Wialon API, Authorize.NET API, AWS API, and more.
|
|
5
5
|
Project-URL: Documentation, https://terminusgps.github.io/python-terminusgps
|
|
6
6
|
Project-URL: Repository, https://github.com/terminusgps/python-terminusgps
|
|
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
13
|
Requires-Python: >=3.12
|
|
14
14
|
Requires-Dist: authorizenet>=1.1.5
|
|
15
|
-
Requires-Dist: django>=
|
|
15
|
+
Requires-Dist: django>=6.0.2
|
|
16
16
|
Requires-Dist: py-aiowialon>=1.3.5
|
|
17
17
|
Requires-Dist: python-wialon>=1.2.4
|
|
18
18
|
Description-Content-Type: text/markdown
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "python-terminusgps"
|
|
3
|
-
version = "
|
|
3
|
+
version = "52.0.0"
|
|
4
4
|
description = "Provides abstractions/utilities for working with Wialon API, Authorize.NET API, AWS API, and more."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
authors = [ {name = "Blake Nall", email = "blake@terminusgps.com" } ]
|
|
@@ -13,7 +13,7 @@ classifiers = [
|
|
|
13
13
|
requires-python = ">=3.12"
|
|
14
14
|
dependencies = [
|
|
15
15
|
"authorizenet>=1.1.5",
|
|
16
|
-
"django>=
|
|
16
|
+
"django>=6.0.2",
|
|
17
17
|
"py-aiowialon>=1.3.5",
|
|
18
18
|
"python-wialon>=1.2.4",
|
|
19
19
|
]
|
|
@@ -71,6 +71,7 @@ skip-magic-trailing-comma = true
|
|
|
71
71
|
|
|
72
72
|
[dependency-groups]
|
|
73
73
|
dev = [
|
|
74
|
+
"coverage>=7.13.4",
|
|
74
75
|
"django-stubs>=5.1.3",
|
|
75
76
|
]
|
|
76
77
|
docs = [
|
|
@@ -12,7 +12,7 @@ __all__ = [
|
|
|
12
12
|
|
|
13
13
|
def create_customer_shipping_address(
|
|
14
14
|
customer_profile_id: int,
|
|
15
|
-
|
|
15
|
+
contract: apicontractsv1.customerAddressType,
|
|
16
16
|
default: bool = False,
|
|
17
17
|
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
18
18
|
"""
|
|
@@ -20,8 +20,8 @@ def create_customer_shipping_address(
|
|
|
20
20
|
|
|
21
21
|
:param customer_profile_id: An Authorizenet customer profile id.
|
|
22
22
|
:type customer_profile_id: int
|
|
23
|
-
:param
|
|
24
|
-
:type
|
|
23
|
+
:param contract: An Authorizenet customer address contract.
|
|
24
|
+
:type contract: ~authorizenet.apicontractsv1.customerAddressType
|
|
25
25
|
:param default: Whether to set the address profile as default. Default is :py:obj:`False`.
|
|
26
26
|
:type default: bool
|
|
27
27
|
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
@@ -30,8 +30,8 @@ def create_customer_shipping_address(
|
|
|
30
30
|
"""
|
|
31
31
|
request = apicontractsv1.createCustomerShippingAddressRequest()
|
|
32
32
|
request.customerProfileId = str(customer_profile_id)
|
|
33
|
-
request.address =
|
|
34
|
-
request.defaultShippingAddress =
|
|
33
|
+
request.address = contract
|
|
34
|
+
request.defaultShippingAddress = int(default)
|
|
35
35
|
return request, apicontrollers.createCustomerShippingAddressController
|
|
36
36
|
|
|
37
37
|
|
|
@@ -57,8 +57,7 @@ def get_customer_shipping_address(
|
|
|
57
57
|
|
|
58
58
|
def update_customer_shipping_address(
|
|
59
59
|
customer_profile_id: int,
|
|
60
|
-
|
|
61
|
-
address: apicontractsv1.customerAddressType,
|
|
60
|
+
contract: apicontractsv1.customerAddressExType,
|
|
62
61
|
default: bool,
|
|
63
62
|
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
64
63
|
"""
|
|
@@ -66,40 +65,21 @@ def update_customer_shipping_address(
|
|
|
66
65
|
|
|
67
66
|
:param customer_profile_id: An Authorizenet customer profile id.
|
|
68
67
|
:type customer_profile_id: int
|
|
69
|
-
:
|
|
70
|
-
:
|
|
71
|
-
:type address: ~authorizenet.apicontractsv1.customerAddressType
|
|
72
|
-
:param address: An Authorizenet customer address element.
|
|
73
|
-
:type address: ~authorizenet.apicontractsv1.customerAddressType
|
|
68
|
+
:type contract: ~authorizenet.apicontractsv1.customerAddressExType
|
|
69
|
+
:param contract: An Authorizenet customer address ex element.
|
|
74
70
|
:param default: Whether to set the address profile as default.
|
|
75
71
|
:type default: bool
|
|
72
|
+
:raises ValueError: If the contract didn't have :py:attr:`customerAddressId` set.
|
|
76
73
|
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
77
74
|
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
78
75
|
|
|
79
76
|
"""
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if first_name := getattr(address, "firstName", None):
|
|
83
|
-
address_ex.firstName = str(first_name)
|
|
84
|
-
if last_name := getattr(address, "lastName", None):
|
|
85
|
-
address_ex.lastName = str(last_name)
|
|
86
|
-
if street := getattr(address, "address", None):
|
|
87
|
-
address_ex.address = str(street)
|
|
88
|
-
if city := getattr(address, "city", None):
|
|
89
|
-
address_ex.city = str(city)
|
|
90
|
-
if state := getattr(address, "state", None):
|
|
91
|
-
address_ex.state = str(state)
|
|
92
|
-
if country := getattr(address, "country", None):
|
|
93
|
-
address_ex.country = str(country)
|
|
94
|
-
if phone_number := getattr(address, "phoneNumber", None):
|
|
95
|
-
address_ex.phoneNumber = str(phone_number)
|
|
96
|
-
if zip_code := getattr(address, "zip", None):
|
|
97
|
-
address_ex.zip = str(zip_code)
|
|
98
|
-
|
|
77
|
+
if not contract.customerAddressId:
|
|
78
|
+
raise ValueError("'customerAddressId' is required in contract")
|
|
99
79
|
request = apicontractsv1.updateCustomerShippingAddressRequest()
|
|
100
80
|
request.customerProfileId = str(customer_profile_id)
|
|
101
|
-
request.address =
|
|
102
|
-
request.defaultShippingAddress =
|
|
81
|
+
request.address = contract
|
|
82
|
+
request.defaultShippingAddress = int(default)
|
|
103
83
|
return request, apicontrollers.updateCustomerShippingAddressController
|
|
104
84
|
|
|
105
85
|
|
|
@@ -6,94 +6,76 @@ __all__ = [
|
|
|
6
6
|
"create_customer_profile",
|
|
7
7
|
"delete_customer_profile",
|
|
8
8
|
"get_customer_profile",
|
|
9
|
-
"get_customer_profile_by_email",
|
|
10
|
-
"get_customer_profile_by_merchant_id",
|
|
11
9
|
"get_customer_profile_ids",
|
|
12
10
|
"update_customer_profile",
|
|
13
11
|
]
|
|
14
12
|
|
|
15
13
|
|
|
16
14
|
def create_customer_profile(
|
|
17
|
-
|
|
15
|
+
contract: apicontractsv1.customerProfileType,
|
|
18
16
|
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
19
17
|
"""
|
|
20
18
|
`createCustomerProfileRequest <https://developer.authorize.net/api/reference/index.html#customer-profiles-create-customer-profile>`_.
|
|
21
19
|
|
|
22
|
-
:param
|
|
23
|
-
:type
|
|
24
|
-
:
|
|
25
|
-
:type email: str
|
|
26
|
-
:param description: An optional customer description.
|
|
27
|
-
:type description: str
|
|
20
|
+
:param contract: A customer profile contract element.
|
|
21
|
+
:type contract: ~apicontractsv1.customerProfileType
|
|
22
|
+
:raises ValueError: If the contract didn't have at least one of ``email``, ``merchantCustomerId`` or ``description``.
|
|
28
23
|
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
29
24
|
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
30
25
|
|
|
31
26
|
"""
|
|
27
|
+
if not any(
|
|
28
|
+
[contract.email, contract.merchantCustomerId, contract.description]
|
|
29
|
+
):
|
|
30
|
+
raise ValueError(
|
|
31
|
+
"At least one of 'email', 'merchantCustomerId' or 'description' is required in contract"
|
|
32
|
+
)
|
|
32
33
|
request = apicontractsv1.createCustomerProfileRequest()
|
|
33
|
-
request.profile =
|
|
34
|
-
request.profile.merchantCustomerId = merchant_id
|
|
35
|
-
request.profile.description = description
|
|
36
|
-
request.profile.email = email
|
|
34
|
+
request.profile = contract
|
|
37
35
|
return request, apicontrollers.createCustomerProfileController
|
|
38
36
|
|
|
39
37
|
|
|
40
38
|
def get_customer_profile(
|
|
41
|
-
customer_profile_id: int
|
|
39
|
+
customer_profile_id: int | None = None,
|
|
40
|
+
email: str | None = None,
|
|
41
|
+
merchant_id: str | None = None,
|
|
42
|
+
description: str | None = None,
|
|
43
|
+
include_issuer_info: bool = False,
|
|
44
|
+
unmask_expiration_date: bool = False,
|
|
42
45
|
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
43
46
|
"""
|
|
44
47
|
`getCustomerProfileRequest <https://developer.authorize.net/api/reference/index.html#customer-profiles-get-customer-profile>`_.
|
|
45
48
|
|
|
46
49
|
:param customer_profile_id: Authorizenet customer profile id.
|
|
47
|
-
:type customer_profile_id: int
|
|
50
|
+
:type customer_profile_id: int | None
|
|
51
|
+
:param email: Authorizenet customer profile email.
|
|
52
|
+
:type email: str | None
|
|
53
|
+
:param merchant_id: Authorizenet customer profile merchant id.
|
|
54
|
+
:type merchant_id: str | None
|
|
55
|
+
:param description: Authorizenet customer profile description.
|
|
56
|
+
:type description: str | None
|
|
48
57
|
:param include_issuer_info: Whether to include issuer info in the response. Default is :py:obj:`False`.
|
|
49
58
|
:type include_issuer_info: bool
|
|
50
59
|
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
51
60
|
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
52
61
|
|
|
53
62
|
"""
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
def get_customer_profile_by_email(
|
|
61
|
-
email: str, include_issuer_info: bool = False
|
|
62
|
-
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
63
|
-
"""
|
|
64
|
-
`getCustomerProfileRequest <https://developer.authorize.net/api/reference/index.html#customer-profiles-get-customer-profile>`_.
|
|
65
|
-
|
|
66
|
-
:param email: Merchant designated customer profile email address.
|
|
67
|
-
:type email: str
|
|
68
|
-
:param include_issuer_info: Whether to include issuer info in the response. Default is :py:obj:`False`.
|
|
69
|
-
:type include_issuer_info: bool
|
|
70
|
-
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
71
|
-
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
63
|
+
if not any([customer_profile_id, email, merchant_id, description]):
|
|
64
|
+
raise ValueError(
|
|
65
|
+
"At least one of 'customer_profile_id', 'email', 'merchant_id' or 'description' is required."
|
|
66
|
+
)
|
|
72
67
|
|
|
73
|
-
"""
|
|
74
|
-
request = apicontractsv1.getCustomerProfileRequest()
|
|
75
|
-
request.email = str(email)
|
|
76
|
-
request.includeIssuerInfo = str(include_issuer_info).lower()
|
|
77
|
-
return request, apicontrollers.getCustomerProfileController
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
def get_customer_profile_by_merchant_id(
|
|
81
|
-
merchant_id: str, include_issuer_info: bool = False
|
|
82
|
-
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
83
|
-
"""
|
|
84
|
-
`getCustomerProfileRequest <https://developer.authorize.net/api/reference/index.html#customer-profiles-get-customer-profile>`_.
|
|
85
|
-
|
|
86
|
-
:param merchant_id: Merchant designated customer profile id.
|
|
87
|
-
:type merchant_id: str
|
|
88
|
-
:param include_issuer_info: Whether to include issuer info in the response. Default is :py:obj:`False`.
|
|
89
|
-
:type include_issuer_info: bool
|
|
90
|
-
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
91
|
-
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
92
|
-
|
|
93
|
-
"""
|
|
94
68
|
request = apicontractsv1.getCustomerProfileRequest()
|
|
95
|
-
request.merchantCustomerId = str(merchant_id)
|
|
96
69
|
request.includeIssuerInfo = str(include_issuer_info).lower()
|
|
70
|
+
request.unmaskExpirationDate = str(unmask_expiration_date).lower()
|
|
71
|
+
if customer_profile_id is not None:
|
|
72
|
+
request.customerProfileId = str(customer_profile_id)
|
|
73
|
+
if email is not None:
|
|
74
|
+
request.email = email
|
|
75
|
+
if merchant_id is not None:
|
|
76
|
+
request.merchantCustomerId = merchant_id
|
|
77
|
+
if description is not None:
|
|
78
|
+
request.description = description
|
|
97
79
|
return request, apicontrollers.getCustomerProfileController
|
|
98
80
|
|
|
99
81
|
|
|
@@ -112,19 +94,25 @@ def get_customer_profile_ids() -> tuple[
|
|
|
112
94
|
|
|
113
95
|
|
|
114
96
|
def update_customer_profile(
|
|
115
|
-
|
|
97
|
+
contract: apicontractsv1.customerProfileExType,
|
|
116
98
|
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
117
99
|
"""
|
|
118
100
|
`updateCustomerProfileRequest <https://developer.authorize.net/api/reference/index.html#customer-profiles-update-customer-profile>`_.
|
|
119
101
|
|
|
120
|
-
:param
|
|
121
|
-
:type
|
|
102
|
+
:param contract: An Authorizenet customer profile ex contract.
|
|
103
|
+
:type contract: ~authorizenet.apicontractsv1.customerProfileExType
|
|
104
|
+
:raises TypeError: If the contract wasn't of type :py:class:`~apicontractsv1.customerProfileExType`.
|
|
105
|
+
:raises ValueError: If the contract didn't have all required attributes.
|
|
122
106
|
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
123
107
|
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
124
108
|
|
|
125
109
|
"""
|
|
110
|
+
if not contract.customerProfileId:
|
|
111
|
+
raise ValueError(
|
|
112
|
+
f"Invalid value for 'customerProfileId': '{contract.customerProfileId}'"
|
|
113
|
+
)
|
|
126
114
|
request = apicontractsv1.updateCustomerProfileRequest()
|
|
127
|
-
request.profile =
|
|
115
|
+
request.profile = contract
|
|
128
116
|
return request, apicontrollers.updateCustomerProfileController
|
|
129
117
|
|
|
130
118
|
|
|
@@ -13,8 +13,7 @@ __all__ = [
|
|
|
13
13
|
|
|
14
14
|
def create_customer_payment_profile(
|
|
15
15
|
customer_profile_id: int,
|
|
16
|
-
|
|
17
|
-
address: apicontractsv1.customerAddressType,
|
|
16
|
+
contract: apicontractsv1.customerPaymentProfileType,
|
|
18
17
|
default: bool = False,
|
|
19
18
|
validation: str = "liveMode",
|
|
20
19
|
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
@@ -23,10 +22,8 @@ def create_customer_payment_profile(
|
|
|
23
22
|
|
|
24
23
|
:param customer_profile_id: An Authorizenet customer profile id.
|
|
25
24
|
:type customer_profile_id: int
|
|
26
|
-
:param
|
|
27
|
-
:type
|
|
28
|
-
:param address: An Authorizenet address element.
|
|
29
|
-
:type address: ~authorizenet.apicontractsv1.customerAddressType
|
|
25
|
+
:param contract: A customer payment profile element.
|
|
26
|
+
:type contract: ~authorizenet.apicontractsv1.customerPaymentProfileType
|
|
30
27
|
:param default: Whether to set the payment profile as default. Default is :py:obj:`False`.
|
|
31
28
|
:type default: bool
|
|
32
29
|
:param validation: Validation mode. Default is :py:obj:`"liveMode"`.
|
|
@@ -35,13 +32,15 @@ def create_customer_payment_profile(
|
|
|
35
32
|
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
36
33
|
|
|
37
34
|
"""
|
|
35
|
+
if not contract.payment:
|
|
36
|
+
raise ValueError("'payment' attribute is required in contract")
|
|
37
|
+
if not contract.billTo:
|
|
38
|
+
raise ValueError("'billTo' attribute is required in contract")
|
|
38
39
|
request = apicontractsv1.createCustomerPaymentProfileRequest()
|
|
39
40
|
request.customerProfileId = str(customer_profile_id)
|
|
40
41
|
request.validationMode = validation
|
|
41
|
-
request.paymentProfile =
|
|
42
|
-
request.paymentProfile.
|
|
43
|
-
request.paymentProfile.billTo = address
|
|
44
|
-
request.paymentProfile.defaultPaymentProfile = str(default).lower()
|
|
42
|
+
request.paymentProfile = contract
|
|
43
|
+
request.paymentProfile.defaultPaymentProfile = int(default)
|
|
45
44
|
return request, apicontrollers.createCustomerPaymentProfileController
|
|
46
45
|
|
|
47
46
|
|
|
@@ -66,7 +65,7 @@ def get_customer_payment_profile(
|
|
|
66
65
|
request = apicontractsv1.getCustomerPaymentProfileRequest()
|
|
67
66
|
request.customerProfileId = str(customer_profile_id)
|
|
68
67
|
request.customerPaymentProfileId = str(payment_profile_id)
|
|
69
|
-
request.includeIssuerInfo =
|
|
68
|
+
request.includeIssuerInfo = int(include_issuer_info)
|
|
70
69
|
return request, apicontrollers.getCustomerPaymentProfileController
|
|
71
70
|
|
|
72
71
|
|
|
@@ -97,9 +96,7 @@ def validate_customer_payment_profile(
|
|
|
97
96
|
|
|
98
97
|
def update_customer_payment_profile(
|
|
99
98
|
customer_profile_id: int,
|
|
100
|
-
|
|
101
|
-
payment: apicontractsv1.paymentType,
|
|
102
|
-
address: apicontractsv1.customerAddressType,
|
|
99
|
+
contract: apicontractsv1.customerPaymentProfileExType,
|
|
103
100
|
default: bool,
|
|
104
101
|
validation: str = "liveMode",
|
|
105
102
|
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
@@ -108,12 +105,8 @@ def update_customer_payment_profile(
|
|
|
108
105
|
|
|
109
106
|
:param customer_profile_id: An Authorizenet customer profile id.
|
|
110
107
|
:type customer_profile_id: int
|
|
111
|
-
:param
|
|
112
|
-
:type
|
|
113
|
-
:param payment: An Authorizenet payment element.
|
|
114
|
-
:type payment: ~authorizenet.apicontractsv1.paymentType
|
|
115
|
-
:param address: An Authorizenet address element.
|
|
116
|
-
:type address: ~authorizenet.apicontractsv1.customerAddressType
|
|
108
|
+
:param contract: A customer payment profile ex element.
|
|
109
|
+
:type contract: ~authorizenet.apicontractsv1.customerPaymentProfileExType
|
|
117
110
|
:param default: Whether to set the payment profile as default.
|
|
118
111
|
:type default: bool
|
|
119
112
|
:param validation: Validation mode. Default is :py:obj:`"liveMode"`.
|
|
@@ -123,14 +116,17 @@ def update_customer_payment_profile(
|
|
|
123
116
|
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
124
117
|
|
|
125
118
|
"""
|
|
119
|
+
if not contract.payment:
|
|
120
|
+
raise ValueError("'payment' attribute is required in contract")
|
|
121
|
+
if not contract.billTo:
|
|
122
|
+
raise ValueError("'billTo' attribute is required in contract")
|
|
123
|
+
if not contract.customerPaymentProfileId:
|
|
124
|
+
raise ValueError("'customerPaymentProfileId' is required in contract")
|
|
126
125
|
request = apicontractsv1.updateCustomerPaymentProfileRequest()
|
|
127
126
|
request.customerProfileId = str(customer_profile_id)
|
|
128
127
|
request.validationMode = validation
|
|
129
|
-
request.paymentProfile =
|
|
130
|
-
request.paymentProfile.
|
|
131
|
-
request.paymentProfile.payment = payment
|
|
132
|
-
request.paymentProfile.billTo = address
|
|
133
|
-
request.paymentProfile.defaultPaymentProfile = str(default).lower()
|
|
128
|
+
request.paymentProfile = contract
|
|
129
|
+
request.paymentProfile.defaultPaymentProfile = int(default)
|
|
134
130
|
return request, apicontrollers.updateCustomerPaymentProfileController
|
|
135
131
|
|
|
136
132
|
|
|
@@ -12,19 +12,19 @@ __all__ = [
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
def create_subscription(
|
|
15
|
-
|
|
15
|
+
contract: apicontractsv1.ARBSubscriptionType,
|
|
16
16
|
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
17
17
|
"""
|
|
18
18
|
`ARBCreateSubscriptionRequest <https://developer.authorize.net/api/reference/index.html#recurring-billing-create-a-subscription>`_.
|
|
19
19
|
|
|
20
|
-
:param
|
|
21
|
-
:type
|
|
20
|
+
:param contract: An Authorizenet ARBSubscriptionType element.
|
|
21
|
+
:type contract: ~authorizenet.apicontractsv1.ARBSubscriptionType
|
|
22
22
|
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
23
23
|
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
24
24
|
|
|
25
25
|
"""
|
|
26
26
|
request = apicontractsv1.ARBCreateSubscriptionRequest()
|
|
27
|
-
request.subscription =
|
|
27
|
+
request.subscription = contract
|
|
28
28
|
return request, apicontrollers.ARBCreateSubscriptionController
|
|
29
29
|
|
|
30
30
|
|
|
@@ -66,22 +66,22 @@ def get_subscription_status(
|
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
def update_subscription(
|
|
69
|
-
subscription_id: int,
|
|
69
|
+
subscription_id: int, contract: apicontractsv1.ARBSubscriptionType
|
|
70
70
|
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
71
71
|
"""
|
|
72
72
|
`ARBUpdateSubscriptionRequest <https://developer.authorize.net/api/reference/index.html#recurring-billing-update-a-subscription>`_.
|
|
73
73
|
|
|
74
74
|
:param subscription_id: An Authorizenet subscription id.
|
|
75
75
|
:type subscription_id: int
|
|
76
|
-
:param
|
|
77
|
-
:type
|
|
76
|
+
:param contract: An Authorizenet ARBSubscriptionType element.
|
|
77
|
+
:type contract: ~authorizenet.apicontractsv1.ARBSubscriptionType
|
|
78
78
|
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
79
79
|
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
80
80
|
|
|
81
81
|
"""
|
|
82
82
|
request = apicontractsv1.ARBUpdateSubscriptionRequest()
|
|
83
83
|
request.subscriptionId = str(subscription_id)
|
|
84
|
-
request.subscription =
|
|
84
|
+
request.subscription = contract
|
|
85
85
|
return request, apicontrollers.ARBUpdateSubscriptionController
|
|
86
86
|
|
|
87
87
|
|
|
File without changes
|