Hanson, acquired in the April 2 trade with the San Francisco Giants for outfielder Kevin Pillar, was off to a dismal start to his Blue Jays career, batting .163 with a .229 on-base percentage through 18 games.
He also had 17 strikeouts, three walks and one stolen base.
Law, also acquired by Toronto in the Pillar deal, has posted a 1.69 earned-run average across 10 2/3 innings with 17 strikeouts and three walks for the Buffalo Bisons.
The 28-year-old has a 9-3 record with a 3.83 ERA and 97 strikeouts through 105 2/3 major league innings.
The Blue Jays announced both moves before their Friday night game against the Rangers in Texas.