The currency in Switzerland is the Swiss franc (CHF). Some towns close to the French, German and Italian borders may accept euros alongside the local currency. Credit and debit cards are accepted at most places in Switzerland, but you may wish to have a backup card or some Swiss franc notes in case a card transaction fails.
At Swiss train stations close to the French border you may see blue SNCF ticket machines, next to red SBB machines. If you wish to pay in euros use the blue (French rail) machines, otherwise use the red (Swiss rail) ones to pay in Swiss francs. Similarly, near the German border any DB machines belong to the German rail company and will take payments in euros.