Example #1
0
        public static string ConstructResponse(string deviceId, string state, string appId)
        {
            string        message   = Defmessage;
            StringBuilder response  = new StringBuilder();
            string        signature = string.Empty;

            if (!string.IsNullOrEmpty(deviceId) &&
                (PaymentProcessor.GetTransactionStatusForDeviceAndApp(deviceId, appId) == TransactionStatus.Completed ||
                 paidDevieIds.Contains(deviceId, StringComparer.OrdinalIgnoreCase)))
            {
                message   = @"Congratulations. The app has been activated. If you get activation message again please upgrade to 1.2.0001 or higher. More info at http://www.iphonepackers.info/vissue.htm";
                signature = Shared.EncodeFile(Constants.ourKey, deviceId);
            }

            return(string.Format("stt={0}&msg={1}&sig={2}", state, message, signature));
            //return string.Format("stt={0}&msg={1}&sig={2}", "error", "you are successful!", "");
        }
Example #2
0
        public static string ConstructResponse(string deviceId, string state, string appId, string locale, bool debug, out TransactionStatus transactionStatus)
        {
            string        message   = string.Empty;
            StringBuilder response  = new StringBuilder();
            string        signature = string.Empty;

            transactionStatus = TransactionStatus.Failed;
            string debugInfo = "in construct response";

            if (!string.IsNullOrEmpty(deviceId))
            {
                debugInfo        += "device id non null, getting transactions status";
                transactionStatus = PaymentProcessor.GetTransactionStatusForDeviceAndApp(deviceId, appId, debug, ref debugInfo);

                if (transactionStatus == TransactionStatus.Completed ||
                    paidDevieIds.Contains(deviceId, StringComparer.OrdinalIgnoreCase))
                {
                    signature         = Shared.EncodeFile(Constants.ourKey, deviceId);
                    state             = Constants.successPaymentSatus;
                    message           = Shared.GetAppVerifyMessage(locale, true);
                    transactionStatus = TransactionStatus.Completed;
                }
                else
                {
                    state += transactionStatus;
                }
            }

            if (message == string.Empty)
            {
                message = Shared.GetAppVerifyMessage(locale, false);
            }

            if (!debug)
            {
                return(string.Format("stt={0}&msg={1}&sig={2}", state, message, signature));
            }

            return(string.Format("stt={0}&msg={1}&sig={2}&debug={3}", state, message, signature, debugInfo));
        }