Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
        public string PurchaseGameCurrencyCreditCard(string transactionId, string piUserId, string hangoutUserId, string sessionGuid, string emailAddress, string offerId, CreditCardInfo creditCardInfo, string ipAddress, string baseServicesRoot)
        {
            PaymentCommand paymentCommand = CreatePurchaseGameCurrencyCreditCard(transactionId, piUserId, offerId, creditCardInfo, ipAddress);

            MoneyTransactionLogging moneyLog = new MoneyTransactionLogging();

            moneyLog.LogMoneyPaymentCommand(hangoutUserId, sessionGuid, paymentCommand.Parameters, emailAddress, "CreditCard");

            XmlDocument xmlResponse = ProcessPaymentItem(paymentCommand, baseServicesRoot);

            moneyLog.CreditCardLogResponse(xmlResponse);

            return(ParseCreditCardResult(xmlResponse));
        }