Problem with Membership Gateway

I am creating a gateway for UOL PagSeguro, the transaction is recorded correctly, but I am not able to enroll in the plan.

This is the correct function?
do_action('membership_payment_processed', $user_id, $sub_id, $amount, $currency, $_POST['TransactionID']);

What could be happening to him not enroll in the plan? The data are correct, they checked with the database.