If neither party makes application pursuant to ยง 20-4-7 or ยง 20-4-8 within a reasonable time after performance, the performance must be applied to the extinction of obligations in the following order; and if there be more than one obligation of a particular class, to the extinction of all in that class, ratably:

(1) Of interest due at the time of the performance;

(2) Of principal due at that time;

(3) Of the obligation earliest in date of maturity;

(4) Of an obligation not secured by a lien or collateral undertaking;

(5) Of an obligation secured by a lien or collateral undertaking.

Source: CivC 1877, ยง 833, subdiv 3; CL 1887, ยง 3457, subdiv 3; RCivC 1903, ยง 1150, subdiv 3; RC 1919, ยง 757 (3); SDC 1939, ยง 47.0207 (3).