pragma solidity >=0.4.22 <0.7.0; contract Payment { address payable public owner; uint public price; constructor(uint _price) public { require(_price > 0); owner = msg.sender; price = _price; } modifier onlySufficientResources() { require(msg.value >= price, "Not enough resources!"); _; } //not recommended practice// function payService1() onlySufficientResources public payable { require(msg.value >= price); bool sent = owner.send(msg.value); require(sent, "Failed to send Ether"); } //not recommended practice// function payService2() onlySufficientResources public payable { require(msg.value >= price); owner.transfer(msg.value); } //currently recommended practice// function payService3() onlySufficientResources public payable { require(msg.value >= price); (bool success,) = owner.call{value:msg.value}(""); require(success, "Failed to send ETH"); } function kill() public { require(msg.sender == owner); selfdestruct(msg.sender); } }