This study analyzes synthetic financial datasets from Kaggle for fraud detection. The XGBoost algorithm integrated with the techniques of SMOTE sampling method and Bayesian hyperparameter optimization, is hence proposed to separate fraud transactions from non-fraud transactions. The experimental results show that our proposed method is the best predictor. Our method establishing fraud detection models for helping those people who lack the machine learning domain expertise in the banking industry detect abnormal transactions as soon as possible and carry out risk management.