The methods of online transaction fraud have never-ending changes and improvement. The classification accuracy of the static fraud detection model is reduced and the generalization ability of the model cannot be guaranteed. The focus of online transaction fraud detection is to make the classifier adapt to the new and old fraud concepts at the same time and to fully learn enough fraud characteristics. Therefore, this paper proposes a data stream classification algorithm based on cosine similarity to replay data (CSDR). Compare the cosine similarity between the data distribution after replaying the fraud concept data and the currently known data distribution to determine the amount of replay data at each moment of concept drift. Retain as much of the data distribution of the fraud concept as possible. To solve the problem of imbalance within the class, use the clustering over-sampling method to balance the dataset. Experiments on the credit card transaction data set show that the CSDR algorithm uses a single classifier to adapt to sudden and recurring concept drift. It has a higher average accuracy rate, lower replay data volume and model update time.