Fathering illegitimate child can happen when you're in a relationship with your legally wedded spouse. It means you're committing an adulterous relationship. An adultery is a crime in Indonesia under Article 284 of Criminal Code. We called it Delik Aduan, meaning that it's an absolute complaint offence. They can only bring you to justice if your spouse file charges against you. The definition of an adultery is sexual intercourse committed by a married man or a married woman, must be consensual, and either of you are not legally free to marry. Your spouse may file charges against you, but he/she is the only one that may revoke it.
The child, should you want to keep it, is an out of wedlock child. It means he/she is born out of legal marriage. Under the 1999 Human Rights Law, the child has the rights to know his/her parents, to be nurtured and raised by his/her own parents. So, keeping the child alive is a good choice. It's your flesh and blood. Abortion is the last thing you want to do. So don't do it, for God sake! Don't do the abortion. Do the DNA test. If the child was yours, acknowledge it and proceed with child legalization.
According to the ruling from the Constitutional Court number 466/PUU-VIII/2010 and since the verdict was reached on Feb. 17, 2012, child born out of wedlock has legal relationship not only with its mother and her family, but also with its father and his family. Claims towards the child must be consented by the mother. This must be done before you pursue child legalization. Going further with child legalization requires DNA test, and must be supported by other evidentiary proof to support it.
The birth certificate for a child born out of wedlock has mother's name only. You won't see your name as the father before you're conducting child acknowledgment and child legalization thereafter. When you're taking a DNA test, you need to make sure that the results of the test is being signed by the accredited medical practitioner in the business. You need to make sure no clause that may prevent or lies legal constraint during the proceeding of child legalization.