I have 3 points
- your boss has said 'unless I can explain why it took so long I won't be getting paid'
your boss has said 'unless I can explain why it took so long I won't be getting paid'. You have clearly explained here why it took longer, explain in the same way to him.
They cannot reasonably ask you to refactor something without giving you feedback as to why it needs to be refactored, i.e. what it is you did wrong the first time. From this you can then extrapolate how to make it better. If they just asked you to refactor it without giving you feedback then you need to raise this as a problem.
It would be highly unusual and nearly always illegal for a salaried employee with an employment contract to have his pay docked for not delivering software on time. At worst you could get a written warning.
you have clearly explained here why it took longer, explain in the same way to him.
2)They cannot reasonably ask you to refactor something without giving you feedback as to why it needs to be refactored, i.e. what it is you did wrong the first time. From this you can then extrapolate how to make it better. If they just asked you to refactor it without giving you feedback then you need to raise this as a problem.
3)It would be highly unusual and nearly always illegal for a salaried employee with an employment contract to have his pay docked for not delivering software on time. At worst you could get a written warning. You should speak to HR or a lawyer.