Page MenuHomePhabricator

adjust audit to catch Adyen script refunds?
Closed, ResolvedPublic

Description

It looks like recent script-initiated refunds may not be reaching Civi?

merch refstatus: SentForRefundstatus: Settledstatus: Refundedstatus: Refunded Bulkin Civi 4/11?CID
174933393.1Apr 4Apr 6Apr 10n/anocid=59433462
174938411.1Apr 4Apr 6Apr 10n/anocid=59434343
174933897.1Apr 3Apr 6Apr 10n/anocid=59433543
174933395.1Apr 4Apr 6Apr 10n/anocid=59433461
174935322.1Apr 3Apr 6Apr 10n/anocid=59433797
174922548.1n/an/an/aApr 6yescid=59432466
174991892.1n/an/an/aApr 6yescid=59442254
174984711.1n/an/an/aApr 6yescid=59441553
174991892.1n/an/an/aApr 6yescid=59442254

Refunded Bulk transactions seem to be the ones manually refunded by DR team at the console. If the audit normally picks up the script refunds in like 10 days I will resolve this task and pipe down.

Event Timeline

@MBeat33 I don't know why but the script refunds didn't get to refunded status until 4/10 as you saw. They were in the 4/10 audit file which ran 3 hours ago and the ones listed that were missing in civi now are properly showing as refunded.

It would be good to ask Adyen why the refunds initiated from the API took so much longer to get to refunded status.

MBeat33 triaged this task as Medium priority.Apr 12 2023, 8:25 PM

Thank you, @Cstone for the info. I will queue that question for next week's Adyen call.

I shared these transactions with Jake & he's looking into the gap in timing for refunds...

MBeat33 lowered the priority of this task from Medium to Low.May 8 2023, 10:23 PM

I sent these transactions to Adyen support, and they confirmed that similar notifications are being sent for the manual refunds + the API ones. Below are two notification logs they sent. This task is not a huge priority, so we can close it as below the threshold of need, unless it's a simple thing to change.

Notification Log #1

Timestamp: 2023-04-04T04:16:18.976Z

Endpoint: https://payments-listener.wikimedia.org/adyen

Request:

<?xml version="1.0" encoding="UTF-16"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
    <sendNotification xmlns="http://notification.services.adyen.com">
        <notification>
            <live>true</live>
            <notificationItems>
                <NotificationRequestItem>
                    <additionalData>
                        <entry>
                            <key xsi:type="xsd:string">bookingDate</key>
                            <value xsi:type="xsd:string">2023-04-04T06:16:09Z</value>
                        </entry>
                    </additionalData>
                    <amount>
                        <currency xmlns="http://common.services.adyen.com">USD</currency>
                        <value xmlns="http://common.services.adyen.com">200</value>
                    </amount>
                    <eventCode>REFUND</eventCode>
                    <eventDate>2023-04-04T06:15:24+02:00</eventDate>
                    <merchantAccountCode>WikimediaDonations</merchantAccountCode>
                    <merchantReference>174933395.1</merchantReference>
                    <originalReference>KFTDJK4FZQV4K472</originalReference>
                    <paymentMethod>discover</paymentMethod>
                    <pspReference>X8KVR5B5WF74MKG2</pspReference>
                    <reason/>
                    <success>true</success>
                </NotificationRequestItem>
            </notificationItems>
        </notification>
    </sendNotification>
</soap:Body>

</soap:Envelope>

Response:

<?xml version="1.0" encoding="UTF-16"?>
<SOAP-ENV:Envelope

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://notification.services.adyen.com">
<SOAP-ENV:Body>
    <ns1:sendNotificationResponse>
        <ns1:notificationResponse>[accepted]</ns1:notificationResponse>
    </ns1:sendNotificationResponse>
</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

Notification Log #2

Timestamp: 2023-04-06T17:10:49.038Z

URL: https://payments-listener.wikimedia.org/adyen

Request:

<?xml version="1.0" encoding="UTF-16"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
    <sendNotification xmlns="http://notification.services.adyen.com">
        <notification>
            <live>true</live>
            <notificationItems>
                <NotificationRequestItem>
                    <additionalData>
                        <entry>
                            <key xsi:type="xsd:string">bookingDate</key>
                            <value xsi:type="xsd:string">2023-04-06T19:10:20Z</value>
                        </entry>
                    </additionalData>
                    <amount>
                        <currency xmlns="http://common.services.adyen.com">USD</currency>
                        <value xmlns="http://common.services.adyen.com">300</value>
                    </amount>
                    <eventCode>REFUND</eventCode>
                    <eventDate>2023-04-06T19:09:30+02:00</eventDate>
                    <merchantAccountCode>WikimediaDonations</merchantAccountCode>
                    <merchantReference>174922548.1</merchantReference>
                    <originalReference>W4R4D9VQ7ZT3MKG2</originalReference>
                    <paymentMethod>visa</paymentMethod>
                    <pspReference>BMJWB6HQ8W329C32</pspReference>
                    <reason/>
                    <success>true</success>
                </NotificationRequestItem>
            </notificationItems>
        </notification>
    </sendNotification>
</soap:Body>

</soap:Envelope>

Response:

<?xml version="1.0" encoding="UTF-16"?>
<SOAP-ENV:Envelope

xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://notification.services.adyen.com">
<SOAP-ENV:Body>
    <ns1:sendNotificationResponse>
        <ns1:notificationResponse>[accepted]</ns1:notificationResponse>
    </ns1:sendNotificationResponse>
</SOAP-ENV:Body>

</SOAP-ENV:Envelope>

^ with the info Adyen sent back I created this ticket to handle refund ipns T336439: Handle Adyen refund IPNs
This should hopefully get them into civi faster

MBeat33 claimed this task.

Thank you, @Cstone