The digital invasion of the banking and financial sectors made life simple and easy. Traditional machine learning models have been studied in credit card fraud detection, but these models are often difficult to find effective for unseen patterns. This study proposes a combined framework of deep learning and machine learning models. The long short term memory autoencoder (LSTMAE) with attention mechanism is developed to extract high-level features and avoid overfitting of the model. The extracted features serve as input to the powerful ensemble model XGBoost to classify legitimate and fraudulent transactions. As the focus of fraud detection is to increase the recall rate, an adaptive threshold technique is proposed to estimate an optimal threshold value to enhance performance. The experiment was done with the IEEE-CIS fraud detection dataset available in Kaggle. The proposed model with optimal threshold has an increase in predicting fraudulent transactions. The research findings are compared with conventional ensemble techniques to find the generalization of the model. The proposed LSTMAE-XGB w/ attention method attained a good precision and recall of 94.2 and 90.5%, respectively, at the optimal threshold of θ = 0.22. The experimental results proved that the proposed approach is better at finding fraudulent transactions than other cutting-edge models