WASHINGTON — The Supreme Court says states can force online shoppers to pay sales tax. The 5-4 ruling Thursday is a win for states, who said they were losing out on billions of dollars annually under a two decades-old Supreme Court decisions that affected online sales tax collection. The high court ruled Thursday to overturn those decisions. “The Internet’s prevalence and power have changed the dynamics of the national economy,” the court said in its decision in the case, South Dakota v. Wayfair. The previous law resulted in some companies not collecting sales tax on every online purchase. The cases the court overturned said that if a business was shipping a product to a state where it didn’t have a physical presence such as a warehouse or office, it didn’t have to collect the state’s sales tax. Customers were generally supposed to pay the tax to the state themselves if they were not charged by the merchant, but the vast majority of consumers did not. The decision has major implications for online retailers, including Amazon.