Online credit card fraud is an ongoing problem and with the recent COVID-19 pandemic, there has been a surge of merchants moving their businesses online. It is therefore crucial to identify fraudulent activities before it causes loss to both the bank and its customers. Due to the dynamic nature of fraudsters as well as customer spending behavior, machine learning algorithms are appropriate for this task. However, credit card fraud data is typically imbalanced, favoring the positive class (legitimate transactions), causing traditional machine learning 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, in this paper, we propose a technique for identifying credit card fraud that first accounts for customer spending patterns by aggregating transactions to creative new features based on periodic data. Then, we consider benefits and costs when training an XGBoost classifier in order to achieve maximum benefits. We also evaluate the performance of the classifier using benefits and costs. We demonstrate the effectiveness of our approach using data provided by a bank.