Now a day the usage of credit cards and net banking for online payments has dramatically increased. The most popular mode of online as well as regular purchase payments is through credit card and security of such transactions is also a major issue as frauds are increasing rapidly. In the existing scenario, fraud is detected after the transaction is done and it makes more difficult to find out fraudulent loses barred by issuing authority. In this paper, we observe the behaviour of credit card transactions using a Hidden Markov Model (HMM) and show how it detects frauds. An HMM is initially trained with the normal behaviour of transaction. If the present credit card transaction is not accepted by the trained HMM with enough high probability, then it declares as a fraudulent transaction. At the same time, we try to ensure that no genuine transactions are rejected.