Credit cards are widely used and accepted in the financial sector all over the world. The latest trend is to use electronic payments and to go cashless. Unfortunately, these credit card-based online transactions and cashless payments invite online fraudsters, who then attack all forms of online payment, including shopping sites and banking services. According to polls, approximately 4 billion people are presently affected by credit card fraud detection, and by 2025, that figure is projected to increase to 8 billion. Concern for its detection has increased as a result of this worrying pace. Both research scholars and industry experts have contributed their effort in this area for this goal. When considering the credit card detection method, its detection largely becomes a difficult problem. Due mostly to its unstable nature and dependence on customer behaviour, and secondarily because the dataset is readily available and easily accessible. This causes the dataset to become imbalanced, which makes it harder for a researcher to find instances of credit card fraud. Implementations of data mining algorithms are suitable for overcoming such difficulties. As a result, applying the proposed thesis necessitates using the random forest, decision trees, logistic regression, and Naive Bayes. The paper also proposes the use of a stacking algorithm, which integrates the basic theories of decision trees, logistic regression, and random forests, in addition to datamining techniques. According to experimental study of the aforementioned classifiers, the stacking algorithm produced an optimum model with exact precisions and generated the greatest accuracy of 97.78%.