Skip to content

Commit

Permalink
Create fraud_detection.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Dec 1, 2024
1 parent 98ff532 commit 16aa72f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/payment/fraud_detection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class FraudDetection:
def __init__(self):
self.transaction_history = []

def log_transaction(self, payment):
self.transaction_history.append(payment)

def detect_fraud(self, payment):
# Simple fraud detection logic based on transaction patterns
if payment.amount > 10000: # Example threshold
print(f"Fraud alert! High transaction amount detected: {payment.amount} from {payment.payer}.")
return True
return False

0 comments on commit 16aa72f

Please sign in to comment.