From 8e605b760c689dc0649f92a482cc4560be2bbf1c Mon Sep 17 00:00:00 2001
From: moodler <moodler>
Date: Tue, 22 Sep 2009 01:53:39 +0000
Subject: [PATCH] paypal MDL-20322 Make sure the currency is set correctly.

---
 enrol/paypal/ipn.php | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/enrol/paypal/ipn.php b/enrol/paypal/ipn.php
index bcfba8fe39..677cccdb1f 100644
--- a/enrol/paypal/ipn.php
+++ b/enrol/paypal/ipn.php
@@ -98,6 +98,13 @@
                 die;
             }
 
+            // If currency is incorrectly set then someone maybe trying to cheat the system 
+
+            if ($data->mc_currency != $course->currency) {
+                email_paypal_error_to_admin("Currency does not match course settings, received: ".addslashes($data->mc_currency), $data);
+                die;
+            }
+
             // If status is pending and reason is other than echeck then we are on hold until further notice
             // Email user to let them know. Email admin.
 
-- 
2.39.5