Example #1
0
        public static GoogleWalletInfo GetReviewGoogleWalletInfoFrom(IResultResponse response, Cart cart)
        {
            var result = new GoogleWalletInfo();

            try
            {
                var match = ReviewGoogleWalletRegex.Match(response.RawData);
                if (match.Success)
                {
                    var script = match.Groups["script"].Value;

                    result.FWRequestJwt = GetScriptVariable(script, "var fwRequestJwt = '", "'");
                    result.CWRequestJwt = GetScriptVariable(script, "var cwRequestJwt = '", "'");
                    result.TrackJwt     = GetScriptVariable(script, "var trackJwt = \"", "\"");

                    result.DisableCheckout = cart.ExceedsMaxForGoogleWallet;
                }
            }
            catch
            {
            }

            return(result);
        }
Example #2
0
        public static GoogleWalletInfo GetCartGoogleWalletInfoFrom(IResultResponse response, Cart cart)
        {
            var result = new GoogleWalletInfo();

            try
            {
                var match = CartGoogleWalletRegex.Match(response.RawData);
                if (match.Success)
                {
                    var script = match.Groups["script"].Value;

                    result.MWRequestJwt    = GetScriptVariable(script, "var mwRequestJwt = \"", "\"");
                    result.PreauthFlow     = GetScriptVariable(script, "var preauthFlow = ", ";").Equals("true");
                    result.ClientId        = GetScriptVariable(script, "var clientId = \"", "\"");
                    result.DisableCheckout = GetScriptVariable(script, "var disableCheckout = ", ";").Equals("true") || cart.ExceedsMaxForGoogleWallet;
                    result.TrackJwt        = GetScriptVariable(script, "var trackJwt = \"", "\"");
                }
            }
            catch
            {
            }

            return(result);
        }