python-terminusgps 1.13.6__tar.gz → 1.14.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.

Potentially problematic release.


This version of python-terminusgps might be problematic. Click here for more details.

Files changed (36) hide show
  1. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/PKG-INFO +1 -1
  2. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/pyproject.toml +1 -1
  3. python_terminusgps-1.14.0/terminusgps/authorizenet/subscriptions.py +61 -0
  4. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/uv.lock +1 -1
  5. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/.gitignore +0 -0
  6. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/COPYING +0 -0
  7. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/README.md +0 -0
  8. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/__init__.py +0 -0
  9. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/authorizenet/__init__.py +0 -0
  10. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/authorizenet/auth.py +0 -0
  11. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/authorizenet/profiles/__init__.py +0 -0
  12. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/authorizenet/profiles/addresses.py +0 -0
  13. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/authorizenet/profiles/base.py +0 -0
  14. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/authorizenet/profiles/customers.py +0 -0
  15. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/authorizenet/profiles/payments.py +0 -0
  16. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/aws/__init__.py +0 -0
  17. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/aws/secrets.py +0 -0
  18. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/aws/ses.py +0 -0
  19. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/settings.py +0 -0
  20. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/twilio/__init__.py +0 -0
  21. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/twilio/caller.py +0 -0
  22. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/wialon/__init__.py +0 -0
  23. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/wialon/constants.py +0 -0
  24. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/wialon/errors.py +0 -0
  25. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/wialon/flags.py +0 -0
  26. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/wialon/items/__init__.py +0 -0
  27. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/wialon/items/base.py +0 -0
  28. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/wialon/items/notification.py +0 -0
  29. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/wialon/items/resource.py +0 -0
  30. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/wialon/items/retranslator.py +0 -0
  31. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/wialon/items/route.py +0 -0
  32. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/wialon/items/unit.py +0 -0
  33. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/wialon/items/unit_group.py +0 -0
  34. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/wialon/items/user.py +0 -0
  35. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/wialon/session.py +0 -0
  36. {python_terminusgps-1.13.6 → python_terminusgps-1.14.0}/terminusgps/wialon/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-terminusgps
3
- Version: 1.13.6
3
+ Version: 1.14.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://app.terminusgps.com/docs/apps/python-terminusgps/index.html
6
6
  Project-URL: Repository, https://github.com/terminusgps/python-terminusgps
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-terminusgps"
3
- version = "1.13.6"
3
+ version = "1.14.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" } ]
@@ -0,0 +1,61 @@
1
+ from authorizenet import apicontractsv1, apicontrollers, apicontrollersbase
2
+ from terminusgps.authorizenet.auth import get_merchant_auth, get_environment
3
+
4
+
5
+ class Subscription:
6
+ def __init__(self, name: str, id: str | int | None = None, **kwargs) -> None:
7
+ if id is not None and isinstance(id, str) and not id.isdigit():
8
+ raise ValueError(f"'id' must be a digit, got '{id}'.")
9
+ self.name = name
10
+ self.id = str(id if id else self.create(**kwargs))
11
+
12
+ @property
13
+ def merchantAuthentication(self) -> apicontractsv1.merchantAuthenticationType:
14
+ return get_merchant_auth()
15
+
16
+ @property
17
+ def environment(self) -> str:
18
+ return get_environment()
19
+
20
+ def execute_controller(
21
+ self, controller: apicontrollersbase.APIOperationBase
22
+ ) -> dict:
23
+ """
24
+ Executes an Authorize.NET controller and returns its response.
25
+
26
+ :param controller: An Authorize.NET API controller.
27
+ :raises ValueError: If the API call fails.
28
+ :returns: The Authorize.NET API response.
29
+ :rtype: :py:obj:`dict`
30
+
31
+ """
32
+ controller.setenvironment(self.environment)
33
+ controller.execute()
34
+ response = controller.getresponse()
35
+
36
+ if response.messages.resultCode != "Ok":
37
+ raise ValueError(response.messages.message[0]["text"].text)
38
+ return response
39
+
40
+ def create(
41
+ self,
42
+ schedule: apicontractsv1.paymentScheduleType,
43
+ amount: str,
44
+ payment: apicontractsv1.paymentType,
45
+ address: apicontractsv1.customerAddressType,
46
+ trial_amount: str = "0.00",
47
+ ) -> int:
48
+ request = apicontractsv1.ARBCreateSubscriptionRequest(
49
+ merchantAuthentication=self.merchantAuthentication,
50
+ subscription=apicontractsv1.ARBSubscriptionType(
51
+ name=self.name,
52
+ paymentSchedule=schedule,
53
+ amount=amount,
54
+ trialAmount=trial_amount,
55
+ payment=payment,
56
+ bill_to=address,
57
+ ),
58
+ )
59
+ controller = apicontrollers.ARBCreateSubscriptionController(request)
60
+ response = self.execute_controller(controller)
61
+ return int(response.subscriptionId)
@@ -504,7 +504,7 @@ wheels = [
504
504
 
505
505
  [[package]]
506
506
  name = "python-terminusgps"
507
- version = "1.13.6"
507
+ version = "1.14.0"
508
508
  source = { editable = "." }
509
509
  dependencies = [
510
510
  { name = "argparse" },