python-terminusgps 36.4.4__py3-none-any.whl → 36.6.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.
Potentially problematic release.
This version of python-terminusgps might be problematic. Click here for more details.
- {python_terminusgps-36.4.4.dist-info → python_terminusgps-36.6.0.dist-info}/METADATA +2 -10
- {python_terminusgps-36.4.4.dist-info → python_terminusgps-36.6.0.dist-info}/RECORD +8 -8
- terminusgps/authorizenet/profiles/subscriptions.py +24 -0
- terminusgps/authorizenet/tests/test_profiles.py +1 -3
- terminusgps/authorizenet/utils.py +20 -0
- terminusgps/wialon/items/resource.py +22 -1
- {python_terminusgps-36.4.4.dist-info → python_terminusgps-36.6.0.dist-info}/WHEEL +0 -0
- {python_terminusgps-36.4.4.dist-info → python_terminusgps-36.6.0.dist-info}/licenses/COPYING +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-terminusgps
|
|
3
|
-
Version: 36.
|
|
3
|
+
Version: 36.6.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://docs.terminusgps.com
|
|
6
6
|
Project-URL: Repository, https://github.com/terminusgps/python-terminusgps
|
|
@@ -27,14 +27,6 @@ Description-Content-Type: text/markdown
|
|
|
27
27
|
|
|
28
28
|
# python-terminusgps
|
|
29
29
|
|
|
30
|
-
*python-terminusgps*
|
|
30
|
+
*python-terminusgps* adds libraries for working with web APIs used by [Terminus GPS](https://terminusgps.com/) developers.
|
|
31
31
|
|
|
32
32
|
[Documentation](https://docs.terminusgps.com/)
|
|
33
|
-
|
|
34
|
-
Currently, the following services are streamlined for web development:
|
|
35
|
-
|
|
36
|
-
* [AWS/boto3](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html)
|
|
37
|
-
* [Authorizenet API](https://developer.authorize.net/api/reference/index.html)
|
|
38
|
-
* [Twilio API](https://www.twilio.com/docs)
|
|
39
|
-
* [Wialon Remote API](https://sdk.wialon.com/wiki/en/sidebar/remoteapi/apiref/apiref)
|
|
40
|
-
|
|
@@ -3,16 +3,16 @@ terminusgps/authorizenet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
|
|
|
3
3
|
terminusgps/authorizenet/auth.py,sha256=g2tJPxP9V1nXnUcKzhHSRSs6ruSIHej5_hcf8P7bod8,1262
|
|
4
4
|
terminusgps/authorizenet/constants.py,sha256=xmulPmiBLhFfZoc7Il3l-DZA9Nq5HSaJmJKU-v-5X-Y,420
|
|
5
5
|
terminusgps/authorizenet/controllers.py,sha256=9t62qdGpmAkP4tNyPefd7vBRutXvMWsxql6z_pg52Bg,2146
|
|
6
|
-
terminusgps/authorizenet/utils.py,sha256=
|
|
6
|
+
terminusgps/authorizenet/utils.py,sha256=6VKHjpZ071FKtjJI-vKuQ7YyaL4cLMYW11KcLzqJv2Q,8285
|
|
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
10
|
terminusgps/authorizenet/profiles/customers.py,sha256=mKPHSFoDqJqHL1CvTximNVRb1myRwQ9NvMkA2-iswOg,11701
|
|
11
11
|
terminusgps/authorizenet/profiles/payments.py,sha256=nhudGuJ6RzmK0MrhDVuYL2BxvyzKNpliBIfIpFU5Y-4,11038
|
|
12
|
-
terminusgps/authorizenet/profiles/subscriptions.py,sha256=
|
|
12
|
+
terminusgps/authorizenet/profiles/subscriptions.py,sha256=g3htRNqCUFvefEYAueQb8Vkd7oQ-vJySV_zenG05tV8,9239
|
|
13
13
|
terminusgps/authorizenet/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
terminusgps/authorizenet/tests/test_auth.py,sha256=sdByYrcv8RKjcJckOHbyHH1z_M4qrATFI3qj_XDQXbk,1624
|
|
15
|
-
terminusgps/authorizenet/tests/test_profiles.py,sha256=
|
|
15
|
+
terminusgps/authorizenet/tests/test_profiles.py,sha256=MkpMSU9cgSeLy9bBuZdhdFiPxFT5858u9C8BqAmRhGY,7537
|
|
16
16
|
terminusgps/authorizenet/tests/test_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
terminusgps/aws/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
18
18
|
terminusgps/aws/notifications.py,sha256=76YnACuVIMs5EujEATqcBf8HcCFxs2649fnLx9nSauc,11103
|
|
@@ -42,7 +42,7 @@ terminusgps/wialon/utils.py,sha256=iGOY8v7cNaSoA9Mo17d1bKAQMBtcotGq3FEQrghgvCo,1
|
|
|
42
42
|
terminusgps/wialon/validators.py,sha256=j5vrtcfClAzRdRkWTvRRAmrne1t0R6cKkmYdE7fAkSs,4247
|
|
43
43
|
terminusgps/wialon/items/__init__.py,sha256=3BVthghekMvhMQSzQgBMlD_phxmKSmp3Zvmo-z0O8Bs,211
|
|
44
44
|
terminusgps/wialon/items/base.py,sha256=ZhndkcVWTOjsEKe5L0NQsLvvXj2Fs0Xv-qBjjm1Xmpk,10421
|
|
45
|
-
terminusgps/wialon/items/resource.py,sha256=
|
|
45
|
+
terminusgps/wialon/items/resource.py,sha256=YunkG3mWcEjRGTPBLBr_HxLVOXpKau1Yn2Q4D6FMmR4,17693
|
|
46
46
|
terminusgps/wialon/items/retranslator.py,sha256=sVEWrp8q1I-tO_rMTCH7TeQDDbZryIq8d9KVnhYyhH0,3795
|
|
47
47
|
terminusgps/wialon/items/route.py,sha256=amNPKZqgl8pEzKA_XJudnvBPzEsfHTmrC7uF15sZVI4,1216
|
|
48
48
|
terminusgps/wialon/items/unit.py,sha256=G72CSpu5pcilGjXQDz8yTZ-xwWXm1rCYZUkG98lY-8w,10504
|
|
@@ -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.
|
|
56
|
-
python_terminusgps-36.
|
|
57
|
-
python_terminusgps-36.
|
|
58
|
-
python_terminusgps-36.
|
|
55
|
+
python_terminusgps-36.6.0.dist-info/METADATA,sha256=svjsxSh2yVspXS_l0D3Y0t2OIG3wcps56raHeoD_yCM,1264
|
|
56
|
+
python_terminusgps-36.6.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
57
|
+
python_terminusgps-36.6.0.dist-info/licenses/COPYING,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
58
|
+
python_terminusgps-36.6.0.dist-info/RECORD,,
|
|
@@ -61,6 +61,30 @@ class SubscriptionProfile(AuthorizenetSubProfileBase):
|
|
|
61
61
|
).subscription
|
|
62
62
|
return [t.arbTransaction for t in sub.arbTransactions]
|
|
63
63
|
|
|
64
|
+
@property
|
|
65
|
+
def address_id(self) -> int | None:
|
|
66
|
+
"""
|
|
67
|
+
Returns the address id for the subscription profile.
|
|
68
|
+
|
|
69
|
+
:type: :py:obj:`int` | :py:obj:`None`
|
|
70
|
+
|
|
71
|
+
"""
|
|
72
|
+
if self.id:
|
|
73
|
+
sub = self._authorizenet_get_subscription().subscription
|
|
74
|
+
return int(sub.profile.shippingProfile.customerAddressId)
|
|
75
|
+
|
|
76
|
+
@property
|
|
77
|
+
def payment_id(self) -> int | None:
|
|
78
|
+
"""
|
|
79
|
+
Returns the payment id for the subscription profile.
|
|
80
|
+
|
|
81
|
+
:type: :py:obj:`int` | :py:obj:`None`
|
|
82
|
+
|
|
83
|
+
"""
|
|
84
|
+
if self.id:
|
|
85
|
+
sub = self._authorizenet_get_subscription().subscription
|
|
86
|
+
return int(sub.profile.paymentProfile.customerPaymentProfileId)
|
|
87
|
+
|
|
64
88
|
def create(self, subscription: apicontractsv1.ARBSubscriptionType) -> int:
|
|
65
89
|
"""
|
|
66
90
|
Creates a subscription in Authorizenet.
|
|
@@ -29,9 +29,7 @@ class CustomerProfileTestCase(TestCase):
|
|
|
29
29
|
"""Fails if :py:attr:`email`, :py:attr:`desc` or :py:attr:`merchantCustomerId` weren't set properly."""
|
|
30
30
|
self.assertTrue(self.test_customer_profile.email == self.test_email)
|
|
31
31
|
self.assertTrue(self.test_customer_profile.desc == self.test_desc)
|
|
32
|
-
self.assertTrue(
|
|
33
|
-
self.test_customer_profile.merchantCustomerId == self.test_merchant_id
|
|
34
|
-
)
|
|
32
|
+
self.assertTrue(self.test_customer_profile.merchant_id == self.test_merchant_id)
|
|
35
33
|
|
|
36
34
|
def test_customer_profile_generate_customer_profile_type(self) -> None:
|
|
37
35
|
"""Fails if :py:meth:`_generate_customer_profile_type` returns an object of the wrong type."""
|
|
@@ -124,6 +124,18 @@ def generate_customer_address(form: forms.Form) -> apicontractsv1.customerAddres
|
|
|
124
124
|
"""
|
|
125
125
|
Takes a form and returns a :py:obj:`~authorizenet.apicontractsv1.customerAddressType`.
|
|
126
126
|
|
|
127
|
+
Required form fields:
|
|
128
|
+
|
|
129
|
+
+----------------+------------------------------------------------------------+
|
|
130
|
+
| name | type |
|
|
131
|
+
+================+============================================================+
|
|
132
|
+
| ``address`` | :py:obj:`~authorizenet.apicontractsv1.customerAddressType` |
|
|
133
|
+
+----------------+------------------------------------------------------------+
|
|
134
|
+
| ``first_name`` | :py:obj:`str` |
|
|
135
|
+
+----------------+------------------------------------------------------------+
|
|
136
|
+
| ``last_name`` | :py:obj:`str` |
|
|
137
|
+
+----------------+------------------------------------------------------------+
|
|
138
|
+
|
|
127
139
|
:param form: A Django form.
|
|
128
140
|
:type form: :py:obj:`~django.forms.Form`
|
|
129
141
|
:raises ValueError: If ``address`` wasn't in the form.
|
|
@@ -152,6 +164,14 @@ def generate_customer_payment(form: forms.Form) -> apicontractsv1.paymentType:
|
|
|
152
164
|
"""
|
|
153
165
|
Takes a form and returns a :py:obj:`~authorizenet.apicontractsv1.paymentType`.
|
|
154
166
|
|
|
167
|
+
Required form fields:
|
|
168
|
+
|
|
169
|
+
+-----------------+-------------------------------------------------------+
|
|
170
|
+
| name | type |
|
|
171
|
+
+=================+=======================================================+
|
|
172
|
+
| ``credit_card`` | :py:obj:`~authorizenet.apicontractsv1.creditCardType` |
|
|
173
|
+
+-----------------+-------------------------------------------------------+
|
|
174
|
+
|
|
155
175
|
:param form: A Django form.
|
|
156
176
|
:type form: :py:obj:`~django.forms.Form`
|
|
157
177
|
:raises ValueError: If ``credit_card`` wasn't in the form.
|
|
@@ -85,6 +85,20 @@ class WialonResource(WialonBase):
|
|
|
85
85
|
)
|
|
86
86
|
return int(response.get("item", {}).get("bact")) == self.id
|
|
87
87
|
|
|
88
|
+
@property
|
|
89
|
+
def creator_id(self) -> int | None:
|
|
90
|
+
"""
|
|
91
|
+
The account user id, if the resource is an account.
|
|
92
|
+
|
|
93
|
+
:type: :py:obj:`int` | :py:obj:`None`
|
|
94
|
+
|
|
95
|
+
"""
|
|
96
|
+
if self.is_account:
|
|
97
|
+
response = self.session.wialon_api.core_search_item(
|
|
98
|
+
**{"id": self.id, "flags": flags.DataFlag.RESOURCE_BILLING_PROPERTIES}
|
|
99
|
+
)
|
|
100
|
+
return int(response.get("item", {}).get("crt"))
|
|
101
|
+
|
|
88
102
|
def create_geofence(
|
|
89
103
|
self,
|
|
90
104
|
name: str,
|
|
@@ -201,6 +215,13 @@ class WialonResource(WialonBase):
|
|
|
201
215
|
|
|
202
216
|
"""
|
|
203
217
|
assert self.is_account, "The resource is not an account"
|
|
218
|
+
self.session.wialon_api.user_update_item_access(
|
|
219
|
+
**{
|
|
220
|
+
"userId": self.creator_id,
|
|
221
|
+
"itemId": unit.id,
|
|
222
|
+
"accessMask": constants.ACCESSMASK_UNIT_MIGRATION,
|
|
223
|
+
}
|
|
224
|
+
)
|
|
204
225
|
self.session.wialon_api.account_change_account(
|
|
205
226
|
**{"itemId": unit.id, "resourceId": self.id}
|
|
206
227
|
)
|
|
@@ -371,7 +392,7 @@ class WialonResource(WialonBase):
|
|
|
371
392
|
:type code: :py:obj:`str`
|
|
372
393
|
:param desc: Description for the driver.
|
|
373
394
|
:type desc: :py:obj:`str`
|
|
374
|
-
:param phone: A phone number
|
|
395
|
+
:param phone: A phone number in `E.164 <https://en.wikipedia.org/wiki/E.164>`_ format.
|
|
375
396
|
:type phone: :py:obj:`str`
|
|
376
397
|
:param mobile_auth_code: Authentication code for Wialon mobile app.
|
|
377
398
|
:type mobile_auth_code: :py:obj:`str`
|
|
File without changes
|
{python_terminusgps-36.4.4.dist-info → python_terminusgps-36.6.0.dist-info}/licenses/COPYING
RENAMED
|
File without changes
|