Skip to content

Commit

Permalink
Change required for new function definition of ServerUtils.ParseQuery…
Browse files Browse the repository at this point in the history
…String()

New return value type Dictionary<string, object> instead of Dictionary<string, string>
  • Loading branch information
SnoopyPfeffer committed Jan 5, 2010
1 parent 2f606ea commit f9d724c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions addon-modules/mod-paypal/PayPalModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -357,11 +357,11 @@ public Hashtable UserPage(Hashtable request)
return reply;
}

internal static void debugStringDict(Dictionary<string,string> strs)
internal static void debugStringDict(Dictionary<string,object> strs)
{
foreach (KeyValuePair<string, string> str in strs)
foreach (KeyValuePair<string, object> str in strs)
{
m_log.Info("[PayPal] '" + str.Key + "' = '" + str.Value + "'");
m_log.Info("[PayPal] '" + str.Key + "' = '" + (string)str.Value + "'");
}
}

Expand All @@ -381,7 +381,7 @@ public Hashtable IPN(Hashtable request)
return reply;
}

Dictionary<string, string> postvals = ServerUtils.ParseQueryString((string) request["body"]);
Dictionary<string, object> postvals = ServerUtils.ParseQueryString((string) request["body"]);
string originalPost = (string) request["body"];

string modifiedPost = originalPost + "&cmd=_notify-validate";
Expand Down Expand Up @@ -420,14 +420,14 @@ public Hashtable IPN(Hashtable request)
// Handle IPN Components
try
{
if (postvals["payment_status"] != "Completed")
if ((string)postvals["payment_status"] != "Completed")
{
m_log.Error("[PayPal] Transaction not confirmed. Aborting.");
debugStringDict(postvals);
return reply;
}

if (postvals["mc_currency"].ToUpper() != "USD")
if (((string)postvals["mc_currency"]).ToUpper() != "USD")
{
m_log.Error("[PayPal] Payment was made in an incorrect currency (" + postvals["mc_currency"] +
"). Aborting.");
Expand All @@ -436,7 +436,7 @@ public Hashtable IPN(Hashtable request)
}

// Check we have a transaction with the listed ID.
UUID txnID = new UUID(postvals["item_number"]);
UUID txnID = new UUID((string)postvals["item_number"]);
PayPalTransaction txn;

lock (m_transactionsInProgress)
Expand All @@ -452,7 +452,7 @@ public Hashtable IPN(Hashtable request)
}

// Check user paid correctly...
Decimal amountPaid = Decimal.Parse(postvals["mc_gross"]);
Decimal amountPaid = Decimal.Parse((string)postvals["mc_gross"]);
if(System.Math.Abs(ConvertAmountToCurrency(txn.Amount) - amountPaid) > (Decimal)0.001)
{
m_log.Error("[PayPal] Expected payment was " + ConvertAmountToCurrency(txn.Amount) +
Expand Down

0 comments on commit f9d724c

Please sign in to comment.