Skip to content

Commit

Permalink
fix: typo "Merchat" to "Merchant" in methods
Browse files Browse the repository at this point in the history
  • Loading branch information
hoosnick committed Oct 1, 2023
1 parent 0f239c0 commit 108446f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
6 changes: 3 additions & 3 deletions lib/payme/methods/cancel_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from django.db import transaction

from payme.utils.logging import logger
from payme.models import MerchatTransactionsModel
from payme.models import MerchantTransactionsModel
from payme.errors.exceptions import PerformTransactionDoesNotExist
from payme.serializers import MerchatTransactionsModelSerializer as MTMS

Expand All @@ -25,8 +25,8 @@ def __call__(self, params: dict):
)
try:
with transaction.atomic():
transactions: MerchatTransactionsModel = \
MerchatTransactionsModel.objects.filter(
transactions: MerchantTransactionsModel = \
MerchantTransactionsModel.objects.filter(
_id=clean_data.get('_id'),
).first()
if transactions.cancel_time == 0:
Expand Down
4 changes: 2 additions & 2 deletions lib/payme/methods/check_transaction.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.db import DatabaseError

from payme.utils.logging import logger
from payme.models import MerchatTransactionsModel
from payme.models import MerchantTransactionsModel
from payme.serializers import MerchatTransactionsModelSerializer as MTMS


Expand All @@ -21,7 +21,7 @@ def __call__(self, params: dict) -> None:

try:
transaction = \
MerchatTransactionsModel.objects.get(
MerchantTransactionsModel.objects.get(
_id=clean_data.get("_id"),
)
response = {
Expand Down
6 changes: 3 additions & 3 deletions lib/payme/methods/create_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from payme.utils.logging import logger
from payme.utils.get_params import get_params
from payme.models import MerchatTransactionsModel
from payme.models import MerchantTransactionsModel
from payme.errors.exceptions import TooManyRequests
from payme.serializers import MerchatTransactionsModelSerializer

Expand All @@ -26,7 +26,7 @@ def __call__(self, params: dict) -> dict:
order_id = serializer.validated_data.get("order_id")

try:
transaction = MerchatTransactionsModel.objects.filter(
transaction = MerchantTransactionsModel.objects.filter(
order_id=order_id
).last()

Expand All @@ -40,7 +40,7 @@ def __call__(self, params: dict) -> dict:

if transaction is None:
transaction, _ = \
MerchatTransactionsModel.objects.get_or_create(
MerchantTransactionsModel.objects.get_or_create(
_id=serializer.validated_data.get('_id'),
order_id=serializer.validated_data.get('order_id'),
transaction_id=uuid.uuid4(),
Expand Down
6 changes: 3 additions & 3 deletions lib/payme/methods/get_statement.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from django.db import DatabaseError

from payme.utils.logging import logger
from payme.models import MerchatTransactionsModel
from payme.models import MerchantTransactionsModel
from payme.serializers import MerchatTransactionsModelSerializer as MTMS
from payme.utils.make_aware_datetime import make_aware_datetime as mad

Expand Down Expand Up @@ -29,13 +29,13 @@ def __call__(self, params: dict):

try:
transactions = \
MerchatTransactionsModel.objects.filter(
MerchantTransactionsModel.objects.filter(
created_at__gte=start_date,
created_at__lte=end_date
)

if not transactions: # no transactions found for the period
return {"result": {"transactions": []}}
return None, {"result": {"transactions": []}}

statements = [
{
Expand Down
4 changes: 2 additions & 2 deletions lib/payme/methods/perform_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from payme.utils.logging import logger
from payme.utils.get_params import get_params
from payme.models import MerchatTransactionsModel
from payme.models import MerchantTransactionsModel
from payme.serializers import MerchatTransactionsModelSerializer


Expand All @@ -26,7 +26,7 @@ def __call__(self, params: dict) -> dict:
response: dict = None
try:
transaction = \
MerchatTransactionsModel.objects.get(
MerchantTransactionsModel.objects.get(
_id=clean_data.get("_id"),
)
transaction.state = 2
Expand Down

0 comments on commit 108446f

Please sign in to comment.