python-terminusgps 36.2.0__py3-none-any.whl → 36.3.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-terminusgps
3
- Version: 36.2.0
3
+ Version: 36.3.1
4
4
  Summary: Provides abstractions/utilities for working with Wialon API, Authorize.NET API, AWS API, and more.
5
5
  Project-URL: Documentation, https://docs.terminusgps.com
6
6
  Project-URL: Repository, https://github.com/terminusgps/python-terminusgps
@@ -7,7 +7,7 @@ terminusgps/authorizenet/utils.py,sha256=FrKqXWrplcgiET1rDTmUaqmN_ze7j93jWgfFeJR
7
7
  terminusgps/authorizenet/profiles/__init__.py,sha256=IG4XCEEYtHKqXOatlZlob6J3ukAgF7cFR-RXxOSMS1c,161
8
8
  terminusgps/authorizenet/profiles/addresses.py,sha256=5GudJStBa4P0Hd7G_hRFH2C-WpICAH_k3MT9YJkicKw,6305
9
9
  terminusgps/authorizenet/profiles/base.py,sha256=Pu1NGrvC5Ox2W1oZuVcPqUw3aUoSK191Evexw1U6_3k,3940
10
- terminusgps/authorizenet/profiles/customers.py,sha256=CAinLbFOixvhcUWCYu1pbZDElhyvtX93oBQkoeQaixM,12723
10
+ terminusgps/authorizenet/profiles/customers.py,sha256=mKPHSFoDqJqHL1CvTximNVRb1myRwQ9NvMkA2-iswOg,11701
11
11
  terminusgps/authorizenet/profiles/payments.py,sha256=nhudGuJ6RzmK0MrhDVuYL2BxvyzKNpliBIfIpFU5Y-4,11038
12
12
  terminusgps/authorizenet/profiles/subscriptions.py,sha256=m_jb9GqeD1tLmeqSnaGwJrzPcQOulEkF8K1wCaqKR24,7924
13
13
  terminusgps/authorizenet/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -52,7 +52,7 @@ terminusgps/wialon/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
52
52
  terminusgps/wialon/tests/test_items.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
53
  terminusgps/wialon/tests/test_session.py,sha256=9mBlYchMo9NeqRIZsmxYzrM1zBHorqu4ooxqSNppLpI,1336
54
54
  terminusgps/wialon/tests/test_utils.py,sha256=SK4PxJQGECFnzx_EQeRAQfsQ5_3FLaVcis2W9u_ibuI,1730
55
- python_terminusgps-36.2.0.dist-info/METADATA,sha256=JEx5k-8-huypQryiLolU4amgRqUztsNP-RsnYiFZtwM,1616
56
- python_terminusgps-36.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
57
- python_terminusgps-36.2.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
58
- python_terminusgps-36.2.0.dist-info/RECORD,,
55
+ python_terminusgps-36.3.1.dist-info/METADATA,sha256=nT2MtI0nkBDU3LxZHkQ4WjAxpq_0q0bEEFe3gP4s3Cs,1616
56
+ python_terminusgps-36.3.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
57
+ python_terminusgps-36.3.1.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
58
+ python_terminusgps-36.3.1.dist-info/RECORD,,
@@ -11,129 +11,118 @@ class CustomerProfile(AuthorizenetProfileBase):
11
11
  def __init__(
12
12
  self,
13
13
  id: int | str | None = None,
14
- merchant_id: int | str | None = None,
14
+ merchant_id: str | None = None,
15
15
  email: str | None = None,
16
16
  desc: str | None = None,
17
17
  ) -> None:
18
18
  """
19
- Sets :py:attr:`merchantCustomerId`, :py:attr:`email` and :py:attr:`desc`.
19
+ Sets :py:attr:`merchant_id`, :py:attr:`email` and :py:attr:`desc`.
20
20
 
21
21
  :returns: Nothing.
22
22
  :rtype: :py:obj:`None`
23
23
 
24
24
  """
25
25
  super().__init__(id=id)
26
- self._merchantCustomerId = str(merchant_id) if merchant_id else None
26
+ self._merchant_id = merchant_id
27
27
  self._email = email
28
28
  self._desc = desc
29
29
 
30
- if not self.id and self.merchantCustomerId or self.email:
30
+ if not self.id:
31
31
  try:
32
- response = self._authorizenet_get_customer_profile(issuer_info=False)
33
- self.id = response.profile.customerProfileId
32
+ response = self._authorizenet_get_customer_profile()
33
+ self.id = int(response.profile.customerProfileId)
34
34
  except AuthorizenetControllerExecutionError:
35
35
  self.id = self.create()
36
36
 
37
37
  @property
38
- def validationMode(self) -> str:
38
+ def merchant_id(self) -> str:
39
39
  """
40
- The current Authorizenet validation mode.
40
+ A merchant designated id.
41
41
 
42
42
  :type: :py:obj:`str`
43
43
 
44
44
  """
45
- return get_validation_mode()
46
-
47
- @property
48
- def merchantCustomerId(self) -> str | None:
49
- """
50
- A merchant designated customer id.
51
-
52
- :type: :py:obj:`str` | :py:obj:`None`
53
-
54
- """
55
- if self.id and not self._merchantCustomerId:
56
- response = self._authorizenet_get_customer_profile(issuer_info=False)
57
- self._merchantCustomerId: str | None = (
58
- str(response.profile.merchantCustomerId)
45
+ if self.id and not self._merchant_id:
46
+ response = self._authorizenet_get_customer_profile()
47
+ self._merchant_id = (
48
+ response.profile.merchantCustomerId
59
49
  if response is not None
60
50
  and hasattr(response.profile, "merchantCustomerId")
61
51
  else None
62
52
  )
63
- return self._merchantCustomerId
53
+ return str(self._merchant_id)
64
54
 
65
- @merchantCustomerId.setter
66
- def merchantCustomerId(self, other: int | str | None) -> None:
67
- """Sets :py:attr:`merchantCustomerId` to ``other``."""
68
- updated: bool = other is not None and str(other) != str(
69
- self._merchantCustomerId
70
- )
71
- self._merchantCustomerId = str(other) if other else None
72
- if updated and self.id is not None:
73
- self._authorizenet_update_customer_profile()
55
+ @merchant_id.setter
56
+ def merchant_id(self, other: str | int) -> None:
57
+ self._merchant_id = other
58
+ self._authorizenet_update_customer_profile()
74
59
 
75
60
  @property
76
- def email(self) -> str | None:
61
+ def email(self) -> str:
77
62
  """
78
63
  A customer email address.
79
64
 
80
- :type: :py:obj:`str` | :py:obj:`None`
65
+ :type: :py:obj:`str`
81
66
 
82
67
  """
83
- if self.id and self._email is None:
84
- response = self._authorizenet_get_customer_profile(issuer_info=False)
85
- self._email: str | None = (
86
- str(response.profile.email)
68
+ if self.id and not self._email:
69
+ response = self._authorizenet_get_customer_profile()
70
+ self._email = (
71
+ response.profile.email
87
72
  if response is not None and hasattr(response.profile, "email")
88
73
  else None
89
74
  )
90
- return self._email
75
+ return str(self._email)
91
76
 
92
77
  @email.setter
93
- def email(self, other: str | None) -> None:
94
- """Sets :py:attr:`email` to ``other``."""
95
- updated: bool = other is not None and other != self.email
78
+ def email(self, other: str) -> None:
96
79
  self._email = other
97
- if updated and self.id is not None:
98
- self._authorizenet_update_customer_profile()
80
+ self._authorizenet_update_customer_profile()
99
81
 
100
82
  @property
101
- def desc(self) -> str | None:
83
+ def desc(self) -> str:
102
84
  """
103
- A customer description.
85
+ A customer profile description.
104
86
 
105
- :type: :py:obj:`str` | :py:obj:`None`
87
+ :type: :py:obj:`str`
106
88
 
107
89
  """
108
- if self.id and self._desc is None:
109
- response = self._authorizenet_get_customer_profile(issuer_info=False)
110
- self._desc: str | None = (
111
- str(response.profile.description)
90
+ if self.id and not self._desc:
91
+ response = self._authorizenet_get_customer_profile()
92
+ self._desc = (
93
+ response.profile.description
112
94
  if response is not None and hasattr(response.profile, "description")
113
95
  else None
114
96
  )
115
- return self._desc
97
+ return str(self._desc)
116
98
 
117
99
  @desc.setter
118
- def desc(self, other: str | None) -> None:
119
- """Sets :py:attr:`desc` to ``other``."""
120
- updated: bool = other is not None and other != self.desc
100
+ def desc(self, other: str) -> None:
121
101
  self._desc = other
122
- if updated and self.id is not None:
123
- self._authorizenet_update_customer_profile()
102
+ self._authorizenet_update_customer_profile()
103
+
104
+ @property
105
+ def validationMode(self) -> str:
106
+ """
107
+ The current Authorizenet validation mode.
108
+
109
+ :type: :py:obj:`str`
110
+
111
+ """
112
+ return get_validation_mode()
124
113
 
125
114
  def create(self) -> int:
126
115
  """
127
116
  Creates the customer profile in Authorizenet.
128
117
 
129
- :raises AssertionError: If neither :py:attr:`merchantCustomerId` nor :py:attr:`email` were set.
118
+ :raises AssertionError: If neither :py:attr:`merchant_id` nor :py:attr:`email` were set.
130
119
  :raises AuthorizenetControllerExecutionError: If something goes wrong during an Authorizenet API call.
131
120
  :returns: An id for the new customer profile.
132
121
  :rtype: :py:obj:`int`
133
122
 
134
123
  """
135
- assert self.merchantCustomerId or self.email, (
136
- "Neither 'merchantCustomerId' nor 'email' were set."
124
+ assert self.merchant_id or self.email, (
125
+ "Neither 'merchant_id' nor 'email' were set."
137
126
  )
138
127
  return int(self._authorizenet_create_customer_profile().customerProfileId)
139
128
 
@@ -199,18 +188,18 @@ class CustomerProfile(AuthorizenetProfileBase):
199
188
  :rtype: :py:obj:`~authorizenet.apicontractsv1.customerProfileExType`
200
189
 
201
190
  """
202
- cprofile = apicontractsv1.customerProfileExType()
191
+ cprofile_obj = apicontractsv1.customerProfileExType()
203
192
 
204
- if self.id is not None:
205
- cprofile.customerProfileId = self.id
206
- if self.merchantCustomerId is not None:
207
- cprofile.merchantCustomerId = self.merchantCustomerId
208
- if self.email is not None:
209
- cprofile.email = self.email
210
- if self.desc is not None:
211
- cprofile.description = self.desc
193
+ if self.id:
194
+ cprofile_obj.customerProfileId = self.id
195
+ if self.merchant_id:
196
+ cprofile_obj.merchantCustomerId = self.merchant_id
197
+ if self.email:
198
+ cprofile_obj.email = self.email
199
+ if self.desc:
200
+ cprofile_obj.description = self.desc
212
201
 
213
- return cprofile
202
+ return cprofile_obj
214
203
 
215
204
  def _generate_customer_profile_type(self) -> apicontractsv1.customerProfileType:
216
205
  """
@@ -220,16 +209,16 @@ class CustomerProfile(AuthorizenetProfileBase):
220
209
  :rtype: :py:obj:`~authorizenet.apicontractsv1.customerProfileType`
221
210
 
222
211
  """
223
- cprofile = apicontractsv1.customerProfileType()
212
+ cprofile_obj = apicontractsv1.customerProfileType()
224
213
 
225
- if self.merchantCustomerId is not None:
226
- cprofile.merchantCustomerId = self.merchantCustomerId
227
- if self.email is not None:
228
- cprofile.email = self.email
229
- if self.desc is not None:
230
- cprofile.description = self.desc
214
+ if self._merchant_id:
215
+ cprofile_obj.merchantCustomerId = self._merchant_id
216
+ if self._email:
217
+ cprofile_obj.email = self._email
218
+ if self._desc:
219
+ cprofile_obj.description = self._desc
231
220
 
232
- return cprofile
221
+ return cprofile_obj
233
222
 
234
223
  def _authorizenet_get_customer_profile(
235
224
  self, issuer_info: bool = True
@@ -253,10 +242,10 @@ class CustomerProfile(AuthorizenetProfileBase):
253
242
 
254
243
  if self.id:
255
244
  request.customerProfileId = self.id
256
- if self.merchantCustomerId:
257
- request.merchantCustomerId = self.merchantCustomerId
258
- if self.email:
259
- request.email = self.email
245
+ if self._merchant_id:
246
+ request.merchantCustomerId = self._merchant_id
247
+ if self._email:
248
+ request.email = self._email
260
249
 
261
250
  controller = apicontrollers.getCustomerProfileController(request)
262
251
  return self.execute_controller(controller)
@@ -277,8 +266,8 @@ class CustomerProfile(AuthorizenetProfileBase):
277
266
  :rtype: :py:obj:`dict` | :py:obj:`None`
278
267
 
279
268
  """
280
- assert self.merchantCustomerId or self.email, (
281
- "Neither 'merchantCustomerId' nor 'email' were set."
269
+ assert self.merchant_id or self.email, (
270
+ "Neither 'merchant_id' nor 'email' were set."
282
271
  )
283
272
 
284
273
  request = apicontractsv1.createCustomerProfileRequest(