Use the action hooks instead: wpdd_mandate_ready, wpdd_mandate_active, wpdd_payment_confirmed, wpdd_payment_paid_out, wpdd_subscription_created, wpdd_payment_failed, wpdd_subscription_create_failed, and wpdd_mandate_cancelled. All fire with ( $entry_id, $resource_id ). The reason to prefer these over reading wpdd_status meta directly is that the status field is deliberately monotonic — GoCardless doesn't guarantee event delivery order, so a new status only overwrites the stored one if it's equal or higher "priority" (a fixed ranking baked into the plugin, with terminal failures always winning regardless of order). A lower-priority event arriving late — say a billing_requests:fulfilled turning up after payments:confirmed already landed — is silently ignored rather than regressing the status. If your integration reads the raw meta value expecting it to reflect "the last webhook event," you'll occasionally be surprised; the action hooks fire on every meaningful transition and don't have this filtering.
