In actions brought on bonds or agreements for the payment of money, or with collateral conditions, and recovery had by the plaintiff, the judgment shall be entered for the stipulated penalty, to be discharged by the payment of the principal and interest due thereon, or the damages assessed by the jury, and execution shall issue accordingly.