adds webhooks for giftcards (Z#23205473) (#5834)

* adds giftcard webhook events

* maps issuer_id of giftcard to organizer_id for logging

* adds new giftcard logtypes for transactions that aren't manual

* log_action calls cleanup

* drop acceptance webhook

* add acceptor_id to the giftcard transaction webhook event

* add missing log_action statements

* add new webhooks to docs

* fix tests

* fix linting
This commit is contained in:
Lukas Bockstaller
2026-02-11 12:51:09 +01:00
committed by GitHub
parent e2cb83ce28
commit 99c257d392
9 changed files with 179 additions and 30 deletions

View File

@@ -1646,6 +1646,13 @@ class GiftCardPayment(BasePaymentProvider):
'transaction_id': trans.pk,
}
payment.confirm(send_mail=not is_early_special_case, generate_invoice=not is_early_special_case)
gc.log_action(
action='pretix.giftcards.transaction.payment',
data={
'value': trans.value,
'acceptor_id': self.event.organizer.id
}
)
except PaymentException as e:
payment.fail(info={'error': str(e)})
raise e
@@ -1670,6 +1677,14 @@ class GiftCardPayment(BasePaymentProvider):
'transaction_id': trans.pk,
}
refund.done()
gc.log_action(
action='pretix.giftcards.transaction.refund',
data={
'value': refund.amount,
'acceptor_id': self.event.organizer.id,
'text': refund.comment,
}
)
@receiver(register_payment_providers, dispatch_uid="payment_free")