Put simply, every believer was voluntarily bringing land and money and giving them to the apostles to share within the community of believers in Jerusalem. However, it appears that after Ananias and Sapphira sold their land, they did not bring all the money to the apostles but kept back some of it for themselves. However, it appears that they gave the impression that they were giving all of it. In this sense, they were lying.
Sapphira was tested separately by Peter. When she came, Peter gave her the opportunity to fess up. When he asked her about the price they got for the land, she could have been honest and corrected the amount to the real amount they received; however, she continued to affirm the lie.
Now, while we don't have this kind of immediate divine retribution taking place today, we must understand that this was the inauguration of the church. Just as God employed signs and wonders through the apostles in these early days, this divine act was just part and parcel with all God was doing to authenticate the eye-witness apostolic testimony of the resurrection of Christ.