Credit cards are increasingly being used in real life for a wide variety of purposes. Because of the growing number of users, the number of scammers is also growing at an accelerating rate. E-commerce fraud detection methods are critical for reducing losses. Models developed in the past using unbalanced datasets show a high degree of accuracy. The precision, recall, and weighted average precision and recall are all quite low for the models. As a result of this research, techniques such as logistic regression (LR) and random forest (RF), along with SMOTE, were developed to increase the model's performance with imbalanced datasets. SMOTE techniques are used to balance the datasets because they are so unbalanced. SMOTE analysis has revealed that the RF with SMOTE is the best model for detecting credit card fraud, with accuracy, precision, and recall scores of 99.95%, 85.40%, 86.02%, and 85.71%, respectively.