Exemple #1
0
        public static void Main(string[] args)
        {
            String store_id  = "monusqa002";
            String api_token = "qatoken";

            String data_key                = "ZjjRgfpvUEBysJO5eSUAB242U";
            String enc_track2              = "028400850000000004142348E7643B2599ACC00517C5AB6FB164486B1A4A83E7A81048D6CBA51604FDD12B72C228028E727AF6664C7A0431393035FFFF3141594047A0009E79C903";
            String device_type             = "idtech";
            String phone                   = "55555555555";
            String email                   = "*****@*****.**";
            String note                    = "my note";
            String cust_id                 = "customer2";
            String crypt                   = "7";
            String processing_country_code = "US";

            AvsInfo avsinfo = new AvsInfo();

            avsinfo.SetAvsStreetNumber("212");
            avsinfo.SetAvsStreetName("Smith Street");
            avsinfo.SetAvsZipCode("M1M1M1");

            EncResUpdateCC enc_res_update_cc = new EncResUpdateCC();

            enc_res_update_cc.SetDataKey(data_key);
            enc_res_update_cc.SetAvsInfo(avsinfo);
            enc_res_update_cc.SetCustId(cust_id);
            enc_res_update_cc.SetEncTrack2(enc_track2);
            enc_res_update_cc.SetDeviceType(device_type);
            enc_res_update_cc.SetPhone(phone);
            enc_res_update_cc.SetEmail(email);
            enc_res_update_cc.SetNote(note);
            enc_res_update_cc.SetCryptType(crypt);

            HttpsPostRequest mpgReq = new HttpsPostRequest();

            mpgReq.SetProcCountryCode(processing_country_code);
            mpgReq.SetTestMode(true);     //false or comment out this line for production transactions
            mpgReq.SetStoreId(store_id);
            mpgReq.SetApiToken(api_token);
            mpgReq.SetTransaction(enc_res_update_cc);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("DataKey = " + receipt.GetDataKey());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
                Console.WriteLine("PaymentType = " + receipt.GetPaymentType() + "\n");

                //Contents of ResolveData
                Console.WriteLine("Cust ID = " + receipt.GetResCustId());
                Console.WriteLine("Phone = " + receipt.GetResPhone());
                Console.WriteLine("Email = " + receipt.GetResEmail());
                Console.WriteLine("Note = " + receipt.GetResNote());
                Console.WriteLine("MaskedPan = " + receipt.GetResMaskedPan());
                Console.WriteLine("Exp Date = " + receipt.GetResExpDate());
                Console.WriteLine("Crypt Type = " + receipt.GetResCryptType());
                Console.WriteLine("Avs Street Number = " + receipt.GetResAvsStreetNumber());
                Console.WriteLine("Avs Street Name = " + receipt.GetResAvsStreetName());
                Console.WriteLine("Avs Zipcode = " + receipt.GetResAvsZipcode());
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public static void Main(string[] args)
        {
            /******************* REQUEST VARIABLES*******************************/

            string store_id                = "store5";
            string api_token               = "yesguy";
            string order_id                = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string cust_id                 = "nqa";
            string device_type             = "idtech_bdk";
            string crypt                   = "7";
            string enc_track2              = "02840085000000000416BC6FCE0D7A8B07E6278E60D237CA9362767ADC2C93A2EA5D9BED3E4D1A791C3F4FC61C1800486A8A6B6CCAA00431353131FFFF3141594047A00090055103";
            string processing_country_code = "CA";
            string data_key                = "gF5IpsWD3s42r2TZxZyecE9Gs";
            bool   status_check            = false;


            EncResUpdateCC encresupdatecc = new EncResUpdateCC();

            encresupdatecc.SetDataKey(data_key);
            encresupdatecc.SetCustId(cust_id);
            encresupdatecc.SetNote("Just a note2");
            encresupdatecc.SetEmail("*****@*****.**");
            encresupdatecc.SetPhone("866-319-7450");
            encresupdatecc.SetEncTrack2(enc_track2);
            encresupdatecc.SetDeviceType(device_type);
            encresupdatecc.SetCryptType(crypt);

            /*************** Address Verification Service **********************/
            AvsInfo avsCheck = new AvsInfo();

            avsCheck.SetAvsStreetNumber("3300");
            avsCheck.SetAvsStreetName("Bloor Street");
            avsCheck.SetAvsZipCode("M2X2X2");

            encresupdatecc.SetAvsInfo(avsCheck);

            HttpsPostRequest mpgReq = new HttpsPostRequest();

            mpgReq.SetProcCountryCode(processing_country_code);
            mpgReq.SetTestMode(true); //false or comment out this line for production transactions
            mpgReq.SetStoreId(store_id);
            mpgReq.SetApiToken(api_token);
            mpgReq.SetTransaction(encresupdatecc);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("DataKey = " + receipt.GetDataKey());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
                Console.WriteLine("PaymentType = " + receipt.GetPaymentType());

                //ResolveData
                Console.WriteLine("\nCust ID = " + receipt.GetResDataCustId());
                Console.WriteLine("Phone = " + receipt.GetResDataPhone());
                Console.WriteLine("Email = " + receipt.GetResDataEmail());
                Console.WriteLine("Note = " + receipt.GetResDataNote());
                Console.WriteLine("MaskedPan = " + receipt.GetResDataMaskedPan());
                Console.WriteLine("Exp Date = " + receipt.GetResDataExpdate());
                Console.WriteLine("Crypt Type = " + receipt.GetResDataCryptType());
                Console.WriteLine("Avs Street Number = " + receipt.GetResDataAvsStreetNumber());
                Console.WriteLine("Avs Street Name = " + receipt.GetResDataAvsStreetName());
                Console.WriteLine("Avs Zipcode = " + receipt.GetResDataAvsZipcode());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }