Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: increase default timeouts #20

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions paygate/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ class PayGate(BasePaymentProcessor):

DEFAULT_API_CHECKOUT_URL = "https://lab.optimistic.blue/paygateWS/api/CheckOut"
# the default timeout that we wait to have a response of the PayGate Checkout API method
DEFAULT_API_CHECKOUT_REQUEST_TIMEOUT_SECONDS = 10
DEFAULT_API_CHECKOUT_REQUEST_TIMEOUT_SECONDS = 20

DEFAULT_API_BACK_SEARCH_TRANSACTIONS = (
"https://lab.optimistic.blue/paygateWS/api/BackOfficeSearchTransactions"
)
DEFAULT_API_BACK_SEARCH_TRANSACTIONS_TIMEOUT_SECONDS = 10
DEFAULT_RETRY_CALLBACK_SUCCESS_TIMEOUT_SECONDS = 10
DEFAULT_API_BACK_SEARCH_TRANSACTIONS_TIMEOUT_SECONDS = 20
DEFAULT_RETRY_CALLBACK_SUCCESS_TIMEOUT_SECONDS = 30

DEFAULT_MARK_TEST_PAYMENT_AS_PAID_URL = "https://lab.optimistic.blue/paygateWS/api/MarkTestPaymentAsPaid"
DEFAULT_MARK_TEST_PAYMENT_AS_PAID_REQUEST_TIMEOUT_SECONDS = 10
DEFAULT_MARK_TEST_PAYMENT_AS_PAID_REQUEST_TIMEOUT_SECONDS = 30

def __init__(self, site):
"""
Expand Down
12 changes: 6 additions & 6 deletions paygate/tests/processors/test_paygate.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def test_get_transaction_parameters(self):
],
},
basket=self.basket,
timeout=10,
timeout=20,
basic_auth_user="NAU",
basic_auth_pass="APassword",
)
Expand Down Expand Up @@ -188,7 +188,7 @@ def test_get_transaction_parameters_payment_id_none(self):
],
},
basket=self.basket,
timeout=10,
timeout=20,
basic_auth_user="NAU",
basic_auth_pass="APassword",
)
Expand Down Expand Up @@ -247,7 +247,7 @@ def test_handle_processor_response(self):
"OFFSET_ROWS": 0,
},
basket=self.basket,
timeout=10,
timeout=20,
basic_auth_user="NAU",
basic_auth_pass="APassword",
)
Expand Down Expand Up @@ -298,7 +298,7 @@ def test_retry_baskets_payed_in_paygate(self, mock_ecommerce_response):
"FROM_DATETIME": start.isoformat(),
"TO_DATETIME": end.isoformat(),
},
timeout=10,
timeout=20,
basic_auth_user="NAU",
basic_auth_pass="APassword",
)
Expand All @@ -312,7 +312,7 @@ def test_retry_baskets_payed_in_paygate(self, mock_ecommerce_response):
# so we can differentiate on the PaymentProcessorResponse object
"retry_baskets_payed_in_paygate": "true",
},
timeout=10,
timeout=30,
)

@mock.patch.object(
Expand All @@ -338,7 +338,7 @@ def test_mark_test_payment_as_paid(self, mock_mark_test_payment_as_paid_call):
"PAYMENT_REF": self.basket.order_number,
},
basket=self.basket,
timeout=10,
timeout=30,
basic_auth_user="NAU",
basic_auth_pass="APassword",
)
Loading