python-terminusgps 45.7.0__tar.gz → 45.9.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.
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/PKG-INFO +1 -1
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/source/authorizenet/index.rst +0 -1
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/source/conf.py +1 -1
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/pyproject.toml +1 -1
- python_terminusgps-45.9.0/terminusgps/authorizenet/api/transactions.py +201 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/authorizenet/constants.py +15 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/authorizenet/service.py +5 -7
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/uv.lock +7 -7
- python_terminusgps-45.7.0/docs/source/authorizenet/usage.rst +0 -6
- python_terminusgps-45.7.0/terminusgps/authorizenet/api/transactions.py +0 -100
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/.github/workflows/sphinx.yml +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/.gitignore +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/.python-version +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/COPYING +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/README.md +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/Makefile +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/make.bat +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/requirements.txt +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/source/authorizenet/api.rst +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/source/authorizenet/constants.rst +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/source/authorizenet/service.rst +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/source/index.rst +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/source/mixins.rst +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/source/validators.rst +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/source/wialon/constants.rst +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/source/wialon/exceptions.rst +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/source/wialon/index.rst +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/source/wialon/items.rst +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/source/wialon/session.rst +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/source/wialon/usage.rst +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/__init__.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/authorizenet/__init__.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/authorizenet/api/__init__.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/authorizenet/api/address_profiles.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/authorizenet/api/customer_profiles.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/authorizenet/api/payment_profiles.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/authorizenet/api/subscriptions.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/default_settings.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/mixins.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/validators.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/__init__.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/constants.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/flags.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/items/__init__.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/items/account.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/items/base.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/items/factory.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/items/resource.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/items/retranslator.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/items/route.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/items/unit.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/items/unit_group.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/items/user.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/session.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/utils.py +0 -0
- {python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/validators.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-terminusgps
|
|
3
|
-
Version: 45.
|
|
3
|
+
Version: 45.9.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
|
|
@@ -12,7 +12,7 @@ sys.path.insert(0, os.path.abspath("../../"))
|
|
|
12
12
|
project = "python-terminusgps"
|
|
13
13
|
copyright = "2025, Terminus GPS, LLC"
|
|
14
14
|
author = "Terminus GPS, LLC"
|
|
15
|
-
release = "45.
|
|
15
|
+
release = "45.9.0"
|
|
16
16
|
|
|
17
17
|
# -- General configuration ---------------------------------------------------
|
|
18
18
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "python-terminusgps"
|
|
3
|
-
version = "45.
|
|
3
|
+
version = "45.9.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,201 @@
|
|
|
1
|
+
from decimal import Decimal
|
|
2
|
+
|
|
3
|
+
from authorizenet import apicontractsv1, apicontrollers
|
|
4
|
+
from authorizenet.apicontrollersbase import APIOperationBase
|
|
5
|
+
from lxml.objectify import ObjectifiedElement
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"charge_credit_card",
|
|
9
|
+
"authorize_credit_card",
|
|
10
|
+
"capture_authorized_amount",
|
|
11
|
+
"refund_credit_card",
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def build_transaction(
|
|
16
|
+
amount: Decimal, **kwargs
|
|
17
|
+
) -> apicontractsv1.transactionRequestType:
|
|
18
|
+
"""Returns a transaction element for a transaction request."""
|
|
19
|
+
transaction_request = apicontractsv1.transactionRequestType()
|
|
20
|
+
transaction_request.amount = amount
|
|
21
|
+
|
|
22
|
+
if payment := kwargs.get("payment"):
|
|
23
|
+
transaction_request.payment = payment
|
|
24
|
+
if address := kwargs.get("address"):
|
|
25
|
+
transaction_request.billTo = address
|
|
26
|
+
if order := kwargs.get("order"):
|
|
27
|
+
transaction_request.order = order
|
|
28
|
+
if customer_data := kwargs.get("customer_data"):
|
|
29
|
+
transaction_request.customerData = customer_data
|
|
30
|
+
if settings := kwargs.get("settings"):
|
|
31
|
+
transaction_request.transactionSettings = settings
|
|
32
|
+
if line_items := kwargs.get("line_items"):
|
|
33
|
+
transaction_request.lineItems = line_items
|
|
34
|
+
|
|
35
|
+
return transaction_request
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def charge_credit_card(
|
|
39
|
+
amount: Decimal,
|
|
40
|
+
credit_card: apicontractsv1.creditCardType,
|
|
41
|
+
address: apicontractsv1.customerAddressType,
|
|
42
|
+
order: apicontractsv1.orderType | None = None,
|
|
43
|
+
customer_data: apicontractsv1.customerDataType | None = None,
|
|
44
|
+
settings: apicontractsv1.ArrayOfSetting | None = None,
|
|
45
|
+
line_items: apicontractsv1.ArrayOfLineItem | None = None,
|
|
46
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
47
|
+
"""
|
|
48
|
+
`Charges a credit card <https://developer.authorize.net/api/reference/index.html#payment-transactions-charge-a-credit-card>`_.
|
|
49
|
+
|
|
50
|
+
:param amount: Dollar amount to charge.
|
|
51
|
+
:type amount: ~decimal.Decimal
|
|
52
|
+
:param credit_card: A credit card.
|
|
53
|
+
:type credit_card: ~authorizenet.apicontractsv1.creditCardType
|
|
54
|
+
:param address: A customer address.
|
|
55
|
+
:type address: ~authorizenet.apicontractsv1.customerAddressType
|
|
56
|
+
:param order: Order information. Default is :py:obj:`None`.
|
|
57
|
+
:type order: ~authorizenet.apicontractsv1.orderType | None
|
|
58
|
+
:param customer_data: Customer data. Default is :py:obj:`None`.
|
|
59
|
+
:type customer_data: ~authorizenet.apicontractsv1.customerDataType | None
|
|
60
|
+
:param settings: Transaction settings. Default is :py:obj:`None`.
|
|
61
|
+
:type settings: ~authorizenet.apicontractsv1.ArrayOfSetting | None
|
|
62
|
+
:param line_items: An array of line items. Default is :py:obj:`None`.
|
|
63
|
+
:type line_items: ~authorizenet.apicontractsv1.ArrayOfLineItem | None
|
|
64
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
65
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
66
|
+
|
|
67
|
+
"""
|
|
68
|
+
request = apicontractsv1.createTransactionRequest()
|
|
69
|
+
payment = apicontractsv1.paymentType()
|
|
70
|
+
payment.creditCard = credit_card
|
|
71
|
+
request.transactionRequest = build_transaction(
|
|
72
|
+
amount=amount,
|
|
73
|
+
payment=payment,
|
|
74
|
+
address=address,
|
|
75
|
+
order=order,
|
|
76
|
+
customer_data=customer_data,
|
|
77
|
+
settings=settings,
|
|
78
|
+
line_items=line_items,
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
request.transactionRequest.transactionType = (
|
|
82
|
+
apicontractsv1.transactionTypeEnum.authCaptureTransaction
|
|
83
|
+
)
|
|
84
|
+
return request, apicontrollers.createTransactionController
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def authorize_credit_card(
|
|
88
|
+
amount: Decimal,
|
|
89
|
+
credit_card: apicontractsv1.creditCardType,
|
|
90
|
+
address: apicontractsv1.customerAddressType,
|
|
91
|
+
order: apicontractsv1.orderType | None = None,
|
|
92
|
+
customer_data: apicontractsv1.customerDataType | None = None,
|
|
93
|
+
settings: apicontractsv1.ArrayOfSetting | None = None,
|
|
94
|
+
line_items: apicontractsv1.ArrayOfLineItem | None = None,
|
|
95
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
96
|
+
"""
|
|
97
|
+
`Authorizes a credit card <https://developer.authorize.net/api/reference/index.html#payment-transactions-authorize-a-credit-card>`_.
|
|
98
|
+
|
|
99
|
+
:param amount: Dollar amount to authorize.
|
|
100
|
+
:type amount: ~decimal.Decimal
|
|
101
|
+
:param credit_card: A credit card.
|
|
102
|
+
:type credit_card: ~authorizenet.apicontractsv1.creditCardType
|
|
103
|
+
:param address: A customer address.
|
|
104
|
+
:type address: ~authorizenet.apicontractsv1.customerAddressType
|
|
105
|
+
:param order: Additional order information. Default is :py:obj:`None`.
|
|
106
|
+
:type order: ~authorizenet.apicontractsv1.orderType | None
|
|
107
|
+
:param customer_data: Additional customer data. Default is :py:obj:`None`.
|
|
108
|
+
:type customer_data: ~authorizenet.apicontractsv1.customerDataType | None
|
|
109
|
+
:param settings: Transaction settings. Default is :py:obj:`None`.
|
|
110
|
+
:type settings: ~authorizenet.apicontractsv1.ArrayOfSetting | None
|
|
111
|
+
:param line_items: An array of line items. Default is :py:obj:`None`.
|
|
112
|
+
:type line_items: ~authorizenet.apicontractsv1.ArrayOfLineItem | None
|
|
113
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
114
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
115
|
+
|
|
116
|
+
"""
|
|
117
|
+
request = apicontractsv1.createTransactionRequest()
|
|
118
|
+
payment = apicontractsv1.paymentType()
|
|
119
|
+
payment.creditCard = credit_card
|
|
120
|
+
request.transactionRequest = build_transaction(
|
|
121
|
+
amount=amount,
|
|
122
|
+
payment=payment,
|
|
123
|
+
address=address,
|
|
124
|
+
order=order,
|
|
125
|
+
customer_data=customer_data,
|
|
126
|
+
settings=settings,
|
|
127
|
+
line_items=line_items,
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
request.transactionRequest.transactionType = (
|
|
131
|
+
apicontractsv1.transactionTypeEnum.authOnlyTransaction
|
|
132
|
+
)
|
|
133
|
+
return request, apicontrollers.createTransactionController
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def capture_authorized_amount(
|
|
137
|
+
amount: Decimal,
|
|
138
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
139
|
+
"""
|
|
140
|
+
`Captures a previously authorized amount <https://developer.authorize.net/api/reference/index.html#payment-transactions-capture-a-previously-authorized-amount>`_.
|
|
141
|
+
|
|
142
|
+
:param amount: Dollar amount to capture.
|
|
143
|
+
:type amount: ~decimal.Decimal
|
|
144
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
145
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
146
|
+
|
|
147
|
+
"""
|
|
148
|
+
request = apicontractsv1.createTransactionRequest()
|
|
149
|
+
request.transactionRequest = build_transaction(amount)
|
|
150
|
+
request.transactionRequest.transactionType = (
|
|
151
|
+
apicontractsv1.transactionTypeEnum.priorAuthCaptureTransaction
|
|
152
|
+
)
|
|
153
|
+
return request, apicontrollers.createTransactionController
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def refund_credit_card(
|
|
157
|
+
amount: Decimal, credit_card: apicontractsv1.creditCardType
|
|
158
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
159
|
+
"""
|
|
160
|
+
`Refunds a credit card <https://developer.authorize.net/api/reference/index.html#payment-transactions-refund-a-transaction>`_.
|
|
161
|
+
|
|
162
|
+
:param amount: Dollar amount to refund.
|
|
163
|
+
:type amount: ~decimal.Decimal
|
|
164
|
+
:param credit_card: Destination credit card.
|
|
165
|
+
:type credit_card: ~authorizenet.apicontractsv1.creditCardType
|
|
166
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
167
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
168
|
+
|
|
169
|
+
"""
|
|
170
|
+
request = apicontractsv1.createTransactionRequest()
|
|
171
|
+
payment = apicontractsv1.paymentType()
|
|
172
|
+
payment.creditCard = credit_card
|
|
173
|
+
request.transactionRequest = build_transaction(
|
|
174
|
+
amount=amount, payment=payment
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
request.transactionRequest.transactionType = (
|
|
178
|
+
apicontractsv1.transactionTypeEnum.refundTransaction
|
|
179
|
+
)
|
|
180
|
+
return request, apicontrollers.createTransactionController
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def void_transaction(
|
|
184
|
+
reference_id: str,
|
|
185
|
+
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
186
|
+
"""
|
|
187
|
+
`Voids a transaction <https://developer.authorize.net/api/reference/index.html#payment-transactions-void-a-transaction>`_.
|
|
188
|
+
|
|
189
|
+
:param reference_id: Transaction reference id.
|
|
190
|
+
:type reference_id: str
|
|
191
|
+
:returns: A tuple containing an Authorizenet API request element and controller class.
|
|
192
|
+
:rtype: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
193
|
+
|
|
194
|
+
"""
|
|
195
|
+
request = apicontractsv1.createTransactionRequest()
|
|
196
|
+
request.transactionRequest = apicontractsv1.transactionRequestType()
|
|
197
|
+
request.transactionRequest.refTransId = reference_id
|
|
198
|
+
request.transactionRequest.transactionType = (
|
|
199
|
+
apicontractsv1.transactionTypeEnum.voidTransaction
|
|
200
|
+
)
|
|
201
|
+
return request, apicontrollers.createTransactionController
|
{python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/authorizenet/constants.py
RENAMED
|
@@ -4,6 +4,21 @@ from django.db import models
|
|
|
4
4
|
from django.utils.translation import gettext_lazy as _
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
class CreditCardType(models.TextChoices):
|
|
8
|
+
AMEX = apicontractsv1.cardTypeEnum.AmericanExpress, _("American Express")
|
|
9
|
+
"""American express card."""
|
|
10
|
+
DINERS = apicontractsv1.cardTypeEnum.DinersClub, _("Diners Club")
|
|
11
|
+
"""Diners club card."""
|
|
12
|
+
DISCOVER = apicontractsv1.cardTypeEnum.Discover, _("Discover")
|
|
13
|
+
"""Disover card."""
|
|
14
|
+
JCB = apicontractsv1.cardTypeEnum.JCB, _("JCB")
|
|
15
|
+
"""JCB card."""
|
|
16
|
+
MASTERCARD = apicontractsv1.cardTypeEnum.MasterCard, _("Mastercard")
|
|
17
|
+
"""Mastercard card."""
|
|
18
|
+
VISA = apicontractsv1.cardTypeEnum.Visa, _("Visa")
|
|
19
|
+
"""Visa card."""
|
|
20
|
+
|
|
21
|
+
|
|
7
22
|
class CurrencyCode(models.TextChoices):
|
|
8
23
|
USD = "USD", _("United States Dollar")
|
|
9
24
|
"""US dollar."""
|
|
@@ -52,8 +52,7 @@ class AuthorizenetService:
|
|
|
52
52
|
|
|
53
53
|
def call_api(
|
|
54
54
|
self,
|
|
55
|
-
|
|
56
|
-
controller_cls: type[APIOperationBase],
|
|
55
|
+
request_tuple: tuple[ObjectifiedElement, type[APIOperationBase]],
|
|
57
56
|
reference_id: str | None = None,
|
|
58
57
|
) -> ObjectifiedElement:
|
|
59
58
|
"""
|
|
@@ -61,10 +60,8 @@ class AuthorizenetService:
|
|
|
61
60
|
|
|
62
61
|
If ``reference_id`` was provided, it is added to the request before execution.
|
|
63
62
|
|
|
64
|
-
:param
|
|
65
|
-
:type
|
|
66
|
-
:param controller_cls: An Authorizenet controller class.
|
|
67
|
-
:type controller_cls: type[~authorizenet.apicontrollersbase.APIOperationBase]
|
|
63
|
+
:param request_tuple: A tuple containing an Authorizenet API request contract and a controller class to execute it with.
|
|
64
|
+
:type request_tuple: tuple[~lxml.objectify.ObjectifiedElement, type[~authorizenet.apicontrollersbase.APIOperationBase]]
|
|
68
65
|
:param reference_id: An optional reference id string for the API call. Default is :py:obj:`None`.
|
|
69
66
|
:type reference_id: str | None
|
|
70
67
|
:raises AuthorizenetControllerExecutionError: If the API call failed.
|
|
@@ -72,6 +69,7 @@ class AuthorizenetService:
|
|
|
72
69
|
:rtype: ~lxml.objectify.ObjectifiedElement
|
|
73
70
|
|
|
74
71
|
"""
|
|
72
|
+
request, controller_cls = request_tuple[0], request_tuple[1]
|
|
75
73
|
request.merchantAuthentication = self.merchantAuthentication
|
|
76
74
|
if reference_id is not None:
|
|
77
75
|
request.refId = reference_id
|
|
@@ -79,8 +77,8 @@ class AuthorizenetService:
|
|
|
79
77
|
controller = controller_cls(request)
|
|
80
78
|
controller.setenvironment(self.environment)
|
|
81
79
|
controller.execute()
|
|
80
|
+
response = controller.getresponse()
|
|
82
81
|
|
|
83
|
-
response: ObjectifiedElement | None = controller.getresponse()
|
|
84
82
|
if response is None:
|
|
85
83
|
raise AuthorizenetControllerExecutionError(
|
|
86
84
|
message="No response from the Authorizenet API controller.",
|
|
@@ -142,7 +142,7 @@ wheels = [
|
|
|
142
142
|
|
|
143
143
|
[[package]]
|
|
144
144
|
name = "django-stubs"
|
|
145
|
-
version = "5.2.
|
|
145
|
+
version = "5.2.5"
|
|
146
146
|
source = { registry = "https://pypi.org/simple" }
|
|
147
147
|
dependencies = [
|
|
148
148
|
{ name = "django" },
|
|
@@ -150,22 +150,22 @@ dependencies = [
|
|
|
150
150
|
{ name = "types-pyyaml" },
|
|
151
151
|
{ name = "typing-extensions" },
|
|
152
152
|
]
|
|
153
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
153
|
+
sdist = { url = "https://files.pythonhosted.org/packages/e1/8e/286150f593481c33f54d14efb58d72178f159d57d31043529d38bbc98e2f/django_stubs-5.2.5.tar.gz", hash = "sha256:fc78384e28d8c5292d60983075a5934f644f7c304c25ae2793fc57aa66d5018b", size = 247794 }
|
|
154
154
|
wheels = [
|
|
155
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
155
|
+
{ url = "https://files.pythonhosted.org/packages/2f/02/cdbf7652ef2c9a7a1fed7c279484b7f3806f15b1bb34aec9fef8e8cfacbf/django_stubs-5.2.5-py3-none-any.whl", hash = "sha256:223c1a3324cd4873b7629dec6e9adbe224a94508284c1926b25fddff7a92252b", size = 490196 },
|
|
156
156
|
]
|
|
157
157
|
|
|
158
158
|
[[package]]
|
|
159
159
|
name = "django-stubs-ext"
|
|
160
|
-
version = "5.2.
|
|
160
|
+
version = "5.2.5"
|
|
161
161
|
source = { registry = "https://pypi.org/simple" }
|
|
162
162
|
dependencies = [
|
|
163
163
|
{ name = "django" },
|
|
164
164
|
{ name = "typing-extensions" },
|
|
165
165
|
]
|
|
166
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
166
|
+
sdist = { url = "https://files.pythonhosted.org/packages/16/94/c9b8f4c47084a0fa666da9066c36771098101932688adf2c17a40fab79c2/django_stubs_ext-5.2.5.tar.gz", hash = "sha256:ecc628df29d36cede638567c4e33ff485dd7a99f1552ad0cece8c60e9c3a8872", size = 6489 }
|
|
167
167
|
wheels = [
|
|
168
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
168
|
+
{ url = "https://files.pythonhosted.org/packages/e0/fe/a85a105fddffadb4a8d50e500caeee87d836b679d51a19d52dfa0cc6c660/django_stubs_ext-5.2.5-py3-none-any.whl", hash = "sha256:9b4b8ac9d32f7e6c304fd05477f8688fae6ed57f6a0f9f4d074f9e55b5a3da14", size = 9310 },
|
|
169
169
|
]
|
|
170
170
|
|
|
171
171
|
[[package]]
|
|
@@ -298,7 +298,7 @@ wheels = [
|
|
|
298
298
|
|
|
299
299
|
[[package]]
|
|
300
300
|
name = "python-terminusgps"
|
|
301
|
-
version = "45.
|
|
301
|
+
version = "45.9.0"
|
|
302
302
|
source = { editable = "." }
|
|
303
303
|
dependencies = [
|
|
304
304
|
{ name = "authorizenet" },
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
from decimal import Decimal
|
|
2
|
-
|
|
3
|
-
from authorizenet import apicontractsv1, apicontrollers
|
|
4
|
-
from authorizenet.apicontrollersbase import APIOperationBase
|
|
5
|
-
from lxml.objectify import ObjectifiedElement
|
|
6
|
-
|
|
7
|
-
__all__ = []
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
def build_transaction_request(
|
|
11
|
-
transaction_type: str,
|
|
12
|
-
amount: Decimal,
|
|
13
|
-
payment: apicontractsv1.paymentType | None = None,
|
|
14
|
-
order: apicontractsv1.orderType | None = None,
|
|
15
|
-
address: apicontractsv1.customerAddressType | None = None,
|
|
16
|
-
customer_data: apicontractsv1.customerDataType | None = None,
|
|
17
|
-
settings: apicontractsv1.settingType | None = None,
|
|
18
|
-
line_items: apicontractsv1.ArrayOfLineItem | None = None,
|
|
19
|
-
) -> apicontractsv1.transactionRequestType:
|
|
20
|
-
request = apicontractsv1.transactionRequestType()
|
|
21
|
-
request.transactionType = transaction_type
|
|
22
|
-
request.amount = amount
|
|
23
|
-
|
|
24
|
-
if payment is not None:
|
|
25
|
-
request.payment = payment
|
|
26
|
-
if order is not None:
|
|
27
|
-
request.order = order
|
|
28
|
-
if address is not None:
|
|
29
|
-
request.billTo = address
|
|
30
|
-
if customer_data is not None:
|
|
31
|
-
request.customer = customer_data
|
|
32
|
-
if settings is not None:
|
|
33
|
-
request.transactionSettings = settings
|
|
34
|
-
if line_items is not None:
|
|
35
|
-
request.lineItems = line_items
|
|
36
|
-
return request
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def charge_credit_card(
|
|
40
|
-
amount: Decimal,
|
|
41
|
-
credit_card: apicontractsv1.creditCardType,
|
|
42
|
-
address: apicontractsv1.customerAddressType,
|
|
43
|
-
order: apicontractsv1.orderType | None = None,
|
|
44
|
-
customer_data: apicontractsv1.customerDataType | None = None,
|
|
45
|
-
settings: apicontractsv1.settingType | None = None,
|
|
46
|
-
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
47
|
-
request = apicontractsv1.createTransactionRequest()
|
|
48
|
-
request.transactionRequest = build_transaction_request(
|
|
49
|
-
transaction_type="authCaptureTransaction",
|
|
50
|
-
amount=amount,
|
|
51
|
-
payment=apicontractsv1.paymentType(creditCard=credit_card),
|
|
52
|
-
address=address,
|
|
53
|
-
order=order,
|
|
54
|
-
customer_data=customer_data,
|
|
55
|
-
settings=settings,
|
|
56
|
-
)
|
|
57
|
-
return request, apicontrollers.createTransactionController
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
def authorize_credit_card(
|
|
61
|
-
amount: Decimal,
|
|
62
|
-
credit_card: apicontractsv1.creditCardType,
|
|
63
|
-
address: apicontractsv1.customerAddressType,
|
|
64
|
-
order: apicontractsv1.orderType | None = None,
|
|
65
|
-
customer_data: apicontractsv1.customerDataType | None = None,
|
|
66
|
-
settings: apicontractsv1.settingType | None = None,
|
|
67
|
-
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
68
|
-
request = apicontractsv1.createTransactionRequest()
|
|
69
|
-
request.transactionRequest = build_transaction_request(
|
|
70
|
-
transaction_type="authOnlyTransaction",
|
|
71
|
-
amount=amount,
|
|
72
|
-
payment=apicontractsv1.paymentType(creditCard=credit_card),
|
|
73
|
-
address=address,
|
|
74
|
-
order=order,
|
|
75
|
-
customer_data=customer_data,
|
|
76
|
-
settings=settings,
|
|
77
|
-
)
|
|
78
|
-
return request, apicontrollers.createTransactionController
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
def capture_authorized_amount(
|
|
82
|
-
amount: Decimal,
|
|
83
|
-
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
84
|
-
request = apicontractsv1.createTransactionRequest()
|
|
85
|
-
request.transactionRequest = build_transaction_request(
|
|
86
|
-
transaction_type="priorAuthCaptureTransaction", amount=amount
|
|
87
|
-
)
|
|
88
|
-
return request, apicontrollers.createTransactionController
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
def refund_credit_card(
|
|
92
|
-
amount: Decimal, credit_card: apicontractsv1.creditCardType
|
|
93
|
-
) -> tuple[ObjectifiedElement, type[APIOperationBase]]:
|
|
94
|
-
request = apicontractsv1.createTransactionRequest()
|
|
95
|
-
request.transactionRequest = build_transaction_request(
|
|
96
|
-
transaction_type="refundTransaction",
|
|
97
|
-
amount=amount,
|
|
98
|
-
payment=apicontractsv1.paymentType(creditCard=credit_card),
|
|
99
|
-
)
|
|
100
|
-
return request, apicontrollers.createTransactionController
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/source/authorizenet/constants.rst
RENAMED
|
File without changes
|
{python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/docs/source/authorizenet/service.rst
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/authorizenet/__init__.py
RENAMED
|
File without changes
|
{python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/authorizenet/api/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/items/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/items/resource.py
RENAMED
|
File without changes
|
{python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/items/retranslator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_terminusgps-45.7.0 → python_terminusgps-45.9.0}/terminusgps/wialon/items/unit_group.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|