Online credit card fraud (CCF) is an ongoing problem and with a recent surge of merchants moving their businesses online, it is crucial to identify fraudulent transactions before they cause losses to both banks and customers. Due to the dynamic nature of fraudsters and customer spending behavior (CSB), machine learning (ML) algorithms are appropriate for this task. However, CCF data are typically imbalanced, favoring non-fraudulent transactions, causing traditional ML algorithms to err on the side of this majority class, since they consider equal costs and benefits for different decision outcomes when training. Nevertheless, it is more beneficial to correctly identify fraudulent transactions. Therefore, we propose a technique for identifying CCF that accounts for CSB by aggregating periodic transactions to create new features. We also consider benefits and costs when training and evaluating the performance of XGBoost classifiers. We demonstrate the effectiveness of our approach using data provided by a bank.