python-terminusgps 43.3.0__py3-none-any.whl → 45.0.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.
- {python_terminusgps-43.3.0.dist-info → python_terminusgps-45.0.0.dist-info}/METADATA +1 -1
- python_terminusgps-45.0.0.dist-info/RECORD +35 -0
- terminusgps/authorizenet/api/address_profiles.py +19 -37
- terminusgps/authorizenet/api/customer_profiles.py +25 -45
- terminusgps/authorizenet/api/payment_profiles.py +22 -45
- terminusgps/authorizenet/api/subscriptions.py +25 -43
- terminusgps/authorizenet/api/transactions.py +1 -78
- terminusgps/authorizenet/auth.py +24 -11
- terminusgps/authorizenet/constants.py +21 -5
- terminusgps/authorizenet/controllers.py +3 -13
- terminusgps/{django/settings.py → default_settings.py} +5 -5
- terminusgps/validators.py +242 -0
- terminusgps/wialon/items/account.py +10 -10
- terminusgps/wialon/items/base.py +7 -7
- terminusgps/wialon/items/resource.py +3 -3
- terminusgps/wialon/items/retranslator.py +3 -21
- terminusgps/wialon/items/route.py +1 -1
- terminusgps/wialon/items/unit.py +5 -5
- terminusgps/wialon/items/unit_group.py +2 -2
- terminusgps/wialon/items/user.py +5 -5
- terminusgps/wialon/session.py +25 -22
- python_terminusgps-43.3.0.dist-info/RECORD +0 -38
- terminusgps/django/__init__.py +0 -0
- terminusgps/django/forms/__init__.py +0 -0
- terminusgps/django/forms/renderer.py +0 -5
- terminusgps/django/validators.py +0 -99
- {python_terminusgps-43.3.0.dist-info → python_terminusgps-45.0.0.dist-info}/WHEEL +0 -0
- {python_terminusgps-43.3.0.dist-info → python_terminusgps-45.0.0.dist-info}/licenses/COPYING +0 -0
- /terminusgps/{django/mixins.py → mixins.py} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-terminusgps
|
|
3
|
-
Version:
|
|
3
|
+
Version: 45.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
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
terminusgps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
terminusgps/default_settings.py,sha256=7GLW3RlkuTbpj82KSWjcbgf-unEmrPvKCyLci14LG6g,537
|
|
3
|
+
terminusgps/mixins.py,sha256=Q9ZJuzpk3d9lDnlVA8ZTVvnZWxB13p08EQ8yVJcztn4,1034
|
|
4
|
+
terminusgps/validators.py,sha256=Mf0c7ku_wTQ7uv4hcLRyz0r2eRjvznIL77LLTE5uJ6E,9152
|
|
5
|
+
terminusgps/authorizenet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
terminusgps/authorizenet/auth.py,sha256=ZWb9ebJp22o-ImiMLQIzSMENICnbPZOlbX5RO0IEyRU,2199
|
|
7
|
+
terminusgps/authorizenet/constants.py,sha256=eukAZQVuv3XHL-Kd1gqxf8IYUqNC67ClTz4ZU7JPNYE,1459
|
|
8
|
+
terminusgps/authorizenet/controllers.py,sha256=Lsxp7PptdvcETeblK9fbNOvMy4gkN5iq9l3-pqQo2zs,1725
|
|
9
|
+
terminusgps/authorizenet/validators.py,sha256=Wq4rqEuqG3JzOO7O1wM6oQ0FciNxxOK0HnJqTuLa8CY,3916
|
|
10
|
+
terminusgps/authorizenet/api/__init__.py,sha256=VXR4Yco1yz5R-R7vgaH2zTP9VFqzfvvGy_XJVjyb3i0,154
|
|
11
|
+
terminusgps/authorizenet/api/address_profiles.py,sha256=VouUN6dIxlnuE3qEiacFqqDBi_VtwvSbsELqTqFZ0BE,4746
|
|
12
|
+
terminusgps/authorizenet/api/customer_profiles.py,sha256=oya9KMRE10nKLjECTIdanfV_P8-gnNZLE0sYmRYVkgM,4505
|
|
13
|
+
terminusgps/authorizenet/api/payment_profiles.py,sha256=vSMCEJNm75ZjBex4S9wLuHn9omj_nMpQ4JtU8rj_zQc,6498
|
|
14
|
+
terminusgps/authorizenet/api/subscriptions.py,sha256=VAXKjOHLOfifrixObK6XbiJCmPobkYBzXJQrjtos9LE,4542
|
|
15
|
+
terminusgps/authorizenet/api/transactions.py,sha256=drymc7uplWHOoaMmatz8nP1gDN_GDef0QVJBqB9oIfE,20
|
|
16
|
+
terminusgps/wialon/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
+
terminusgps/wialon/constants.py,sha256=p2BhopeE6lXzjzdzb4ZKOz0rhJQIMUbXLrBy1Yzf57s,13730
|
|
18
|
+
terminusgps/wialon/flags.py,sha256=M50EdhxQ8IMnJnU0mrHK7-h8Asc6tvNiTOOfd1dBW6A,12815
|
|
19
|
+
terminusgps/wialon/session.py,sha256=GdgPvhNbUrvx_-vPRWsjY5TeuI3HgjlHcy315LBpZ7o,5646
|
|
20
|
+
terminusgps/wialon/utils.py,sha256=E7J9s4p7P-OePtttxcBogxu3WiXqf4xxr_Tksbisl60,9957
|
|
21
|
+
terminusgps/wialon/validators.py,sha256=o5__H9HHnGYth8QAKErJG5rEub7FnT8ue0S3IQ8b67o,4232
|
|
22
|
+
terminusgps/wialon/items/__init__.py,sha256=RTiY9ziXqKCB8VWGoExOIErDlUMBBfzzsA7nlOlCZ2w,41
|
|
23
|
+
terminusgps/wialon/items/account.py,sha256=eN9oOuXReVR_x5P9HKg2xlk6vk7FlVnki7bjzlzaWg4,7868
|
|
24
|
+
terminusgps/wialon/items/base.py,sha256=CQwxYhW6HXMCZX8l91pWac5DTBiOqyK_FAThpUQb9fM,9360
|
|
25
|
+
terminusgps/wialon/items/factory.py,sha256=7Xjog8qJPUqKj6RVO92ZaN_fD6WWb9x9ARHkZ3VPeBo,4074
|
|
26
|
+
terminusgps/wialon/items/resource.py,sha256=XTnj6GAnKBDL6eGZsR_KMe2EocM369FXyvSwejM1aLQ,4876
|
|
27
|
+
terminusgps/wialon/items/retranslator.py,sha256=u4qJ44G7r3ntdJ2rFcfkTJhxs9DshER3GG1Yojo5kxw,1458
|
|
28
|
+
terminusgps/wialon/items/route.py,sha256=9hmRBEFRJF3lKukv_y3blZxqxv75YgFCcRALrU6A6QI,1306
|
|
29
|
+
terminusgps/wialon/items/unit.py,sha256=B5iuGEghu89SL8KzYLUytYNRa8cogsVtf-bJ_RybPTA,5522
|
|
30
|
+
terminusgps/wialon/items/unit_group.py,sha256=MIR0x5IlTjcnwx8Y9wXLNTql-wwVVj7NCe7dL2vOw4c,2131
|
|
31
|
+
terminusgps/wialon/items/user.py,sha256=CRSICiJ-qzybEO_gXuKyzW5oa2RQeIp0SzX9ARcdME4,5151
|
|
32
|
+
python_terminusgps-45.0.0.dist-info/METADATA,sha256=oD3VH4M5HU8JcvxWZqghKtZ_Toi8IH7oHrUvkcQlbr8,938
|
|
33
|
+
python_terminusgps-45.0.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
34
|
+
python_terminusgps-45.0.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
35
|
+
python_terminusgps-45.0.0.dist-info/RECORD,,
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
from authorizenet import apicontractsv1, apicontrollers
|
|
2
|
+
from authorizenet.apicontrollersbase import APIOperationBase
|
|
2
3
|
from lxml.objectify import ObjectifiedElement
|
|
3
4
|
|
|
4
|
-
from terminusgps.authorizenet.auth import get_merchant_auth
|
|
5
|
-
from terminusgps.authorizenet.controllers import execute_controller
|
|
6
|
-
|
|
7
5
|
__all__ = [
|
|
8
6
|
"create_customer_shipping_address",
|
|
9
7
|
"get_customer_shipping_address",
|
|
@@ -16,7 +14,7 @@ def create_customer_shipping_address(
|
|
|
16
14
|
customer_profile_id: int,
|
|
17
15
|
address: apicontractsv1.customerAddressType,
|
|
18
16
|
default: bool = False,
|
|
19
|
-
) -> ObjectifiedElement
|
|
17
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
20
18
|
"""
|
|
21
19
|
`createCustomerShippingAddressRequest <https://developer.authorize.net/api/reference/index.html#customer-profiles-create-customer-shipping-address>`_.
|
|
22
20
|
|
|
@@ -24,26 +22,22 @@ def create_customer_shipping_address(
|
|
|
24
22
|
:type customer_profile_id: int
|
|
25
23
|
:param address: An Authorizenet customer address element.
|
|
26
24
|
:type address: ~authorizenet.apicontractsv1.customerAddressType
|
|
27
|
-
:param default: Whether to set the address profile as default. Default is False
|
|
25
|
+
:param default: Whether to set the address profile as default. Default is :py:obj:`False`.
|
|
28
26
|
:type default: bool
|
|
29
|
-
:returns:
|
|
30
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
27
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
28
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
31
29
|
|
|
32
30
|
"""
|
|
33
31
|
request = apicontractsv1.createCustomerShippingAddressRequest()
|
|
34
|
-
request.merchantAuthentication = get_merchant_auth()
|
|
35
32
|
request.customerProfileId = str(customer_profile_id)
|
|
36
33
|
request.address = address
|
|
37
34
|
request.defaultShippingAddress = str(default).lower()
|
|
38
|
-
|
|
39
|
-
return execute_controller(
|
|
40
|
-
apicontrollers.createCustomerShippingAddressController(request)
|
|
41
|
-
)
|
|
35
|
+
return request, apicontrollers.createCustomerShippingAddressController
|
|
42
36
|
|
|
43
37
|
|
|
44
38
|
def get_customer_shipping_address(
|
|
45
39
|
customer_profile_id: int, address_profile_id: int
|
|
46
|
-
) -> ObjectifiedElement
|
|
40
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
47
41
|
"""
|
|
48
42
|
`getCustomerShippingAddressRequest <https://developer.authorize.net/api/reference/index.html#customer-profiles-get-customer-shipping-address>`_.
|
|
49
43
|
|
|
@@ -51,25 +45,21 @@ def get_customer_shipping_address(
|
|
|
51
45
|
:type customer_profile_id: int
|
|
52
46
|
:param address_profile_id: An Authorizenet customer address profile id.
|
|
53
47
|
:type address_profile_id: int
|
|
54
|
-
:returns:
|
|
55
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
48
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
49
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
56
50
|
|
|
57
51
|
"""
|
|
58
52
|
request = apicontractsv1.getCustomerShippingAddressRequest()
|
|
59
|
-
request.merchantAuthentication = get_merchant_auth()
|
|
60
53
|
request.customerProfileId = str(customer_profile_id)
|
|
61
54
|
request.customerAddressId = str(address_profile_id)
|
|
62
|
-
|
|
63
|
-
return execute_controller(
|
|
64
|
-
apicontrollers.getCustomerShippingAddressController(request)
|
|
65
|
-
)
|
|
55
|
+
return request, apicontrollers.getCustomerShippingAddressController
|
|
66
56
|
|
|
67
57
|
|
|
68
58
|
def update_customer_shipping_address(
|
|
69
59
|
customer_profile_id: int,
|
|
70
60
|
address: apicontractsv1.customerAddressType,
|
|
71
61
|
default: bool = False,
|
|
72
|
-
) -> ObjectifiedElement
|
|
62
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
73
63
|
"""
|
|
74
64
|
`updateCustomerShippingAddressRequest <https://developer.authorize.net/api/reference/index.html#customer-profiles-update-customer-shipping-address>`_.
|
|
75
65
|
|
|
@@ -77,26 +67,22 @@ def update_customer_shipping_address(
|
|
|
77
67
|
:type customer_profile_id: int
|
|
78
68
|
:param address: An Authorizenet customer address element.
|
|
79
69
|
:type address: ~authorizenet.apicontractsv1.customerAddressType
|
|
80
|
-
:param default: Whether to set the address profile as default. Default is False
|
|
70
|
+
:param default: Whether to set the address profile as default. Default is :py:obj:`False`.
|
|
81
71
|
:type default: bool
|
|
82
|
-
:returns:
|
|
83
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
72
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
73
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
84
74
|
|
|
85
75
|
"""
|
|
86
76
|
request = apicontractsv1.updateCustomerShippingAddressRequest()
|
|
87
|
-
request.merchantAuthentication = get_merchant_auth()
|
|
88
77
|
request.customerProfileId = str(customer_profile_id)
|
|
89
78
|
request.address = address
|
|
90
79
|
request.defaultShippingAddress = str(default).lower()
|
|
91
|
-
|
|
92
|
-
return execute_controller(
|
|
93
|
-
apicontrollers.updateCustomerShippingAddressController(request)
|
|
94
|
-
)
|
|
80
|
+
return request, apicontrollers.updateCustomerShippingAddressController
|
|
95
81
|
|
|
96
82
|
|
|
97
83
|
def delete_customer_shipping_address(
|
|
98
84
|
customer_profile_id: int, address_profile_id: int
|
|
99
|
-
) -> ObjectifiedElement
|
|
85
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
100
86
|
"""
|
|
101
87
|
`deleteCustomerShippingAddressRequest <https://developer.authorize.net/api/reference/index.html#customer-profiles-delete-customer-shipping-address>`_.
|
|
102
88
|
|
|
@@ -104,15 +90,11 @@ def delete_customer_shipping_address(
|
|
|
104
90
|
:type customer_profile_id: int
|
|
105
91
|
:param address_profile_id: An Authorizenet customer address profile id.
|
|
106
92
|
:type address_profile_id: int
|
|
107
|
-
:returns:
|
|
108
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
93
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
94
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
109
95
|
|
|
110
96
|
"""
|
|
111
97
|
request = apicontractsv1.deleteCustomerShippingAddressRequest()
|
|
112
|
-
request.merchantAuthentication = get_merchant_auth()
|
|
113
98
|
request.customerProfileId = str(customer_profile_id)
|
|
114
99
|
request.customerAddressId = str(address_profile_id)
|
|
115
|
-
|
|
116
|
-
return execute_controller(
|
|
117
|
-
apicontrollers.deleteCustomerShippingAddressController(request)
|
|
118
|
-
)
|
|
100
|
+
return request, apicontrollers.deleteCustomerShippingAddressController
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
from authorizenet import apicontractsv1, apicontrollers
|
|
2
|
+
from authorizenet.apicontrollersbase import APIOperationBase
|
|
2
3
|
from lxml.objectify import ObjectifiedElement
|
|
3
4
|
|
|
4
|
-
from terminusgps.authorizenet.auth import get_merchant_auth
|
|
5
|
-
from terminusgps.authorizenet.controllers import execute_controller
|
|
6
|
-
|
|
7
5
|
__all__ = [
|
|
8
6
|
"create_customer_profile",
|
|
9
7
|
"get_customer_profile",
|
|
@@ -15,7 +13,7 @@ __all__ = [
|
|
|
15
13
|
|
|
16
14
|
def create_customer_profile(
|
|
17
15
|
merchant_id: str, email: str, description: str = ""
|
|
18
|
-
) -> ObjectifiedElement
|
|
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
|
|
|
@@ -25,99 +23,81 @@ def create_customer_profile(
|
|
|
25
23
|
:type email: str
|
|
26
24
|
:param description: An optional customer description.
|
|
27
25
|
:type description: str
|
|
28
|
-
:returns:
|
|
29
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
26
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
27
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
30
28
|
|
|
31
29
|
"""
|
|
32
30
|
request = apicontractsv1.createCustomerProfileRequest()
|
|
33
|
-
request.merchantAuthentication = get_merchant_auth()
|
|
34
31
|
request.profile = apicontractsv1.customerProfileType()
|
|
35
32
|
request.profile.merchantCustomerId = merchant_id
|
|
36
33
|
request.profile.description = description
|
|
37
34
|
request.profile.email = email
|
|
38
|
-
|
|
39
|
-
return execute_controller(
|
|
40
|
-
apicontrollers.createCustomerProfileController(request)
|
|
41
|
-
)
|
|
35
|
+
return request, apicontrollers.createCustomerProfileController
|
|
42
36
|
|
|
43
37
|
|
|
44
38
|
def get_customer_profile(
|
|
45
39
|
customer_profile_id: int, include_issuer_info: bool = False
|
|
46
|
-
) -> ObjectifiedElement
|
|
40
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
47
41
|
"""
|
|
48
42
|
`getCustomerProfileRequest <https://developer.authorize.net/api/reference/index.html#customer-profiles-get-customer-profile>`_.
|
|
49
43
|
|
|
50
|
-
:param customer_profile_id:
|
|
44
|
+
:param customer_profile_id: Authorizenet customer profile id.
|
|
51
45
|
:type customer_profile_id: int
|
|
52
|
-
:param include_issuer_info: Whether to include issuer info in the response. Default is False
|
|
46
|
+
:param include_issuer_info: Whether to include issuer info in the response. Default is :py:obj:`False`.
|
|
53
47
|
:type include_issuer_info: bool
|
|
54
|
-
:returns:
|
|
55
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
48
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
49
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
56
50
|
|
|
57
51
|
"""
|
|
58
52
|
request = apicontractsv1.getCustomerProfileRequest()
|
|
59
|
-
request.merchantAuthentication = get_merchant_auth()
|
|
60
53
|
request.customerProfileId = str(customer_profile_id)
|
|
61
54
|
request.includeIssuerInfo = str(include_issuer_info).lower()
|
|
62
|
-
|
|
63
|
-
return execute_controller(
|
|
64
|
-
apicontrollers.getCustomerProfileController(request)
|
|
65
|
-
)
|
|
55
|
+
return request, apicontrollers.getCustomerProfileController
|
|
66
56
|
|
|
67
57
|
|
|
68
|
-
def get_customer_profile_ids() ->
|
|
58
|
+
def get_customer_profile_ids() -> tuple[
|
|
59
|
+
ObjectifiedElement, type[APIOperationBase]
|
|
60
|
+
]:
|
|
69
61
|
"""
|
|
70
62
|
`getCustomerProfileIdsRequest <https://developer.authorize.net/api/reference/index.html#customer-profiles-get-customer-profile-ids>`_.
|
|
71
63
|
|
|
72
|
-
:returns:
|
|
73
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
64
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
65
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
74
66
|
|
|
75
67
|
"""
|
|
76
68
|
request = apicontractsv1.getCustomerProfileIdsRequest()
|
|
77
|
-
request.
|
|
78
|
-
|
|
79
|
-
return execute_controller(
|
|
80
|
-
apicontrollers.getCustomerProfileIdsController(request)
|
|
81
|
-
)
|
|
69
|
+
return request, apicontrollers.getCustomerProfileIdsController
|
|
82
70
|
|
|
83
71
|
|
|
84
72
|
def update_customer_profile(
|
|
85
73
|
profile: apicontractsv1.customerProfileExType,
|
|
86
|
-
) -> ObjectifiedElement
|
|
74
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
87
75
|
"""
|
|
88
76
|
`updateCustomerProfileRequest <https://developer.authorize.net/api/reference/index.html#customer-profiles-update-customer-profile>`_.
|
|
89
77
|
|
|
90
78
|
:param profile: An Authorizenet customer profile ex element.
|
|
91
79
|
:type profile: ~authorizenet.apicontractsv1.customerProfileExType
|
|
92
|
-
:returns:
|
|
93
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
80
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
81
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
94
82
|
|
|
95
83
|
"""
|
|
96
84
|
request = apicontractsv1.updateCustomerProfileRequest()
|
|
97
|
-
request.merchantAuthentication = get_merchant_auth()
|
|
98
85
|
request.profile = profile
|
|
99
|
-
|
|
100
|
-
return execute_controller(
|
|
101
|
-
apicontrollers.updateCustomerProfileController(request)
|
|
102
|
-
)
|
|
86
|
+
return request, apicontrollers.updateCustomerProfileController
|
|
103
87
|
|
|
104
88
|
|
|
105
89
|
def delete_customer_profile(
|
|
106
90
|
customer_profile_id: int,
|
|
107
|
-
) -> ObjectifiedElement
|
|
91
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
108
92
|
"""
|
|
109
93
|
`deleteCustomerProfileRequest <https://developer.authorize.net/api/reference/index.html#customer-profiles-delete-customer-profile>`_.
|
|
110
94
|
|
|
111
95
|
:param customer_profile_id: An Authorizenet customer profile id.
|
|
112
96
|
:type customer_profile_id: int
|
|
113
|
-
:returns:
|
|
114
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
97
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
98
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
115
99
|
|
|
116
100
|
"""
|
|
117
101
|
request = apicontractsv1.deleteCustomerProfileRequest()
|
|
118
|
-
request.merchantAuthentication = get_merchant_auth()
|
|
119
102
|
request.customerProfileId = str(customer_profile_id)
|
|
120
|
-
|
|
121
|
-
return execute_controller(
|
|
122
|
-
apicontrollers.deleteCustomerProfileController(request)
|
|
123
|
-
)
|
|
103
|
+
return request, apicontrollers.deleteCustomerProfileController
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
from authorizenet import apicontractsv1, apicontrollers
|
|
2
|
+
from authorizenet.apicontrollersbase import APIOperationBase
|
|
2
3
|
from lxml.objectify import ObjectifiedElement
|
|
3
4
|
|
|
4
|
-
from terminusgps.authorizenet.auth import
|
|
5
|
-
get_merchant_auth,
|
|
6
|
-
get_validation_mode,
|
|
7
|
-
)
|
|
8
|
-
from terminusgps.authorizenet.controllers import execute_controller
|
|
5
|
+
from terminusgps.authorizenet.auth import get_validation_mode
|
|
9
6
|
|
|
10
7
|
__all__ = [
|
|
11
8
|
"create_customer_payment_profile",
|
|
@@ -20,7 +17,7 @@ def create_customer_payment_profile(
|
|
|
20
17
|
customer_profile_id: int,
|
|
21
18
|
payment_profile: apicontractsv1.customerPaymentProfileType,
|
|
22
19
|
validate: bool = True,
|
|
23
|
-
) -> ObjectifiedElement
|
|
20
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
24
21
|
"""
|
|
25
22
|
`createCustomerPaymentProfileRequest <https://developer.authorize.net/api/reference/index.html#customer-profiles-create-customer-payment-profile>`_.
|
|
26
23
|
|
|
@@ -29,27 +26,23 @@ def create_customer_payment_profile(
|
|
|
29
26
|
:param payment_profile: An Authorizenet payment profile element.
|
|
30
27
|
:type payment_profile: ~authorizenet.apicontractsv1.customerPaymentProfileType
|
|
31
28
|
:param validate: Whether to validate the payment profile. Default is True.
|
|
32
|
-
:returns:
|
|
33
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
29
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
30
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
34
31
|
|
|
35
32
|
"""
|
|
36
33
|
request = apicontractsv1.createCustomerPaymentProfileRequest()
|
|
37
|
-
request.merchantAuthentication = get_merchant_auth()
|
|
38
34
|
request.customerProfileId = str(customer_profile_id)
|
|
39
35
|
request.paymentProfile = payment_profile
|
|
40
36
|
if validate:
|
|
41
37
|
request.validationMode = get_validation_mode()
|
|
42
|
-
|
|
43
|
-
return execute_controller(
|
|
44
|
-
apicontrollers.createCustomerPaymentProfileController(request)
|
|
45
|
-
)
|
|
38
|
+
return request, apicontrollers.createCustomerPaymentProfileController
|
|
46
39
|
|
|
47
40
|
|
|
48
41
|
def get_customer_payment_profile(
|
|
49
42
|
customer_profile_id: int,
|
|
50
43
|
payment_profile_id: int,
|
|
51
44
|
include_issuer_info: bool = False,
|
|
52
|
-
) -> ObjectifiedElement
|
|
45
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
53
46
|
"""
|
|
54
47
|
`getCustomerPaymentProfileRequest <https://developer.authorize.net/api/reference/index.html#customer-profiles-get-customer-payment-profile>`_.
|
|
55
48
|
|
|
@@ -59,24 +52,20 @@ def get_customer_payment_profile(
|
|
|
59
52
|
:type payment_profile_id: int
|
|
60
53
|
:param include_issuer_info: Whether to include issuer info in the response. Default is False.
|
|
61
54
|
:type include_issuer_info: bool
|
|
62
|
-
:returns:
|
|
63
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
55
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
56
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
64
57
|
|
|
65
58
|
"""
|
|
66
59
|
request = apicontractsv1.getCustomerPaymentProfileRequest()
|
|
67
|
-
request.merchantAuthentication = get_merchant_auth()
|
|
68
60
|
request.customerProfileId = str(customer_profile_id)
|
|
69
61
|
request.customerPaymentProfileId = str(payment_profile_id)
|
|
70
62
|
request.includeIssuerInfo = str(include_issuer_info).lower()
|
|
71
|
-
|
|
72
|
-
return execute_controller(
|
|
73
|
-
apicontrollers.getCustomerPaymentProfileController(request)
|
|
74
|
-
)
|
|
63
|
+
return request, apicontrollers.getCustomerPaymentProfileController
|
|
75
64
|
|
|
76
65
|
|
|
77
66
|
def validate_customer_payment_profile(
|
|
78
67
|
customer_profile_id: int, payment_profile_id: int
|
|
79
|
-
) -> ObjectifiedElement
|
|
68
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
80
69
|
"""
|
|
81
70
|
`validateCustomerPaymentProfileRequest <https://developer.authorize.net/api/reference/index.html#customer-profiles-validate-customer-payment-profile>`_.
|
|
82
71
|
|
|
@@ -84,19 +73,15 @@ def validate_customer_payment_profile(
|
|
|
84
73
|
:type customer_profile_id: int
|
|
85
74
|
:param payment_profile_id: An Authorizenet customer payment profile id.
|
|
86
75
|
:type payment_profile_id: int
|
|
87
|
-
:returns:
|
|
88
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
76
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
77
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
89
78
|
|
|
90
79
|
"""
|
|
91
80
|
request = apicontractsv1.validateCustomerPaymentProfileRequest()
|
|
92
|
-
request.merchantAuthentication = get_merchant_auth()
|
|
93
81
|
request.customerProfileId = str(customer_profile_id)
|
|
94
82
|
request.customerPaymentProfileId = str(payment_profile_id)
|
|
95
83
|
request.validationMode = get_validation_mode()
|
|
96
|
-
|
|
97
|
-
return execute_controller(
|
|
98
|
-
apicontrollers.validateCustomerPaymentProfileController(request)
|
|
99
|
-
)
|
|
84
|
+
return request, apicontrollers.validateCustomerPaymentProfileController
|
|
100
85
|
|
|
101
86
|
|
|
102
87
|
def update_customer_payment_profile(
|
|
@@ -104,7 +89,7 @@ def update_customer_payment_profile(
|
|
|
104
89
|
payment_profile_id: int,
|
|
105
90
|
payment_profile: apicontractsv1.customerPaymentProfileType,
|
|
106
91
|
validate: bool = True,
|
|
107
|
-
) -> ObjectifiedElement
|
|
92
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
108
93
|
"""
|
|
109
94
|
`updateCustomerPaymentProfileRequest <https://developer.authorize.net/api/reference/index.html#customer-profiles-update-customer-payment-profile>`_.
|
|
110
95
|
|
|
@@ -116,28 +101,24 @@ def update_customer_payment_profile(
|
|
|
116
101
|
:type payment_profile: ~authorizenet.apicontractsv1.customerPaymentProfileType
|
|
117
102
|
:param validate: Whether to validate the payment profile. Default is True.
|
|
118
103
|
:type validate: bool
|
|
119
|
-
:returns:
|
|
120
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
104
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
105
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
121
106
|
|
|
122
107
|
"""
|
|
123
108
|
if not hasattr(payment_profile, "customerPaymentProfileId"):
|
|
124
109
|
payment_profile.customerPaymentProfileId = str(payment_profile_id)
|
|
125
110
|
|
|
126
111
|
request = apicontractsv1.updateCustomerPaymentProfileRequest()
|
|
127
|
-
request.merchantAuthentication = get_merchant_auth()
|
|
128
112
|
request.customerProfileId = str(customer_profile_id)
|
|
129
113
|
request.paymentProfile = payment_profile
|
|
130
114
|
if validate:
|
|
131
115
|
request.validationMode = get_validation_mode()
|
|
132
|
-
|
|
133
|
-
return execute_controller(
|
|
134
|
-
apicontrollers.updateCustomerPaymentProfileController(request)
|
|
135
|
-
)
|
|
116
|
+
return request, apicontrollers.updateCustomerPaymentProfileController
|
|
136
117
|
|
|
137
118
|
|
|
138
119
|
def delete_customer_payment_profile(
|
|
139
120
|
customer_profile_id: int, payment_profile_id: int
|
|
140
|
-
) -> ObjectifiedElement
|
|
121
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
141
122
|
"""
|
|
142
123
|
`deleteCustomerPaymentProfileRequest <https://developer.authorize.net/api/reference/index.html#customer-profiles-delete-customer-payment-profile>`_.
|
|
143
124
|
|
|
@@ -145,15 +126,11 @@ def delete_customer_payment_profile(
|
|
|
145
126
|
:type customer_profile_id: int
|
|
146
127
|
:param payment_profile_id: An Authorizenet customer payment profile id.
|
|
147
128
|
:type payment_profile_id: int
|
|
148
|
-
:returns:
|
|
149
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
129
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
130
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
150
131
|
|
|
151
132
|
"""
|
|
152
133
|
request = apicontractsv1.deleteCustomerPaymentProfileRequest()
|
|
153
|
-
request.merchantAuthentication = get_merchant_auth()
|
|
154
134
|
request.customerProfileId = str(customer_profile_id)
|
|
155
135
|
request.customerPaymentProfileId = str(payment_profile_id)
|
|
156
|
-
|
|
157
|
-
return execute_controller(
|
|
158
|
-
apicontrollers.deleteCustomerPaymentProfileController(request)
|
|
159
|
-
)
|
|
136
|
+
return request, apicontrollers.deleteCustomerPaymentProfileController
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
from authorizenet import apicontractsv1, apicontrollers
|
|
2
|
+
from authorizenet.apicontrollersbase import APIOperationBase
|
|
2
3
|
from lxml.objectify import ObjectifiedElement
|
|
3
4
|
|
|
4
|
-
from terminusgps.authorizenet.auth import get_merchant_auth
|
|
5
|
-
from terminusgps.authorizenet.controllers import execute_controller
|
|
6
|
-
|
|
7
5
|
__all__ = [
|
|
8
6
|
"create_subscription",
|
|
9
7
|
"get_subscription",
|
|
@@ -15,28 +13,24 @@ __all__ = [
|
|
|
15
13
|
|
|
16
14
|
def create_subscription(
|
|
17
15
|
subscription: apicontractsv1.ARBSubscriptionType,
|
|
18
|
-
) -> ObjectifiedElement
|
|
16
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
19
17
|
"""
|
|
20
18
|
`ARBCreateSubscriptionRequest <https://developer.authorize.net/api/reference/index.html#recurring-billing-create-a-subscription>`_.
|
|
21
19
|
|
|
22
20
|
:param subscription: An Authorizenet ARBSubscriptionType element.
|
|
23
21
|
:type subscription: ~authorizenet.apicontractsv1.ARBSubscriptionType
|
|
24
|
-
:returns:
|
|
25
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
22
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
23
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
26
24
|
|
|
27
25
|
"""
|
|
28
26
|
request = apicontractsv1.ARBCreateSubscriptionRequest()
|
|
29
|
-
request.merchantAuthentication = get_merchant_auth()
|
|
30
27
|
request.subscription = subscription
|
|
31
|
-
|
|
32
|
-
return execute_controller(
|
|
33
|
-
apicontrollers.ARBCreateSubscriptionController(request)
|
|
34
|
-
)
|
|
28
|
+
return request, apicontrollers.ARBCreateSubscriptionController
|
|
35
29
|
|
|
36
30
|
|
|
37
31
|
def get_subscription(
|
|
38
32
|
subscription_id: int, include_transactions: bool = True
|
|
39
|
-
) -> ObjectifiedElement
|
|
33
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
40
34
|
"""
|
|
41
35
|
`ARBGetSubscriptionRequest <https://developer.authorize.net/api/reference/index.html#recurring-billing-get-subscription>`_.
|
|
42
36
|
|
|
@@ -44,42 +38,36 @@ def get_subscription(
|
|
|
44
38
|
:type subscription_id: int
|
|
45
39
|
:param include_transactions: Whether to include the subscription transaction list in the response. Default is True.
|
|
46
40
|
:type include_transactions: bool
|
|
47
|
-
:returns:
|
|
48
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
41
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
42
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
49
43
|
|
|
50
44
|
"""
|
|
51
45
|
request = apicontractsv1.ARBGetSubscriptionRequest()
|
|
52
|
-
request.merchantAuthentication = get_merchant_auth()
|
|
53
46
|
request.subscriptionId = str(subscription_id)
|
|
54
47
|
request.includeTransactions = str(include_transactions).lower()
|
|
55
|
-
|
|
56
|
-
return execute_controller(
|
|
57
|
-
apicontrollers.ARBGetSubscriptionController(request)
|
|
58
|
-
)
|
|
48
|
+
return request, apicontrollers.ARBGetSubscriptionController
|
|
59
49
|
|
|
60
50
|
|
|
61
|
-
def get_subscription_status(
|
|
51
|
+
def get_subscription_status(
|
|
52
|
+
subscription_id: int,
|
|
53
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
62
54
|
"""
|
|
63
55
|
`ARBGetSubscriptionStatusRequest <https://developer.authorize.net/api/reference/index.html#recurring-billing-get-subscription-status>`_.
|
|
64
56
|
|
|
65
57
|
:param subscription_id: An Authorizenet subscription id.
|
|
66
58
|
:type subscription_id: int
|
|
67
|
-
:returns:
|
|
68
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
59
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
60
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
69
61
|
|
|
70
62
|
"""
|
|
71
63
|
request = apicontractsv1.ARBGetSubscriptionStatusRequest()
|
|
72
|
-
request.merchantAuthentication = get_merchant_auth()
|
|
73
64
|
request.subscriptionId = str(subscription_id)
|
|
74
|
-
|
|
75
|
-
return execute_controller(
|
|
76
|
-
apicontrollers.ARBGetSubscriptionStatusController(request)
|
|
77
|
-
)
|
|
65
|
+
return request, apicontrollers.ARBGetSubscriptionStatusController
|
|
78
66
|
|
|
79
67
|
|
|
80
68
|
def update_subscription(
|
|
81
69
|
subscription_id: int, subscription: apicontractsv1.ARBSubscriptionType
|
|
82
|
-
) -> ObjectifiedElement
|
|
70
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
83
71
|
"""
|
|
84
72
|
`ARBUpdateSubscriptionRequest <https://developer.authorize.net/api/reference/index.html#recurring-billing-update-a-subscription>`_.
|
|
85
73
|
|
|
@@ -87,34 +75,28 @@ def update_subscription(
|
|
|
87
75
|
:type subscription_id: int
|
|
88
76
|
:param subscription: An Authorizenet ARBSubscriptionType element.
|
|
89
77
|
:type subscription: ~authorizenet.apicontractsv1.ARBSubscriptionType
|
|
90
|
-
:returns:
|
|
91
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
78
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
79
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
92
80
|
|
|
93
81
|
"""
|
|
94
82
|
request = apicontractsv1.ARBUpdateSubscriptionRequest()
|
|
95
|
-
request.merchantAuthentication = get_merchant_auth()
|
|
96
83
|
request.subscriptionId = str(subscription_id)
|
|
97
84
|
request.subscription = subscription
|
|
98
|
-
|
|
99
|
-
return execute_controller(
|
|
100
|
-
apicontrollers.ARBUpdateSubscriptionController(request)
|
|
101
|
-
)
|
|
85
|
+
return request, apicontrollers.ARBUpdateSubscriptionController
|
|
102
86
|
|
|
103
87
|
|
|
104
|
-
def cancel_subscription(
|
|
88
|
+
def cancel_subscription(
|
|
89
|
+
subscription_id: int,
|
|
90
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
105
91
|
"""
|
|
106
92
|
`ARBCancelSubscriptionRequest <https://developer.authorize.net/api/reference/index.html#recurring-billing-cancel-a-subscription>`_.
|
|
107
93
|
|
|
108
94
|
:param subscription_id: An Authorizenet subscription id.
|
|
109
95
|
:type subscription_id: int
|
|
110
|
-
:returns:
|
|
111
|
-
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
96
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
97
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
112
98
|
|
|
113
99
|
"""
|
|
114
100
|
request = apicontractsv1.ARBCancelSubscriptionRequest()
|
|
115
|
-
request.merchantAuthentication = get_merchant_auth()
|
|
116
101
|
request.subscriptionId = str(subscription_id)
|
|
117
|
-
|
|
118
|
-
return execute_controller(
|
|
119
|
-
apicontrollers.ARBCancelSubscriptionController(request)
|
|
120
|
-
)
|
|
102
|
+
return request, apicontrollers.ARBCancelSubscriptionController
|