mirror of
https://github.com/lucaspalomodevelop/indico-plugins.git
synced 2026-03-12 23:27:22 +00:00
Payment/Sixpay: Ignore pending status for expired txns
This commit is contained in:
parent
10ceb00820
commit
a89dc183fd
@ -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
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user