Page MenuHomePhabricator

Manually captured gravy transaction pending messages already set to resolved before the capture IPN comes in
Closed, ResolvedPublic

Description

Example flow:
Adyen credit card donation through gravy
Gets stuck at auth
Donor relations manually captures it

Gravy does send us an IPN when this happens, but it looks like the pending message is already set to resolved somehow

Example:
245656263.1
170e6f4c-70da-4ebb-8222-5997257526ff

fundraising-misc-20260321.gz:Mar 20 20:05:05 civi1002 SmashPig-Gravy-QueueJobRunner: SPCID-1549955861 | Message: {

"class": "SmashPig\\PaymentProviders\\Gravy\\Jobs\\RecordCaptureJob",
"payload": {
    "eventDate": "2026-03-20T20:05:04.825709+00:00",
    "is_successful": true,
    "gateway_txn_id": "170e6f4c-70da-4ebb-8222-5997257526ff",
    "amount": 5.35,
    "currency": "EUR",
    "order_id": "245656263.1",
    "raw_status": "capture_succeeded",
    "status": "complete",
    "raw_response": {
        "type": "transaction",
        "id": "170e6f4c-70da-4ebb-8222-5997257526ff",
        "external_identifier": "245656263.1",
        "payment_service_transaction_id": "R8Q5RW8JQM7C79B9",
        "status": "capture_succeeded",
        "has_gift_card_redemptions": false,
        "pending_review": false,
        "amount": 535,
        "authorized_amount": 535,
        "captured_amount": 535,
        "refunded_amount": 0,
        "currency": "EUR",
        "metadata": null,
        "created_at": "2026-03-19T08:35:56.231113+00:00",
        "updated_at": "2026-03-20T20:05:04.565047+00:00",
        "payment_method": {
            "id": "710f184c-c932-490a-a54e-d3baa7a2920e",
            "method": "card"
        },
        "payment_link_id": null,
        "error_code": null,
        "iso_response_code": null,
        "payment_source": "recurring",
        "merchant_initiated": false,
        "is_subsequent_payment": false
    },
    "risk_scores": [],
    "recurring_payment_token": "710f184c-c932-490a-a54e-d3baa7a2920e",
    "payment_method": "cc",
    "payment_submethod": "",
    "backend_processor": null,
    "backend_processor_transaction_id": "R8Q5RW8JQM7C79B9",
    "payment_orchestrator_reconciliation_id": null
},
"source_name": "SmashPig",
"source_type": "listener",
"source_host": "frpig1002",
"source_run_id": 1456390,
"source_version": "5d8a033046dabf500205b5ac4570da257050a64c",
"source_enqueued_time": 1774037104

fundraising-misc-20260321.gz:Mar 20 20:05:05 civi1002 SmashPig-Gravy-QueueJobRunner: SPCID-1549955861 | (corr_id-gravy-245656263.1) Processing captured Gravy payment with authorization reference '170e6f4c-70da-4ebb-8222-5997257526ff' and order ID '245656263.1'. | |

fundraising-misc-20260321.gz:Mar 20 20:05:05 civi1002 SmashPig-Gravy-QueueJobRunner: SPCID-1549955861 | (corr_id-gravy-245656263.1) Could not find donor details for authorization Reference '170e6f4c-70da-4ebb-8222-5997257526ff' and order ID '245656263.1'. | |

Event Timeline

We should probably start looking up the pending message with the function the audit uses, that ignores the resolved flag

EDIT: Looks like that's being done via the new Civi-level entity pointing at the pending table, not via PendingDatabase function which still filter by resolved=0

XenoRyet set Final Story Points to 2.