python-terminusgps 53.0.0__tar.gz → 54.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.
Files changed (50) hide show
  1. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/PKG-INFO +1 -1
  2. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/pyproject.toml +1 -1
  3. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/terminusgps/authorizenet/api/customer_profiles.py +1 -0
  4. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/terminusgps/authorizenet/service.py +5 -13
  5. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/terminusgps/default_settings.py +3 -3
  6. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/uv.lock +1 -1
  7. python_terminusgps-53.0.0/terminusgps/authorizenet/constants.py +0 -104
  8. python_terminusgps-53.0.0/terminusgps/authorizenet/utils.py +0 -13
  9. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/.github/workflows/python-test.yml +0 -0
  10. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/.github/workflows/sphinx.yml +0 -0
  11. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/.gitignore +0 -0
  12. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/.python-version +0 -0
  13. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/COPYING +0 -0
  14. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/README.md +0 -0
  15. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/dist/.gitignore +0 -0
  16. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/docs/Makefile +0 -0
  17. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/docs/make.bat +0 -0
  18. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/docs/requirements.txt +0 -0
  19. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/docs/source/authorizenet/api.rst +0 -0
  20. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/docs/source/authorizenet/constants.rst +0 -0
  21. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/docs/source/authorizenet/index.rst +0 -0
  22. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/docs/source/authorizenet/service.rst +0 -0
  23. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/docs/source/conf.py +0 -0
  24. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/docs/source/index.rst +0 -0
  25. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/docs/source/mixins.rst +0 -0
  26. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/docs/source/validators.rst +0 -0
  27. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/docs/source/wialon/constants.rst +0 -0
  28. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/docs/source/wialon/exceptions.rst +0 -0
  29. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/docs/source/wialon/index.rst +0 -0
  30. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/docs/source/wialon/items.rst +0 -0
  31. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/docs/source/wialon/session.rst +0 -0
  32. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/docs/source/wialon/usage.rst +0 -0
  33. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/docs/source/wialon/utils.rst +0 -0
  34. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/htmlcov/.gitignore +0 -0
  35. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/terminusgps/__init__.py +0 -0
  36. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/terminusgps/authorizenet/__init__.py +0 -0
  37. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/terminusgps/authorizenet/api/__init__.py +0 -0
  38. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/terminusgps/authorizenet/api/address_profiles.py +0 -0
  39. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/terminusgps/authorizenet/api/payment_profiles.py +0 -0
  40. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/terminusgps/authorizenet/api/subscriptions.py +0 -0
  41. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/terminusgps/authorizenet/api/transactions.py +0 -0
  42. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/terminusgps/mixins.py +0 -0
  43. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/terminusgps/validators.py +0 -0
  44. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/terminusgps/wialon/__init__.py +0 -0
  45. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/terminusgps/wialon/constants.py +0 -0
  46. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/terminusgps/wialon/flags.py +0 -0
  47. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/terminusgps/wialon/session.py +0 -0
  48. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/terminusgps/wialon/utils.py +0 -0
  49. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/tests/__init__.py +0 -0
  50. {python_terminusgps-53.0.0 → python_terminusgps-54.0.0}/tests/test_authorizenet.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-terminusgps
3
- Version: 53.0.0
3
+ Version: 54.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
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "python-terminusgps"
3
- version = "53.0.0"
3
+ version = "54.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" } ]
@@ -30,6 +30,7 @@ def create_customer_profile(
30
30
  raise ValueError(
31
31
  "At least one of 'email', 'merchantCustomerId' or 'description' is required in contract"
32
32
  )
33
+
33
34
  request = apicontractsv1.createCustomerProfileRequest()
34
35
  request.profile = contract
35
36
  return request, apicontrollers.createCustomerProfileController
@@ -6,7 +6,7 @@ from django.conf import settings
6
6
  from lxml.objectify import ObjectifiedElement
7
7
 
8
8
 
9
- class AuthorizenetControllerExecutionError(Exception):
9
+ class AuthorizenetError(Exception):
10
10
  """Raised when an Authorizenet API controller fails to execute."""
11
11
 
12
12
  def __init__(self, message: str, code: str, *args, **kwargs) -> None:
@@ -14,9 +14,6 @@ class AuthorizenetControllerExecutionError(Exception):
14
14
  self._message: str = message
15
15
  self._code: str = code
16
16
 
17
- def __str__(self) -> str:
18
- return f"{self.code}: {self.message}"
19
-
20
17
  @property
21
18
  def message(self) -> str:
22
19
  """An Authorizenet API error message."""
@@ -45,7 +42,7 @@ class AuthorizenetService:
45
42
  :type request_tuple: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
46
43
  :param reference_id: An optional reference id string for the API call. Default is :py:obj:`None`.
47
44
  :type reference_id: str | None
48
- :raises AuthorizenetControllerExecutionError: If the API call failed.
45
+ :raises AuthorizenetError: If the API call failed.
49
46
  :returns: An Authorizenet API response.
50
47
  :rtype: ~lxml.objectify.ObjectifiedElement
51
48
 
@@ -60,13 +57,13 @@ class AuthorizenetService:
60
57
  controller.execute()
61
58
  response = controller.getresponse()
62
59
 
63
- if not response:
64
- raise AuthorizenetControllerExecutionError(
60
+ if response is None:
61
+ raise AuthorizenetError(
65
62
  message="No response from the Authorizenet API controller.",
66
63
  code="1",
67
64
  )
68
65
  elif response is not None and response.messages.resultCode != "Ok":
69
- raise AuthorizenetControllerExecutionError(
66
+ raise AuthorizenetError(
70
67
  message=response.messages.message[0]["text"].text,
71
68
  code=response.messages.message[0]["code"].text,
72
69
  )
@@ -84,8 +81,3 @@ class AuthorizenetService:
84
81
  def environment(self) -> str:
85
82
  """Environment for Authorizenet API requests."""
86
83
  return str(settings.MERCHANT_AUTH_ENVIRONMENT)
87
-
88
- @cached_property
89
- def validationMode(self) -> str:
90
- """Validation mode for Authorizenet API requests."""
91
- return str(settings.MERCHANT_AUTH_VALIDATION_MODE)
@@ -1,7 +1,7 @@
1
1
  import os
2
2
  import pathlib
3
3
 
4
- from terminusgps.authorizenet.constants import Environment, ValidationMode
4
+ from authorizenet.constants import constants as anet_constants
5
5
 
6
6
  BASE_DIR = pathlib.Path(__file__).resolve().parent
7
7
 
@@ -10,8 +10,8 @@ SECRET_KEY = "xem*6no%8d9%^qzt2f3x3ar-uq4_+7h9myc$t0!+4%bj5us6f)"
10
10
  USE_TZ = False
11
11
  USE_I18N = False
12
12
 
13
- MERCHANT_AUTH_ENVIRONMENT = Environment.SANDBOX
14
- MERCHANT_AUTH_VALIDATION_MODE = ValidationMode.TEST
13
+ MERCHANT_AUTH_ENVIRONMENT = anet_constants.SANDBOX
14
+ MERCHANT_AUTH_VALIDATION_MODE = "testMode"
15
15
 
16
16
  # Secrets
17
17
  MERCHANT_AUTH_LOGIN_ID = os.getenv("MERCHANT_AUTH_LOGIN_ID")
@@ -833,7 +833,7 @@ wheels = [
833
833
 
834
834
  [[package]]
835
835
  name = "python-terminusgps"
836
- version = "53.0.0"
836
+ version = "54.0.0"
837
837
  source = { editable = "." }
838
838
  dependencies = [
839
839
  { name = "authorizenet" },
@@ -1,104 +0,0 @@
1
- from authorizenet import apicontractsv1
2
- from authorizenet.constants import constants as anet_constants
3
- from django.db import models
4
- from django.utils.translation import gettext_lazy as _
5
-
6
-
7
- class BankAccountType(models.TextChoices):
8
- CHECKING = "checking", _("Checking account")
9
- """Checking account."""
10
- SAVINGS = "savings", _("Savings account")
11
- """Savings account."""
12
- BUSINESS_CHECKING = "businessChecking", _("Business checking account")
13
- """Business checking account."""
14
-
15
-
16
- class ECheckType(models.TextChoices):
17
- PPD = "PPD", _("Prearranged Payment and Deposit Entry")
18
- """Prearranged Payment and Deposit Entry."""
19
- TEL = "TEL", _("Telephone-Initiated Entry")
20
- """Telephone-Initiated Entry."""
21
- WEB = "WEB", _("Web-Initiated Entry")
22
- """Web-Initiated Entry."""
23
-
24
-
25
- class CreditCardType(models.TextChoices):
26
- AMEX = apicontractsv1.cardTypeEnum.AmericanExpress, _("American Express")
27
- """American express card."""
28
- DINERS = apicontractsv1.cardTypeEnum.DinersClub, _("Diners Club")
29
- """Diners club card."""
30
- DISCOVER = apicontractsv1.cardTypeEnum.Discover, _("Discover")
31
- """Disover card."""
32
- JCB = apicontractsv1.cardTypeEnum.JCB, _("JCB")
33
- """JCB card."""
34
- MASTERCARD = apicontractsv1.cardTypeEnum.MasterCard, _("Mastercard")
35
- """Mastercard card."""
36
- VISA = apicontractsv1.cardTypeEnum.Visa, _("Visa")
37
- """Visa card."""
38
-
39
-
40
- class CurrencyCode(models.TextChoices):
41
- USD = "USD", _("United States Dollar")
42
- """US dollar."""
43
- CAD = "CAD", _("Canadian Dollar")
44
- """Canadian dollar."""
45
- GBP = "GBP", _("Great British Pound")
46
- """Great British pound."""
47
- DKK = "DKK", _("Danish Krone")
48
- """Danish krone."""
49
- NOK = "NOK", _("Norwegian Krone")
50
- """Norwegian krone."""
51
- PLN = "PLN", _("Polish Złoty")
52
- """Polish zloty."""
53
- SEK = "SEK", _("Swedish Krona")
54
- """Swedish krona."""
55
- EUR = "EUR", _("Euro")
56
- """Euro."""
57
- AUD = "AUD", _("Australian Dollar")
58
- """Australian dollar."""
59
- NZD = "NZD", _("New Zealand Dollar")
60
- """New Zealand dollar."""
61
-
62
-
63
- class SubscriptionStatus(models.TextChoices):
64
- """An Authorizenet subscription status."""
65
-
66
- ACTIVE = "active", _("Active")
67
- """Active status."""
68
- EXPIRED = "expired", _("Expired")
69
- """Expired status."""
70
- SUSPENDED = "suspended", _("Suspended")
71
- """Suspended status."""
72
- CANCELED = "canceled", _("Canceled")
73
- """Canceled status."""
74
- TERMINATED = "terminated", _("Terminated")
75
- """Terminated status."""
76
- UNKNOWN = "unknown", _("Unknown")
77
- """Unknown status."""
78
-
79
-
80
- class SubscriptionIntervalUnit(models.TextChoices):
81
- """An Authorizenet subscription interval unit."""
82
-
83
- DAYS = apicontractsv1.ARBSubscriptionUnitEnum.days, _("Days")
84
- """Days interval unit."""
85
- MONTHS = apicontractsv1.ARBSubscriptionUnitEnum.months, _("Months")
86
- """Months interval unit."""
87
-
88
-
89
- class Environment(models.TextChoices):
90
- """An Authorizenet execution environment."""
91
-
92
- SANDBOX = anet_constants.SANDBOX, _("Sandbox Environment")
93
- """Sandbox environment."""
94
- PRODUCTION = anet_constants.PRODUCTION, _("Production Environment")
95
- """Production environment."""
96
-
97
-
98
- class ValidationMode(models.TextChoices):
99
- """An Authorizenet validation mode."""
100
-
101
- TEST = "testMode", _("Test Mode")
102
- """Test mode."""
103
- LIVE = "liveMode", _("Live Mode")
104
- """Live mode."""
@@ -1,13 +0,0 @@
1
- import typing
2
-
3
- T_contract = typing.TypeVar("T_contract")
4
-
5
-
6
- def build_contract(
7
- contract_cls: type[T_contract], fields: dict[str, typing.Any]
8
- ) -> T_contract:
9
- contract = contract_cls()
10
- for key, value in fields.items():
11
- if value:
12
- setattr(contract, key, value)
13
- return contract