Payment/Sixpay: Ignore pending status for expired txns

This commit is contained in:
Adrian Moennich 2022-05-30 11:39:12 +02:00
parent 10ceb00820
commit a89dc183fd
3 changed files with 13 additions and 1 deletions

View File

@ -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

View File

@ -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()

View File

@ -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