All you have to do is ask God for forgiveness, and you did the right thing by not lying to your husband about the extra affair you had outside your marriage, just go on your needs before God confess ur sins and like the bible says that when we confess our sins he is faithful and just to forgive us, because he is a forgiving God, after confessing to God ask God to speak to ur husband's heart so he can forgive u and forget about what you did. After praying the prayer go to your husband on ur bended knees and ask him to forgive u and let him know that you have been praying to God for forgiveness, if after begging and he is still upset don't le tthat bothers u, try and try again.
I will be praying for you.