public string PayPalCallBack(string xmlInfo, string baseServicesRoot) { string response = ""; try { XmlDocument callBackInfo = new XmlDocument(); callBackInfo.LoadXml(xmlInfo); MoneyTransactionLogging moneyLog = new MoneyTransactionLogging(); moneyLog.PayPalLogResponse(callBackInfo, "CallBackBegin"); XmlDocument callBackResponse = ProcessCallBack(xmlInfo, baseServicesRoot); moneyLog.PayPalLogResponse(callBackResponse, "CallBackComplete"); response = parseCallBackResponse(callBackResponse); } catch (Exception ex) { mErrorLogger.Error("PayPalCallBack Error", ex); } return(response); }
/// <summary> /// Check if this is a special response /// If a special response then call the special response handler to modify the response xml /// </summary> /// <param name="responseData">The PaymentItems response string xml data</param> /// <returns>The response string xml data, modified if a special response else the inputed xml data</returns> public XmlDocument SpecialResponse(XmlDocument response, string noun, string verb, ServerStores serverStores) { MoneyTransactionLogging moneyLog = new MoneyTransactionLogging(); Dictionary <string, string> specialResponses = new Dictionary <string, string>(); specialResponses.Add("GetUserInventory", "HangoutUsers"); specialResponses.Add("PurchaseGameCurrencyPayPal", "HangoutPurchase"); specialResponses.Add("PurchaseGameCurrencyCreditCard", "HangoutPurchase"); specialResponses.Add("PurchaseItems", "HangoutUsers"); string value = SpecialCommand(noun, verb, specialResponses); switch (value) { case "GetUserInventory": response = PaymentItemsSortFilter.AddItemsToUserInventory(response, serverStores); break; case "PurchaseItems": response = PaymentItemsSortFilter.AddAssetsToPurchaseResponse(response, serverStores); break; case "PurchaseGameCurrencyPayPal": moneyLog.PayPalLogResponse(response, "InProgress"); break; case "PurchaseGameCurrencyCreditCard": moneyLog.CreditCardLogResponse(response); break; } return(response); }
public string PurchaseGameCurrencyPayPal(string piUserId, string hangoutUserId, string sessionGuid, string emailAddress, string offerId, string ipAddress, string baseServicesRoot) { PaymentCommand paymentCommand = CreatePurchaseGameCurrencyPayPal(piUserId, offerId, ipAddress); MoneyTransactionLogging moneyLog = new MoneyTransactionLogging(); moneyLog.LogMoneyPaymentCommand(hangoutUserId, sessionGuid, paymentCommand.Parameters, emailAddress, "Paypal"); XmlDocument xmlResponse = ProcessPaymentItem(paymentCommand, baseServicesRoot); moneyLog.PayPalLogResponse(xmlResponse, "InProgress"); string paypalURL = xmlResponse.SelectSingleNode("/Response/paypalURL").InnerText; return(paypalURL); }