Facebook will have to defend itself in a class action lawsuit seeking to force it to provide refunds when children make purchases on its site without their parents’ permission, a judge has ruled.

The decision, from Judge Beth Labson Freeman of the federal district court in San Jose, California, could lead to a change in how Facebook handles payments made by minors on or through its site.

The suit was brought on behalf of two children and their parents in 2012, and claims that Facebook’s terms for refunds violate California state law. A trial is set for Oct. 19.

Both children made purchases using the company’s Facebook Credits virtual currency. One asked his mother for $20 to make purchases in the game “Ninja Saga,” but ended up spending several hundred dollars, thinking the virtual currency wouldn’t result in real-world charges. The mother asked for a refund but was denied one until after the suit was filed. The other child took the parent’s debit card without permission and racked up charges totaling over $1,000. That child’s parent has received a refund of $59.90, according to a court filing Tuesday.

Facebook says it will grant refunds on a case-by-case basis, and that people under 18 can use Facebook Payments only with their parents’ permission.

The plaintiffs argue that its policies do not do enough to protect minors. Specifically, they seek protections under California law, which recognizes that minors may not exercise proper judgement when entering into contracts, and which can be voided if they involve personal property the child does not own.

Because Facebook cites California law in its own policies, minors can invoke the law regardless of where they live, Judge Freeman wrote in her decision.

The certified class includes potentially millions of Facebook users who were minors between 2008 and 2015.

Plaintiffs say their lawsuit is about requiring Facebook to amend its policies to comply with California law, rather than ending its sales to minors. Facebook stopped offering its Credits currency in 2013, replacing it with Facebook Payments.

Kristine Van Hamersveld, an attorney for Facebook, declined to comment on the case Wednesday.

The claims against Facebook aren’t unique. Apple, Amazon and Google have been accused of billing parents for unauthorized in-app purchases made by kids.