(a) When any bond, bill, or note for the payment of money or delivery of property shall not be paid by the principal debtor, according to the tenor thereof, and the bond, bill, or note, or any part thereof shall be paid by the security, the principal debtor shall refund to the security the amount or value, with interest thereon at the rate of ten percent (10%) per annum, from the time of payment.
(b)
(1) When the payment by a security shall be made in money, the security may recover the money with interest, in an action for so much money, paid to the use of the defendant.
(2) When payment is made in property, he or she may recover the value, with the interest, in an action for so much property sold to the defendant.