diff --git a/payment_sixpay/README.md b/payment_sixpay/README.md index 9cfb1dc..9420dff 100644 --- a/payment_sixpay/README.md +++ b/payment_sixpay/README.md @@ -8,6 +8,10 @@ they are automatically sent back to Indico. ## Changelog +### 3.1.1 + +- Ignore pending transactions once they expired + ### 3.1 - Adapt to Indico 3.1 changes diff --git a/payment_sixpay/indico_payment_sixpay/plugin.py b/payment_sixpay/indico_payment_sixpay/plugin.py index 3f37203..5fe8883 100644 --- a/payment_sixpay/indico_payment_sixpay/plugin.py +++ b/payment_sixpay/indico_payment_sixpay/plugin.py @@ -5,8 +5,11 @@ # them and/or modify them under the terms of the MIT License; # see the LICENSE file for more details. +import dateutil.parser + from indico.core.plugins import IndicoPlugin from indico.modules.events.payment import PaymentPluginMixin +from indico.util.date_time import now_utc from indico_payment_sixpay.forms import EventSettingsForm, PluginSettingsForm @@ -47,3 +50,8 @@ class SixpayPaymentPlugin(PaymentPluginMixin, IndicoPlugin): """Blueprint for URL endpoints with callbacks.""" from indico_payment_sixpay.blueprint import blueprint return blueprint + + def is_pending_transaction_expired(self, transaction): + if not (expiration := transaction.data.get('Init_PP_response', {}).get('Expiration')): + return False + return dateutil.parser.parse(expiration) <= now_utc() diff --git a/payment_sixpay/setup.cfg b/payment_sixpay/setup.cfg index a2ed86a..3ee2ca8 100644 --- a/payment_sixpay/setup.cfg +++ b/payment_sixpay/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = indico-plugin-payment-sixpay -version = 3.1 +version = 3.1.1 description = SIXPay/Saferpay payments for Indico event registration fees long_description = file: README.md long_description_content_type = text/markdown; charset=UTF-8; variant=GFM