diff options
| author | stuppie | 2026-09-18 11:15:19 -0600 |
|---|---|---|
| committer | stuppie | 2026-09-18 11:15:19 -0600 |
| commit | 82be325a1f73f1ec7734b64607a23b564cc5d2ac (patch) | |
| tree | a4e532f1a89d4b9c0c83a9aa3ee49c40f849a790 | |
| parent | 8006c422a34d3bc4645915ac18b43bef1b2432a4 (diff) | |
| download | generalresearch-82be325a1f73f1ec7734b64607a23b564cc5d2ac.tar.gz generalresearch-82be325a1f73f1ec7734b64607a23b564cc5d2ac.zip | |
handle_paypal_payout_webhook fixes
| -rw-r--r-- | generalresearch/managers/thl/paypal.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/generalresearch/managers/thl/paypal.py b/generalresearch/managers/thl/paypal.py index 7e33da0..e6154c8 100644 --- a/generalresearch/managers/thl/paypal.py +++ b/generalresearch/managers/thl/paypal.py @@ -270,20 +270,15 @@ def handle_paypal_payout_webhook( raise PayPalError("PayPal webhook signature verification failed") event_type = webhook_event.get("event_type", "") - if not event_type.startswith(("PAYMENT.PAYOUTSBATCH.", "PAYMENT.PAYOUTS-ITEM.")): + if not event_type.startswith("PAYMENT.PAYOUTS-ITEM."): return None resource = webhook_event.get("resource") if not isinstance(resource, dict): raise PayPalError("PayPal payout webhook has no resource") - sender_batch_header = resource.get("sender_batch_header") or {} payout_item = resource.get("payout_item") or {} - payout_event_uuid = ( - resource.get("sender_batch_id") - or sender_batch_header.get("sender_batch_id") - or payout_item.get("sender_item_id") - ) + payout_event_uuid = payout_item.get("sender_item_id") if not payout_event_uuid: raise PayPalError("PayPal payout webhook has no sender payout ID") |
