Shopify/offsite_payments — pull request #82 by celsodantas (2014-08-29 19:13:54+00:00)
Title: PagSeguro invalid acknowledge notification

@odorcicd who else to ping?

**TLDR**; If the shop's token is no longer valid and PagSeguro sends us a ping, we should ignore it.

When PagSeguro sends us a notification (a ping), they just send us a code. We need to do a request back to them to get info about the ping (we need to use the Shop's token for that). If the token is no longer valid, this request fails with HTTP response code `401`.

You can try with:

`curl -I https://ws.pagseguro.uol.com.br/v2/transactions/notifications/766B9C-AD4B044B04DA-77742F5FA653-E1AB24\?email\=suporte@lojamodelo.com.br\&token\=95112EE828D94278BD394E91C4388F20`

It returns a text, no XML, plus the status code.

## Solution

Store a acknowledge status if the request is no `200` and make the acknowledge method return false. It will make Shopify ignore the request.