I’m using OAuth2 for users to login into my website.
To verify the user is an actual paying member, I am checking both patron_status
and last_charge_status
for active_patron
and Paid
respectively (I’ve noticed in the past that patron_status
sometimes did not update for people with declined charges).
However, the last_charge_status
field is lagging behind the actual status of the latest charge, I’ve noticed a (relatively consistent) delay of up to 30 minutes.
This delay is even visible in the normal Dashboard. Here’s an example of a new Patron who was still Pending in the overview (which probably uses last_charge_status
) but the charge in the history is already paid.
(Excuse the weird format, I can only upload one image due to new user restrictions, so I had to improvise a bit)
The charge of the example above:
{
"amount_cents": 1875,
"currency": "SEK",
"date": "2024-01-20T12:16:01.000+00:00",
"is_refundable": true,
"partial_annual_refund_data": { ... },
"status": "Paid",
"supported_period_end": "2024-02-01T08:00:00.000+00:00",
"supported_period_start": "2024-01-01T08:00:00.000+00:00",
"underlying_charge_id": "...",
"underlying_charge_type": "patronage_purchase"
}
As you can see, the charge was created at 12:16:01. However my server logs report last_charge_status
was still Pending
until as late as 12:35:48 (response from a call to https://www.patreon.com/api/oauth2/v2/identity?include=memberships&fields%5Bmember%5D=patron_status%2Cnext_charge_date%2Clast_charge_status
):
{
"data": {
"attributes": {},
"id": "...",
"relationships": {
"memberships": {
"data": [
{
"id": "...",
"type": "member"
}
]
}
},
"type": "user"
},
"included": [
{
"attributes": {
"last_charge_status": "Pending",
"next_charge_date": "2024-02-20T00:00:00.000+00:00",
"patron_status": "active_patron"
},
"id": "...",
"type": "member"
}
],
"links": {
"self": "https://www.patreon.com/api/oauth2/v2/user/..."
}
}
However, the last charge was already paid at the latest by 12:27, which is when the Patron contacted me and I took the screenshots above.
Because I only log failed auth attempts, I don’t know when exactly the status finally updated, but it was outdated for at least 8 minutes. (I re-checked the dashboard at 12:42 and it was finally up-to-date).