示例#1
0
    void Start()
    {
        ballManager      = GetComponent <BallManager> ();
        am               = GameObject.Find("AudioManager").GetComponent <AudioManager> ();
        aam              = GetComponent <AimAssistManager> ();
        textManager      = GetComponent <TextManager> ();
        serialMan        = GetComponent <SerialManager> ();
        displayMan       = GetComponent <DisplayManager> ();
        analyticsManager = GetComponent <AnalyticsManager> ();
        ccProcessing     = GetComponent <CreditCardProcessing> ();

        queueManager = GameObject.Find("QueueManager").GetComponent <QueueManager>();

        CheckDebugInfoLog();

        gameTimer += 5;

        displayMan.EnableStandbyCamera();
        textManager.tutorialScreenDollarsText.text = "$" + dollarsInserted.ToString() + "/$" + dollarsNeededToPlay.ToString();
        standbyText.SetActive(true);

        SwitchGameMode(GameMode.STANDBY);
    }
        //string optin,string fax,string altcity,
        private object[] ChargeCard(string memberid, string salutation, string firstname, string middleinitial, string lastname, string suffix,
                                    string professionaltitle, string email, string businessname, string address1, string address2, string address3,
                                    string city, string state, string postalcode, string country,
                                    string phone,
                                    string ccnumber, string expmonth, string expyear, string amount,
                                    string ccname, string ccaddr, string cccity,
                                    string ccstate, string cczip, string cccountry, string pubcode, string username, string password, string refreshcustomer)
        {
            int    response_code = 0;
            string routing_id    = string.Empty;
            string auth_code     = string.Empty;

            #region convert string input to correct types
            bool  b_optin           = false;
            short s_expmonth        = 0;
            short s_expyear         = 0;
            float f_amount          = 0.0f;
            bool  b_refreshcustomer = false;

            /*if (!bool.TryParse(optin, out b_optin))
             * {
             *  response_code = 301;
             * }*/
            if (!short.TryParse(expmonth, out s_expmonth))
            {
                response_code = 302;
            }
            if (!short.TryParse(expyear, out s_expyear))
            {
                response_code = 303;
            }
            if (!float.TryParse(amount, out f_amount))
            {
                response_code = 304;
            }
            if (!bool.TryParse(refreshcustomer, out b_refreshcustomer))
            {
                response_code = 305;
            }
            #endregion

            if (response_code == 0)
            {
                #region validate input
                Member memberData = new Member();
                memberData.MemberId          = memberid;
                memberData.Salutation        = salutation;
                memberData.FirstName         = firstname;
                memberData.MiddleInitial     = middleinitial;
                memberData.LastName          = lastname;
                memberData.Suffix            = suffix;
                memberData.ProfessionalTitle = professionaltitle;
                //memberData.OptIn = b_optin;
                memberData.Email = email;

                memberData.Address = new Address();
                memberData.Address.BusinessName = businessname;
                memberData.Address.Address1     = address1;
                memberData.Address.Address2     = address2;
                memberData.Address.Address3     = address3;
                memberData.Address.City         = city;
                memberData.Address.State        = state;
                memberData.Address.PostalCode   = postalcode;
                memberData.Address.Country      = country;
                memberData.Address.Phone        = phone;
                //memberData.Address.Fax = fax;
                //memberData.Address.AltCity = altcity;

                CreditCard ccData = new CreditCard();
                ccData.CCNumber     = ccnumber;
                ccData.CCExpMonth   = s_expmonth;
                ccData.CCExpYear    = s_expyear;
                ccData.AmountPaid   = f_amount;
                ccData.CCName       = ccname;
                ccData.CCAddress    = ccaddr;
                ccData.CCCity       = cccity;
                ccData.CCState      = ccstate;
                ccData.CCPostalCode = cczip;
                ccData.CCCountry    = cccountry;
                #endregion

                CreditCardServiceRequest request     = new CreditCardServiceRequest(ccData, memberData, pubcode, username, password, b_refreshcustomer);
                BaseResponse             cc_response = CreditCardProcessing.GetResponse(request);

                if (cc_response == null || cc_response.TypedResponse == null || cc_response.TypedResponse.Success == false)
                {
                    string msgs = string.Empty;
                    foreach (Message s in cc_response.Messages)
                    {
                        msgs += "[" + s.ToString() + "]";
                    }
                    tbl_AppEventLog logmsg = new tbl_AppEventLog();
                    logmsg.aelAppName     = "HarperSERVICE";
                    logmsg.aelDateCreated = DateTime.Now;
                    logmsg.aelEvent       = "306";
                    logmsg.aelMessage1    = "cc_response messages:" + msgs;
                    logmsg.aelMessage2    = "typed response:" + cc_response.TypedResponse.ToString();
                    logmsg.aelMessage3    = "success:" + cc_response.TypedResponse.Success;
                    logmsg.Save();
                    response_code = 306;
                }
                else
                {
                    routing_id = ((CreditCardServiceResponse)cc_response.TypedResponse).VerifoneRoutingId;
                    auth_code  = ((CreditCardServiceResponse)cc_response.TypedResponse).AuthorizationCode;
                }
            }

            return(new object[] { response_code, routing_id, auth_code });
        }