Paypal2: handle incomming capture webhooks (Z#23240966) (#6456)

* store the state of the payment regardless of the state

control.html shows the banner that the payment is in review depending on payment.info

* handle capture ressource

* Update src/pretix/plugins/paypal2/views.py

Co-authored-by: Phin Wolkwitz <wolkwitz@pretix.eu>

* add test

* cleanup logic regarding uninteresting resource_type

* store payment.info during _execute_payment asap

---------

Co-authored-by: Phin Wolkwitz <wolkwitz@pretix.eu>
This commit is contained in:
Lukas Bockstaller
2026-08-06 15:06:20 +02:00
committed by GitHub
co-authored by Phin Wolkwitz
parent ea792e76b2
commit 4d9dfa88fe
3 changed files with 12 additions and 7 deletions
+2
View File
@@ -677,6 +677,8 @@ class PaypalMethod(BasePaymentProvider):
raise PaymentException(_('We had trouble communicating with PayPal'))
else:
pp_captured_order = response.result
payment.info = json.dumps(pp_captured_order.dict())
payment.save()
try:
ReferencedPayPalObject.objects.get_or_create(order=payment.order, payment=payment, reference=pp_captured_order.id)