In general i think it would be better for the structure to have a method for each endpoint of privacyIDEA:
string pollTransaction(string transactionid)
string validateCheck(string username, string otp, ....)
etc.
This would move the setup of each API call away from the general control flow of the provider to make it more readable.