RAIL commuters were prevented from buying tickets from machines during the morning rush hour after a technical glitch.

A number of passengers who were affected reported missing their trains because of long queues at ticket offices.

ScotRail apologised to customers and said that credit card transactions were hit.

There were no further details about a potential hack of the system.

The firm also "experienced some problems across our estate due to a UK-wide server issue that was rectified at 8.17am".

A ScotRail Alliance spokesperson said: "We are sorry that some customers were inconvenienced by this problem. Customers should speak to station or on-train staff if they're still experiencing difficulties purchasing tickets."

A spokesman for the Rail Delivery Group, which represents train companies, said: "We're sorry that some customers were inconvenienced by a technical fault affecting one supplier's system which meant that some train companies' ticket machines, not all, couldn't authorise card payments.

"The problem was fixed before 9am."

At Waverley and Queen Street stations on-screen messages said they had "no online connectivity", making them unable to send payment card details.

The issue began at about 6am.

Meanwhile, a train station in West Lothian which is only used by three passengers a week is being threatened with closure.

Breich Station, an unmanned stop on the Edinburgh-Glasgow line via Shotts, would be the first Scottish station shut in 31 years.

A 12-week consultation will open on July 10 with views being sought from rail users and the local community.

It is currently served by one train service per day in each direction, six days a week.

The official footfall figure for the station in 2015-16 was 138 passengers, an average of 2.6 passengers per week.

The Shotts route is currently being modernised as part of a programme of electrification,

Network Rail estimates that a saving of £1.4m could be made if the Scottish government opted to close the station rather than modernise it.

Breich is between Addiewell to the east and Fauldhouse to the west, with both towns already served by railway stations.