mirror of
https://github.com/pretix/pretix.git
synced 2026-05-05 15:14:04 +00:00
Add OrderPayment.fail() to prevent race conditions (#1572)
This commit is contained in:
@@ -359,12 +359,7 @@ class Paypal(BasePaymentProvider):
|
||||
return
|
||||
|
||||
if payment.state != 'approved':
|
||||
payment_obj.state = OrderPayment.PAYMENT_STATE_FAILED
|
||||
payment_obj.save()
|
||||
payment_obj.order.log_action('pretix.event.order.payment.failed', {
|
||||
'local_id': payment.local_id,
|
||||
'provider': payment.provider,
|
||||
})
|
||||
payment_obj.fail(info=str(payment))
|
||||
logger.error('Invalid state: %s' % str(payment))
|
||||
raise PaymentException(_('We were unable to process your payment. See below for details on how to '
|
||||
'proceed.'))
|
||||
|
||||
Reference in New Issue
Block a user