The transaction_fraud_detection
project is aimed at developing a system for detecting fraudulent transactions in financial data. It utilizes a set of rules to identify potentially fraudulent activities.
- Customizable parameters for configuring rules.
- Easy integration with new rules.
- Helper to upload new transactions from CSV files in the database.
To set up the project locally, follow these steps:
- Clone the repository:
git clone https://github.com/phrsouza/transaction_fraud_detection.git
- Run setup script:
bin/setup
- Start api server:
docker-compose up api
- Request transactions endpoint:
curl -v -X POST localhost:3000/transactions \
-H 'Content-Type: application/json' \
-d '{"transaction_id":2342357, "merchant_id":29744, "user_id":97051, "card_number":"434505******9116", "transaction_date":"2019-11-31T23:16:32.812632", "transaction_amount":373, "device_id":285475}'
This project contain a set of rules to identify frauds that can be found on rules directory. The rules parameters can be adjusted in the rules file or through env vars.
AntiFraudRules::UserTransactionsExceeded
: verify if the user requested a transaction right before requesting another.AntiFraudRules::UserPreviousChargeback
: verify if the trasaction user had a chargeback previouly.AntiFraudRules::UserTransactionsExceeded
: verify if the user requested a transaction right before requesting another
Yu can fin the complete data analysis of the uploaded dataset at https://gist.github.com/phrsouza/99fbcff5ce9829a65843bc058fd791ec.
This project is deployed to https://transaction-fraud-detection-ukv3.onrender.com whenever the default branch is updated. See the render.yaml file for more details.
You can test it running the following command:
curl -v -X POST https://transaction-fraud-detection-ukv3.onrender.com/transactions \
-H 'Content-Type: application/json' \
-d '{"transaction_id":2342357, "merchant_id":29744, "user_id":97051, "card_number":"434505******9116", "transaction_date":"2019-11-31T23:16:32.812632", "transaction_amount":373, "device_id":285475}'
The api documentation can be found at: https://transaction-fraud-detection-ukv3.onrender.com/apipie.
This project is licensed under MIT License.
For inquiries or support, please contact:
- Project Maintainer: phrsouza
- Project Homepage: https://github.com/phrsouza/transaction_fraud_detection
Feel free to open an issue for bug reports or feature requests.