Walmart Inc. has agreed to pay a total penalty of $282 million to settle charges by the U.S. Justice Department and the Securities & Exchange Commission that its Brazilian unit violated the Foreign Corrupt Practices Act.