Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            string host          = "esqa.moneris.com";
            string store_id      = "moneris";
            string api_token     = "hurgle";
            string order_id      = "ZZZ_008";
            string amount        = "222.00";
            string pan           = "4716019111111115";
            string expDate       = "0912";
            string authCode      = "44565";
            string crypt         = "7";
            string cust_id       = "GSP_001";
            string orderLevelGst = "0.0";

            if (args.Length > 10)
            {
                orderLevelGst = args[10];
            }
            string merchantGstNo = "";

            if (args.Length > 11)
            {
                merchantGstNo = args[11];
            }
            string orderLevelPst = "0.0";

            if (args.Length > 12)
            {
                orderLevelPst = args[12];
            }
            string merchantPstNo = "";

            if (args.Length > 13)
            {
                merchantPstNo = args[13];
            }
            string cri = "";

            if (args.Length > 14)
            {
                cri = args[14];
            }
            try
            {
                L23HttpsPostRequest request = new L23HttpsPostRequest(host, store_id, api_token,
                                                                      new VSForcePost(order_id, cust_id, amount, pan, expDate, authCode, crypt, orderLevelGst,
                                                                                      merchantGstNo, cri, orderLevelPst, merchantPstNo));
                Receipt myReceipt = request.GetReceipt();
                Console.WriteLine("CardType = " + myReceipt.GetCardType());
                Console.WriteLine("TransAmount = " + myReceipt.GetTransAmount());
                Console.WriteLine("TxnNumber = " + myReceipt.GetTxnNumber());
                Console.WriteLine("ReceiptId = " + myReceipt.GetReceiptId());
                Console.WriteLine("TransType = " + myReceipt.GetTransType());
                Console.WriteLine("ReferenceNum = " + myReceipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + myReceipt.GetResponseCode());
                Console.WriteLine("ISO = " + myReceipt.GetISO());
                Console.WriteLine("BankTotals = " + myReceipt.GetBankTotals());
                Console.WriteLine("Message = " + myReceipt.GetMessage());
                Console.WriteLine("AuthCode = " + myReceipt.GetAuthCode());
                Console.WriteLine("Complete = " + myReceipt.GetComplete());
                Console.WriteLine("TransDate = " + myReceipt.GetTransDate());
                Console.WriteLine("TransTime = " + myReceipt.GetTransTime());
                Console.WriteLine("Ticket = " + myReceipt.GetTicket());
                Console.WriteLine("TimedOut = " + myReceipt.GetTimedOut());
                Console.WriteLine("CorporateCard = " + myReceipt.GetCorporateCard());
                Console.WriteLine("MessageId = " + myReceipt.GetMessageId());
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public static void Main(string[] args)
        {
            string store_id                = "monusqa002";
            string api_token               = "qatoken";
            string order_id                = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string cust_id                 = "customer1";
            string device_type             = "idtech";
            string processing_country_code = "US";
            bool   status_check            = false;

            string enc_track2 =
                "02D901801F4F2800039B%*4924********4030^TESTCARD/MONERIS^***************************************"
                + "**?*;4924********4030=********************?*A7150C78335A5024949516FDA9A68A91C4FBAB1279DD1DE2283D"
                + "BEBB2C6B3FDEACF7B5B314219D76C00890F347A9640EFE90023E31622F5FD95C14C0362DD2EAB28ADEB46B8B577DA1A1"
                + "8B707BCC7E48068EFF1882CFB4B369BDC4BB646C870D6083239860B23837EA91DB3F1D8AD066DAAACE2B2DA18D563E4F"
                + "1EF997696337B8999E9C707DEC4CB0410B887291CAF2EE449573D01613484B80760742A3506C31415939320000A00028"
                + "3C5E03";

            AvsInfo avsCheck = new AvsInfo();

            avsCheck.SetAvsStreetNumber("212");
            avsCheck.SetAvsStreetName("Payton Street");
            avsCheck.SetAvsZipCode("M1M1M1");

            CvdInfo cvdCheck = new CvdInfo();

            cvdCheck.SetCvdIndicator("1");
            cvdCheck.SetCvdValue("099");

            EncCardVerification encCardVerification = new EncCardVerification();

            encCardVerification.SetOrderId(order_id);
            encCardVerification.SetCustId(cust_id);
            encCardVerification.SetEncTrack2(enc_track2);
            encCardVerification.SetDeviceType(device_type);
            encCardVerification.SetAvsInfo(avsCheck);
            encCardVerification.SetCvdInfo(cvdCheck);

            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(encCardVerification);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Ticket = " + receipt.GetTicket());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("CardLevelResult = " + receipt.GetCardLevelResult());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 3
0
        public static void Main(string[] args)
        {
            string store_id  = "monusqa002";
            string api_token = "qatoken";
            string order_id  = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string amount    = "150.00";
            string pan       = "4242424242424242";
            string expdate   = "1602";      //YYMM format
            string crypt     = "7";
            string processing_country_code = "US";
            bool   status_check            = false;

            /********************* Billing/Shipping Variables ****************************/

            string first_name    = "Bob";
            string last_name     = "Smith";
            string company_name  = "ProLine Inc.";
            string address       = "623 Bears Ave";
            string city          = "Chicago";
            string province      = "Illinois";
            string postal_code   = "M1M2M1";
            string country       = "Canada";
            string phone         = "777-999-7777";
            string fax           = "777-999-7778";
            string tax1          = "10.00";
            string tax2          = "5.78";
            string tax3          = "4.56";
            string shipping_cost = "10.00";

            /********************* Order Line Item Variables *****************************/

            string[] item_description     = new string[] { "Chicago Bears Helmet", "Soldier Field Poster" };
            string[] item_quantity        = new string[] { "1", "1" };
            string[] item_product_code    = new string[] { "CB3450", "SF998S" };
            string[] item_extended_amount = new string[] { "150.00", "19.79" };

            /*****************************************************************************/
            /*								             */
            /*			Customer Information Option 1			     */
            /*									     */
            /*****************************************************************************/

            /********************** Customer Information Object **************************/

            CustInfo customer = new CustInfo();

            /********************** Set Customer Billing Information **********************/

            customer.SetBilling(first_name, last_name, company_name, address, city,
                                province, postal_code, country, phone, fax, tax1, tax2,
                                tax3, shipping_cost);

            /******************** Set Customer Shipping Information ***********************/

            customer.SetShipping(first_name, last_name, company_name, address, city,
                                 province, postal_code, country, phone, fax, tax1, tax2,
                                 tax3, shipping_cost);

            /***************************** Order Line Items  ******************************/

            customer.SetItem(item_description[0], item_quantity[0],
                             item_product_code[0], item_extended_amount[0]);

            customer.SetItem(item_description[1], item_quantity[1],
                             item_product_code[1], item_extended_amount[1]);

            /*****************************************************************************/
            /*								             */
            /*			Customer Information Option 2			     */
            /*									     */
            /*****************************************************************************/

            /********************** Customer Information Object **************************/

            CustInfo customer2 = new CustInfo();

            /******************************* Billing Hashtable ***************************/


            Hashtable b = new Hashtable();      //billing hashtable

            b.Add("first_name", first_name);
            b.Add("last_name", last_name);
            b.Add("company_name", company_name);
            b.Add("address", address);
            b.Add("city", city);
            b.Add("province", province);
            b.Add("postal_code", postal_code);
            b.Add("country", country);
            b.Add("phone", phone);
            b.Add("fax", fax);
            b.Add("tax1", tax1);                   //federal tax
            b.Add("tax2", tax2);                   //prov tax
            b.Add("tax3", tax3);                   //luxury tax
            b.Add("shipping_cost", shipping_cost); //shipping cost

            customer2.SetBilling(b);

            /****************************** Shipping Hashtable ***************************/

            Hashtable s = new Hashtable();      //shipping hashtable

            s.Add("first_name", first_name);
            s.Add("last_name", last_name);
            s.Add("company_name", company_name);
            s.Add("address", address);
            s.Add("city", city);
            s.Add("province", province);
            s.Add("postal_code", postal_code);
            s.Add("country", country);
            s.Add("phone", phone);
            s.Add("fax", fax);
            s.Add("tax1", tax1);                   //federal tax
            s.Add("tax2", tax2);                   //prov tax
            s.Add("tax3", tax3);                   //luxury tax
            s.Add("shipping_cost", shipping_cost); //shipping cost

            customer2.SetShipping(s);

            /************************* Order Line Item1 Hashtable ************************/

            Hashtable i1 = new Hashtable();             //item hashtable #1

            i1.Add("name", item_description[0]);
            i1.Add("quantity", item_quantity[0]);
            i1.Add("product_code", item_product_code[0]);
            i1.Add("extended_amount", item_extended_amount[0]);

            customer2.SetItem(i1);

            /************************* Order Line Item2 Hashtable **************************/

            Hashtable i2 = new Hashtable();             //item hashtable #2

            i2.Add("name", "item2's name");
            i2.Add("quantity", "7");
            i2.Add("product_code", "item2's product code");
            i2.Add("extended_amount", "5.01");

            customer2.SetItem(i2);

            /*************** Miscellaneous Customer Information Methods *******************/

            customer.SetEmail("*****@*****.**");
            customer.SetInstructions("Make it fast!");

            /********************** Transactional Request Object **************************/

            PreAuth preauth = new PreAuth();

            preauth.SetOrderId(order_id);
            preauth.SetAmount(amount);
            preauth.SetPan(pan);
            preauth.SetExpDate(expdate);
            preauth.SetCryptType(crypt);

            /************************ Set Customer Information ***************************/

            preauth.SetCustInfo(customer);

            /**************************** Https Post Request ***************************/

            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(preauth);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("ISO = " + receipt.GetISO());
                Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Ticket = " + receipt.GetTicket());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("CardLevelResult = " + receipt.GetCardLevelResult());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 4
0
        public static void Main(string[] args)
        {
            /******************* REQUEST VARIABLES*******************************/

            string store_id  = "monusqa002";
            string api_token = "qatoken";
            string order_id  = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string cust_id   = "nqa";
            string crypt     = "7";
            string processing_country_code = "US";
            bool   status_check            = false;
            string enc_track2  = "028400850000000004142348E7643B2599ACC00517C5AB6FB164486B1A4A83E7A81048D6CBA51604FDD12B72C228028E727AF6664C7A0431393035FFFF3141594047A0009E79C903";
            string device_type = "idtech";


            EncResAddCC encresaddcc = new EncResAddCC();

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

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

            avsCheck.SetAvsStreetNumber("212");
            avsCheck.SetAvsStreetName("Payton Street");
            avsCheck.SetAvsZipCode("M1M1M1");

            encresaddcc.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(encresaddcc);
            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);
            }
        }
        public static void Main(string[] args)
        {
            string order_id   = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string store_id   = "store1";
            string api_token  = "yesguy";
            string data_key   = "eLqsADfwqHDxIpJG9vLnELx01";
            string amount     = "1.00";
            string cust_id    = "customer1"; //if sent will be submitted, otherwise cust_id from profile will be used
            string crypt_type = "1";
            string processing_country_code = "CA";
            bool   status_check            = false;

            ResPurchaseCC resPurchaseCC = new ResPurchaseCC();

            resPurchaseCC.SetDataKey(data_key);
            resPurchaseCC.SetOrderId(order_id);
            resPurchaseCC.SetCustId(cust_id);
            resPurchaseCC.SetAmount(amount);
            resPurchaseCC.SetCryptType(crypt_type);

            //CustInfo Variables
            CustInfo custInfo = new CustInfo();

            custInfo.SetEmail("*****@*****.**");
            custInfo.SetInstructions("Make it fast!");

            Hashtable b = new Hashtable();

            b.Add("first_name", "Bob");
            b.Add("last_name", "Smith");
            b.Add("company_name", "Widget Company Inc.");
            b.Add("address", "111 Bolts Ave.");
            b.Add("city", "Toronto");
            b.Add("province", "Ontario");
            b.Add("postal_code", "M8T 1T8");
            b.Add("country", "Canada");
            b.Add("phone", "416-555-5555");
            b.Add("fax", "416-555-5555");
            b.Add("tax1", "123.45");          //federal tax
            b.Add("tax2", "12.34");           //prov tax
            b.Add("tax3", "15.45");           //luxury tax
            b.Add("shipping_cost", "456.23"); //shipping cost

            custInfo.SetBilling(b);

            /* OR you can pass the individual args.
             * custInfo.SetBilling(
             *                     "Bob",                  //first name
             *                     "Smith",                //last name
             *                     "Widget Company Inc.",  //company name
             *                     "111 Bolts Ave.",       //address
             *                     "Toronto",              //city
             *                     "Ontario",              //province
             *                     "M8T 1T8",              //postal code
             *                     "Canada",               //country
             *                     "416-555-5555",         //phone
             *                     "416-555-5555",         //fax
             *                     "123.45",               //federal tax
             *                     "12.34",                //prov tax
             *                     "15.45",                //luxury tax
             *                     "456.23"                //shipping cost
             * );
             */

            Hashtable s = new Hashtable();

            s.Add("first_name", "Bob");
            s.Add("last_name", "Smith");
            s.Add("company_name", "Widget Company Inc.");
            s.Add("address", "111 Bolts Ave.");
            s.Add("city", "Toronto");
            s.Add("province", "Ontario");
            s.Add("postal_code", "M8T 1T8");
            s.Add("country", "Canada");
            s.Add("phone", "416-555-5555");
            s.Add("fax", "416-555-5555");
            s.Add("tax1", "123.45");          //federal tax
            s.Add("tax2", "12.34");           //prov tax
            s.Add("tax3", "15.45");           //luxury tax
            s.Add("shipping_cost", "456.23"); //shipping cost

            custInfo.SetShipping(s);

            /* OR you can pass the individual args.
             * custInfo.SetShipping(
             *                     "Bob",                  //first name
             *                     "Smith",                //last name
             *                     "Widget Company Inc.",  //company name
             *                     "111 Bolts Ave.",       //address
             *                     "Toronto",              //city
             *                     "Ontario",              //province
             *                     "M8T 1T8",              //postal code
             *                     "Canada",               //country
             *                     "416-555-5555",         //phone
             *                     "416-555-5555",         //fax
             *                     "123.45",               //federal tax
             *                     "12.34",                //prov tax
             *                     "15.45",                //luxury tax
             *                     "456.23"                //shipping cost
             * );
             */

            Hashtable i1 = new Hashtable();

            i1.Add("name", "item1's name");
            i1.Add("quantity", "5");
            i1.Add("product_code", "item1's product code");
            i1.Add("extended_amount", "1.01");

            custInfo.SetItem(i1);

            /* OR you can pass the individual args.
             * custInfo.SetItem(
             *  "item1's name",         //name
             *  "5",                    //quantity
             *  "item1's product code", //product code
             *  "1.01"                  //extended amount
             * );
             */

            Hashtable i2 = new Hashtable();

            i2.Add("name", "item2's name");
            i2.Add("quantity", "7");
            i2.Add("product_code", "item2's product code");
            i2.Add("extended_amount", "5.01");

            custInfo.SetItem(i2);

            resPurchaseCC.SetCustInfo(custInfo);

            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(resPurchaseCC);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("DataKey = " + receipt.GetDataKey());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
                Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
                Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
                Console.WriteLine("Phone = " + receipt.GetResDataPhone());
                Console.WriteLine("Email = " + receipt.GetResDataEmail());
                Console.WriteLine("Note = " + receipt.GetResDataNote());
                Console.WriteLine("Masked Pan = " + 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);
            }
        }
        public static void Main(string[] args)
        {
            string store_id                = "store5";
            string api_token               = "yesguy";
            string order_id                = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string cust_id                 = "my customer id";
            string amount                  = "1.00";
            string enc_track2              = "ZLrh4VKryAo4d67jdaxYPguMPSRHovKrekcSwhsobBQhxsxXE+gWPBB1XZV83Migq796muJYGHOy2UhuxYmJU4npXw7qKNHtIvyre4+5vVIxNHl3bCDK7RYzrUASDjaehxzk0HFGJq9G6QohTThpSa7ml1xPdOWn7b0KHic/KeU=";
            string pos_code                = "00";
            string device_type             = "public";
            string dynamic_descriptor      = "my descriptor";
            string processing_country_code = "CA";
            bool   status_check            = false;

            EncContactlessPurchase purchase = new EncContactlessPurchase();

            purchase.SetOrderId(order_id);
            purchase.SetCustId(cust_id);
            purchase.SetAmount(amount);
            purchase.SetEncTrack2(enc_track2);
            purchase.SetPosCode(pos_code);
            purchase.SetDeviceType(device_type);
            purchase.SetDynamicDescriptor(dynamic_descriptor);

            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(purchase);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Ticket = " + receipt.GetTicket());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                //Console.WriteLine("CardLevelResult = " + receipt.GetCardLevelResult());
                //Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
                //Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public static void Main(string[] args)
        {
            string store_id                = "store5";
            string api_token               = "yesguy";
            string order_id                = "mvt2713557ss83ss9ssdfsdfsdf";
            string orig_order_id           = "mvt3525350028";
            string amount                  = "1.00";
            string txn_number              = "113457-0_10";
            string crypt                   = "8";
            string dynamic_descriptor      = "123456";
            string cust_id                 = "my customer id";
            string processing_country_code = "CA";
            bool   status_check            = false;

            ReAuth reauth = new ReAuth();

            reauth.SetOrderId(order_id);
            reauth.SetCustId(cust_id);
            reauth.SetOrigOrderId(orig_order_id);
            reauth.SetTxnNumber(txn_number);
            reauth.SetAmount(amount);
            reauth.SetCryptType(crypt);
            reauth.SetDynamicDescriptor(dynamic_descriptor);

            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(reauth);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("ISO = " + receipt.GetISO());
                Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Ticket = " + receipt.GetTicket());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 8
0
        public static void Main(string[] args)
        {
            string        store_id  = "monusqa002";
            string        api_token = "qatoken";
            string        amount    = "1.00";
            Random        r         = new Random();
            StringBuilder sb        = new StringBuilder();

            for (int i = 0; i < 20; i++)
            {
                sb.Append(r.Next(0, 9));
            }
            string xid                     = sb.ToString();
            string MD                      = xid + "mycardinfo" + amount;
            string merchantUrl             = "www.mystoreurl.com";
            string accept                  = "true";
            string userAgent               = "Mozilla";
            string processing_country_code = "US";
            string pan                     = "4242424242424242";
            string expdate                 = "1905";
            bool   status_check            = false;

            MpiTxn mpiTxn = new MpiTxn();

            mpiTxn.SetXid(xid);
            mpiTxn.SetPan(pan);
            mpiTxn.SetExpDate(expdate);
            mpiTxn.SetAmount(amount);
            mpiTxn.SetMD(MD);
            mpiTxn.SetMerchantUrl(merchantUrl);
            mpiTxn.SetAccept(accept);
            mpiTxn.SetUserAgent(userAgent);

            //************************OPTIONAL VARIABLES***************************

            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(mpiTxn);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            /**********************   REQUEST  ************************/

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("MpiMessage = " + receipt.GetMpiMessage());
                Console.WriteLine("MpiSuccess = " + receipt.GetMpiSuccess());

                if (receipt.GetMpiSuccess() == "true")
                {
                    Console.WriteLine(receipt.GetInLineForm());
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public static void Main(string[] args)
        {
            string store_id  = "moneris";
            string api_token = "hurgle";
            string processing_country_code = "CA";
            bool   status_check            = false;

            string order_id   = "ord-041016-17:35:35";
            string txn_number = "66011731772016278173536680-0_11";

            //Common Data
            string customer_code1_c = "CustomerCode123";
            string additional_card_acceptor_data_c = "acad1";
            string austin_tetra_number_c           = "atn1";
            string naics_code_c                     = "nc1";
            string card_acceptor_type_c             = "0000nnnn";
            string card_acceptor_tax_id_c           = "Moneristaxid1";
            string corporation_vat_number_c         = "cvn123";
            string card_acceptor_reference_number_c = "carn1";
            string freight_amount1_c                = "1.23";
            string duty_amount1_c                   = "2.34";
            string destination_province_code_c      = "ONT";
            string destination_country_code_c       = "CAN";
            string ship_from_pos_code_c             = "M8X 2X2";
            string ship_to_pos_code_c               = "_M1R 1R5";
            string order_date_c                     = "141211";
            string card_acceptor_vat_number_c       = "cavn1";
            string customer_vat_number_c            = "customervn231";
            string unique_invoice_number_c          = "uin567";
            string commodity_code_c                 = "paCCC1";
            string authorized_contact_name_c        = "John Walker";
            string authorized_contact_phone_c       = "416-734-1000";

            //Common Tax Details
            string[] tax_amount_c            = { "1.19", "1.29" };
            string[] tax_rate_c              = { "6.0", "7.0" };
            string[] tax_type_c              = { "GST", "PST" };
            string[] tax_id_c                = { "gst1298", "pst1298" };
            string[] tax_included_in_sales_c = { "Y", "N" };

            //General Passenger Ticket Information
            string passenger_name1_i           = "MCC Tester";
            string ticket_number1_i            = "1234567890001";
            string travel_agency_name_i        = "Moneris Travel";
            string travel_agency_code_i        = "MC322";
            string issuing_carrier_i           = "2R";
            string customer_code1_i            = "passengerabc";
            string issue_date_i                = "141210";
            string total_fare_i                = "129.45";
            string travel_authorization_code_i = "sde-erdsz-452112";
            string total_fee_i   = "10.34";
            string total_taxes_i = "11.56";
            string restricted_ticket_indicator_i = "1";
            string exchange_ticket_amount_i      = "13.98";
            string exchange_fee_amount_i         = "1.78";
            string iata_client_code_i            = "icc2";

            //Tax Details for passenger
            string[] tax_amount_i            = { "3.28" };
            string[] tax_rate_i              = { "13.00" };
            string[] tax_type_i              = { "HST" };
            string[] tax_id_i                = { "hst1298" };
            string[] tax_included_in_sales_i = { "Y" };

            //Passenger Air Travel Details
            string[] travel_date_s                = { "150101", "150102" };
            string[] carrier_code1_s              = { "3R", "4R" };
            string[] service_class_s              = { "E", "B" };
            string[] orig_city_airport_code_s     = { "Toron", "Montr" };
            string[] dest_city_airport_code_s     = { "Montr", "Halif" };
            string[] stop_over_code_s             = { "", "X" };
            string[] coupon_number1_s             = { "1", "2" };
            string[] fare_basis_code1_s           = { "FClass", "SClass" };
            string[] flight_number_s              = { "56786", "54386" };
            string[] departure_time_s             = { "1920", "1120" };
            string[] arrival_time_s               = { "0620", "1620" };
            string[] conjunction_ticket_number1_s = { "123456789054367", null };
            string[] exchange_ticket_number1_s    = { "123456789067892", null };
            string[] fare_s  = { "1.69", null };
            string[] fee_s   = { "1.48", null };
            string[] taxes_s = { "3.91", null };
            string[] endorsement_restrictions_s = { "er6", null };

            //Tax Details for Air Travel
            string[] tax_amount_s            = { "4.67", "7.43" };
            string[] tax_rate_s              = { "5.0", "9.975" };
            string[] tax_type_s              = { "GST", "QST" };
            string[] tax_id_s                = { "gst1298", "qst1298" };
            string[] tax_included_in_sales_s = { "Y", "Y" };

            //Passenger Rail Details
            string[] passenger_name1_r                 = { "Passenger Namer", "Passenger Namer1" };
            string[] ticket_number1_r                  = { "1234567890002", "1234567890003" };
            string[] travel_agency_code_r              = { "TAC1", "TAC2" };
            string[] travel_agency_name_r              = { "Daily Travel", "Daily Travel" };
            string[] travel_date_r                     = { "141223", "141222" };
            string[] sequence_number_r                 = { "001", "002" };
            string[] service_type_r                    = { "01", "02" };
            string[] service_nature_r                  = { "01", "02" };
            string[] service_amount_r                  = { "788.34", "56.34" };
            string[] full_vat_gross_amount_r           = { "68.12", null };
            string[] start_station_r                   = { "Vanco", "Calgr" };
            string[] destination_station_r             = { "Calgr", "Winpg" };
            string[] number_of_adults_r                = { "2", "4" };
            string[] number_of_children_r              = { "3", "6" };
            string[] class_of_ticket_r                 = { "E", "B" };
            string[] procedure_id_r                    = { "RS-23IVTY", null };
            string[] full_vat_tax_amount_r             = { "4.49", null };
            string[] half_vat_gross_amount_r           = { "1.08", null };
            string[] half_vat_tax_amount_r             = { "0.87", null };
            string[] traffic_code_r                    = { "665", null };
            string[] sample_number_r                   = { "125", null };
            string[] generic_code_r                    = { "66", null };
            string[] generic_number_r                  = { "gn2", null };
            string[] generic_other_code_r              = { "13", null };
            string[] generic_other_number_r            = { "gon2", null };
            string[] reduction_code_r                  = { "14", null };
            string[] reduction_number_r                = { "rn2", null };
            string[] reduction_other_code_r            = { "17", null };
            string[] reduction_other_number_r          = { "ron2", null };
            string[] transportation_other_code_r       = { "115", null };
            string[] transportation_service_provider_r = { "tsp2", null };
            string[] transportation_service_offered_r  = { "tso2", null };

            //Create and set Tax for McCorpac
            McTax mcTax_c = new McTax();

            mcTax_c.SetTax(tax_amount_c[0], tax_rate_c[0], tax_type_c[0], tax_id_c[0], tax_included_in_sales_c[0]);
            mcTax_c.SetTax(tax_amount_c[1], tax_rate_c[1], tax_type_c[1], tax_id_c[1], tax_included_in_sales_c[1]);

            //Create and set McCorpac for common data - only set values that you know
            McCorpac mcCorpac = new McCorpac();

            mcCorpac.SetCustomerCode1(customer_code1_c);
            mcCorpac.SetAdditionalCardAcceptorData(additional_card_acceptor_data_c);
            mcCorpac.SetAustinTetraNumber(austin_tetra_number_c);
            mcCorpac.SetNaicsCode(naics_code_c);
            mcCorpac.SetCardAcceptorType(card_acceptor_type_c);
            mcCorpac.SetCardAcceptorTaxTd(card_acceptor_tax_id_c);
            mcCorpac.SetCorporationVatNumber(corporation_vat_number_c);
            mcCorpac.SetCardAcceptorReferenceNumber(card_acceptor_reference_number_c);
            mcCorpac.SetFreightAmount1(freight_amount1_c);
            mcCorpac.SetDutyAmount1(duty_amount1_c);
            mcCorpac.SetDestinationProvinceCode(destination_province_code_c);
            mcCorpac.SetDestinationCountryCode(destination_country_code_c);
            mcCorpac.SetShipFromPosCode(ship_from_pos_code_c);
            mcCorpac.SetShipToPosCode(ship_to_pos_code_c);
            mcCorpac.SetOrderDate(order_date_c);
            mcCorpac.SetCardAcceptorVatNumber(card_acceptor_vat_number_c);
            mcCorpac.SetCustomerVatNumber(customer_vat_number_c);
            mcCorpac.SetUniqueInvoiceNumber(unique_invoice_number_c);
            mcCorpac.SetCommodityCode(commodity_code_c);
            mcCorpac.SetAuthorizedContactName(authorized_contact_name_c);
            mcCorpac.SetAuthorizedContactPhone(authorized_contact_phone_c);
            mcCorpac.SetTax(mcTax_c);

            //Create and set Tax for McCorpai
            McTax mcTax_i = new McTax();

            mcTax_i.SetTax(tax_amount_i[0], tax_rate_i[0], tax_type_i[0], tax_id_i[0], tax_included_in_sales_i[0]);

            //Create and set McCorpai
            McCorpai mcCorpai = new McCorpai();

            mcCorpai.SetPassengerName1(passenger_name1_i);
            mcCorpai.SetTicketNumber1(ticket_number1_i);
            mcCorpai.SetTravelAgencyName(travel_agency_name_i);
            mcCorpai.SetTravelAgencyCode(travel_agency_code_i);
            mcCorpai.SetIssuingCarrier(issuing_carrier_i);
            mcCorpai.SetCustomerCode1(customer_code1_i);
            mcCorpai.SetIssueDate(issue_date_i);
            mcCorpai.SetTotalFare(total_fare_i);
            mcCorpai.SetTravelAuthorizationCode(travel_authorization_code_i);
            mcCorpai.SetTotalFee(total_fee_i);
            mcCorpai.SetTotalTaxes(total_taxes_i);
            mcCorpai.SetRestrictedTicketIndicator(restricted_ticket_indicator_i);
            mcCorpai.SetExchangeTicketAmount(exchange_ticket_amount_i);
            mcCorpai.SetExchangeFeeAmount(exchange_fee_amount_i);
            mcCorpai.SetIataClientCode(iata_client_code_i);
            mcCorpai.SetTax(mcTax_i);

            //Create and set Tax for McCorpas
            McTax[] mcTax_s = new McTax[2];
            mcTax_s[0] = new McTax();
            mcTax_s[0].SetTax(tax_amount_s[0], tax_rate_s[0], tax_type_s[0], tax_id_s[0], tax_included_in_sales_s[0]);
            mcTax_s[1] = new McTax();
            mcTax_s[1].SetTax(tax_amount_s[1], tax_rate_s[1], tax_type_s[1], tax_id_s[1], tax_included_in_sales_s[1]);

            //Create and set McCorpas for Air Travel Details only
            McCorpas mcCorpas = new McCorpas();

            mcCorpas.SetMcCorpas(travel_date_s[0], carrier_code1_s[0], service_class_s[0], orig_city_airport_code_s[0], dest_city_airport_code_s[0], stop_over_code_s[0],
                                 conjunction_ticket_number1_s[0], exchange_ticket_number1_s[0], coupon_number1_s[0], fare_basis_code1_s[0], flight_number_s[0], departure_time_s[0],
                                 arrival_time_s[0], fare_s[0], fee_s[0], taxes_s[0], endorsement_restrictions_s[0], mcTax_s[0]);
            mcCorpas.SetMcCorpas(travel_date_s[1], carrier_code1_s[1], service_class_s[1], orig_city_airport_code_s[1], dest_city_airport_code_s[1], stop_over_code_s[1],
                                 conjunction_ticket_number1_s[1], exchange_ticket_number1_s[1], coupon_number1_s[1], fare_basis_code1_s[1], flight_number_s[1], departure_time_s[1],
                                 arrival_time_s[1], fare_s[1], fee_s[1], taxes_s[1], endorsement_restrictions_s[1], mcTax_s[1]);

            //Create and set McCorpar for Rail Travel Details only
            McCorpar mcCorpar = new McCorpar();

            mcCorpar.SetMcCorpar(passenger_name1_r[0], ticket_number1_r[0], travel_agency_code_r[0], travel_agency_name_r[0], travel_date_r[0], sequence_number_r[0], procedure_id_r[0], service_type_r[0],
                                 service_nature_r[0], service_amount_r[0], full_vat_gross_amount_r[0], full_vat_tax_amount_r[0], half_vat_gross_amount_r[0], half_vat_tax_amount_r[0], traffic_code_r[0],
                                 sample_number_r[0], start_station_r[0], destination_station_r[0], generic_code_r[0], generic_number_r[0], generic_other_code_r[0], generic_other_number_r[0], reduction_code_r[0],
                                 reduction_number_r[0], reduction_other_code_r[0], reduction_other_number_r[0], transportation_other_code_r[0], number_of_adults_r[0], number_of_children_r[0],
                                 class_of_ticket_r[0], transportation_service_provider_r[0], transportation_service_offered_r[0]);
            mcCorpar.SetMcCorpar(passenger_name1_r[1], ticket_number1_r[1], travel_agency_code_r[1], travel_agency_name_r[1], travel_date_r[1], sequence_number_r[1], procedure_id_r[1], service_type_r[1],
                                 service_nature_r[1], service_amount_r[1], full_vat_gross_amount_r[1], full_vat_tax_amount_r[1], half_vat_gross_amount_r[1], half_vat_tax_amount_r[1], traffic_code_r[1],
                                 sample_number_r[1], start_station_r[1], destination_station_r[1], generic_code_r[1], generic_number_r[1], generic_other_code_r[1], generic_other_number_r[1], reduction_code_r[1],
                                 reduction_number_r[1], reduction_other_code_r[1], reduction_other_number_r[1], transportation_other_code_r[1], number_of_adults_r[1], number_of_children_r[1],
                                 class_of_ticket_r[1], transportation_service_provider_r[1], transportation_service_offered_r[1]);

            McCorpais mcCorpais = new McCorpais();

            mcCorpais.SetOrderId(order_id);
            mcCorpais.SetTxnNumber(txn_number);
            mcCorpais.SetMcCorpac(mcCorpac);
            mcCorpais.SetMcCorpai(mcCorpai);
            mcCorpais.SetMcCorpas(mcCorpas);
            mcCorpais.SetMcCorpar(mcCorpar);

            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(mcCorpais);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("ISO = " + receipt.GetISO());
                Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Ticket = " + receipt.GetTicket());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public static void Main(string[] args)
        {
            string store_id  = "moneris";
            string api_token = "hurgle";
            string processing_country_code = "CA";
            bool   status_check            = false;

            string order_id        = "Test20170116043144";
            string amount          = "5.00";
            string txn_number      = "39011-0_11";
            string crypt           = "7";
            string national_tax    = "1.23";
            string merchant_vat_no = "gstno111";
            string local_tax       = "2.34";
            string customer_vat_no = "gstno999";
            string cri             = "CUST-REF-002";
            string customer_code   = "ccvsfp";
            string invoice_number  = "invsfp";
            string local_tax_no    = "ltaxno";

            VsRefund vsRefund = new VsRefund();

            vsRefund.SetOrderId(order_id);
            vsRefund.SetAmount(amount);
            vsRefund.SetTxnNumber(txn_number);
            vsRefund.SetCryptType(crypt);
            vsRefund.SetNationalTax(national_tax);
            vsRefund.SetMerchantVatNo(merchant_vat_no);
            vsRefund.SetLocalTax(local_tax);
            vsRefund.SetCustomerVatNo(customer_vat_no);
            vsRefund.SetCri(cri);
            vsRefund.SetCustomerCode(customer_code);
            vsRefund.SetInvoiceNumber(invoice_number);
            vsRefund.SetLocalTaxNo(local_tax_no);

            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(vsRefund);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("ISO = " + receipt.GetISO());
                Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Ticket = " + receipt.GetTicket());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public static void Main(string[] args)
        {
            string store_id  = "store1";
            string api_token = "yesguy";
            string data_key  = "4INQR1A8ocxD0oafSz50LADXy";
            string order_id  = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string amount    = "1.00";
            string cust_id   = "customer1"; //if sent will be submitted, otherwise cust_id from profile will be used
            string cavv      = "AAABBJg0VhI0VniQEjRWAAAAAAA";
            string expdate   = "1911";
            string processing_country_code = "CA";
            bool   status_check            = false;

            CofInfo cof = new CofInfo();

            cof.SetPaymentIndicator("U");
            cof.SetPaymentInformation("2");
            cof.SetIssuerId("168451306048014");

            ResCavvPurchaseCC resCavvPurchaseCC = new ResCavvPurchaseCC();

            resCavvPurchaseCC.SetOrderId(order_id);
            resCavvPurchaseCC.SetDataKey(data_key);
            resCavvPurchaseCC.SetCustId(cust_id);
            resCavvPurchaseCC.SetAmount(amount);
            resCavvPurchaseCC.SetCavv(cavv);
            //resCavvPurchaseCC.SetExpDate(expdate); //mandatory for temp token only
            resCavvPurchaseCC.SetThreeDSVersion("2");                                          //Mandatory for 3DS Version 2.0+
            resCavvPurchaseCC.SetThreeDSServerTransId("e11d4985-8d25-40ed-99d6-c3803fe5e68f"); //Mandatory for 3DS Version 2.0+ - obtained from MpiCavvLookup or MpiThreeDSAuthentication
            resCavvPurchaseCC.SetCofInfo(cof);

            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(resCavvPurchaseCC);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("DataKey = " + receipt.GetDataKey());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
                Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
                Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
                Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
                Console.WriteLine("ThreeDSVersion = " + receipt.GetThreeDSVersion());

                //ResolveData
                Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
                Console.WriteLine("Phone = " + receipt.GetResDataPhone());
                Console.WriteLine("Email = " + receipt.GetResDataEmail());
                Console.WriteLine("Note = " + receipt.GetResDataNote());
                Console.WriteLine("Masked Pan = " + 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);
            }
        }
        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);
            }
        }
        public static void Main(string[] args)
        {
            string store_id = "store5";
            string api_token = "yesguy";
            string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string cust_id = "CUS887H67";
            string amount = "10.42";
            string pan = "4242424242424242";
            string expdate = "1901"; //YYMM
            string cavv = "AAABBJg0VhI0VniQEjRWAAAAAAA=";
            string dynamic_descriptor = "123456";
			string wallet_indicator = "APP";
            string processing_country_code = "CA";
			string crypt_type = "5";
            bool status_check = false;

			CofInfo cof = new CofInfo();
			cof.SetPaymentIndicator("U");
			cof.SetPaymentInformation("2");
			cof.SetIssuerId("168451306048014");

            CavvPurchase cavvPurchase = new CavvPurchase();
            cavvPurchase.SetOrderId(order_id);
            cavvPurchase.SetCustId(cust_id);
            cavvPurchase.SetAmount(amount);
            cavvPurchase.SetPan(pan);
            cavvPurchase.SetExpDate(expdate);
            cavvPurchase.SetCavv(cavv);
			cavvPurchase.SetCryptType(crypt_type); //Mandatory for AMEX cards only
            cavvPurchase.SetDynamicDescriptor(dynamic_descriptor);
			cavvPurchase.SetThreeDSVersion("2"); //Mandatory for 3DS Version 2.0+
			cavvPurchase.SetThreeDSServerTransId("e11d4985-8d25-40ed-99d6-c3803fe5e68f"); //Mandatory for 3DS Version 2.0+ - obtained from MpiCavvLookup or MpiThreeDSAuthentication
			//cavvPurchase.SetNetwork("Interac");  //set only for Interac e-commerce
			//cavvPurchase.SetDataType("3DSecure"); //set only for Interac e-commerce
			//cavvPurchase.SetWalletIndicator(wallet_indicator); //set only wallet transactions e.g. APPLE PAY
			//cavvPurchase.SetCmId("8nAK8712sGaAkls56"); //set only for usage with Offlinx - Unique max 50 alphanumeric characters transaction id generated by merchant
			cavvPurchase.SetCofInfo(cof);

            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(cavvPurchase);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("ISO = " + receipt.GetISO());
                Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Ticket = " + receipt.GetTicket());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
                Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
				Console.WriteLine("ThreeDSVersion = " + receipt.GetThreeDSVersion());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 14
0
        public static void Main(string[] args)
        {
            string host       = "esqa.moneris.com";
            string store_id   = "store5";
            string api_token  = "yesguy";
            string data_key   = "g90io5hS63qXu10Pu51512M8G";
            string pan        = "4242424242424242";
            string expdate    = "1111";
            string phone      = "0000000000";
            string email      = "*****@*****.**";
            string note       = "my note";
            string cust_id    = "customer1";
            string crypt_type = "7";

            AvsInfo avsCheck = new AvsInfo();

            avsCheck.SetAvsStreetNumber("212");
            avsCheck.SetAvsStreetName("Payton Street");
            avsCheck.SetAvsZipCode("M1M1M1");

            ResUpdateCC resUpdateCC = new ResUpdateCC(data_key);

            resUpdateCC.SetAvsInfo(avsCheck);
            resUpdateCC.SetCustId(cust_id);
            resUpdateCC.SetPan(pan);
            resUpdateCC.SetExpdate(expdate);
            resUpdateCC.SetPhone(phone);
            resUpdateCC.SetEmail(email);
            resUpdateCC.SetNote(note);
            resUpdateCC.SetCryptType(crypt_type);

            HttpsPostRequest mpgReq = new HttpsPostRequest(host, store_id, api_token, resUpdateCC);

            /**********************   REQUEST  ************************/

            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());
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 15
0
        public static void Main(string[] args)
        {
            string order_id   = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string store_id   = "store1";
            string api_token  = "yesguy";
            string data_key   = "qJD5kCZiCjsfabKH7WuxoHyZx";
            string amount     = "1.00";
            string cust_id    = "customer1";
            string crypt_type = "1";
            string processing_country_code = "CA";
            bool   status_check            = false;

            ResIndRefundCC resIndRefundCC = new ResIndRefundCC();

            resIndRefundCC.SetOrderId(order_id);
            resIndRefundCC.SetCustId(cust_id);
            resIndRefundCC.SetAmount(amount);
            resIndRefundCC.SetCryptType(crypt_type);
            resIndRefundCC.SetDataKey(data_key);

            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(resIndRefundCC);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("DataKey = " + receipt.GetDataKey());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
                Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
                Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
                Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
                Console.WriteLine("Phone = " + receipt.GetResDataPhone());
                Console.WriteLine("Email = " + receipt.GetResDataEmail());
                Console.WriteLine("Note = " + receipt.GetResDataNote());
                Console.WriteLine("Masked Pan = " + 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);
            }
        }
        public static void Main(string[] args)
        {
            string host      = args[0];
            string store_id  = args[1];
            string api_token = args[2];
            string ecr_no    = args[3];

            HttpsPostRequest mpgReq =
                new HttpsPostRequest(host, store_id, api_token, new OpenTotals(ecr_no));

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                if ((receipt.GetReceiptId()).Equals("Global Error Receipt"))
                {
                    Console.WriteLine("CardType = " + receipt.GetCreditCards(ecr_no));
                    Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                    Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                    Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                    Console.WriteLine("TransType = " + receipt.GetTransType());
                    Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                    Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                    Console.WriteLine("ISO = " + receipt.GetISO());
                    Console.WriteLine("BankTotals = null");
                    Console.WriteLine("Message = " + receipt.GetMessage());
                    Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                    Console.WriteLine("Complete = " + receipt.GetComplete());
                    Console.WriteLine("TransDate = " + receipt.GetTransDate());
                    Console.WriteLine("TransTime = " + receipt.GetTransTime());
                    Console.WriteLine("Ticket = " + receipt.GetTicket());
                    Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                }
                else
                {
                    foreach (string ecr in receipt.GetTerminalIDs())
                    {
                        Console.WriteLine("ECR: " + ecr);
                        foreach (string cardType in receipt.GetCreditCards(ecr))
                        {
                            Console.WriteLine("\tCard Type: " + cardType);

                            Console.WriteLine("\t\tPurchase: Count = "
                                              + receipt.GetPurchaseCount(ecr, cardType)
                                              + " Amount = "
                                              + receipt.GetPurchaseAmount(ecr,
                                                                          cardType));

                            Console.WriteLine("\t\tRefund: Count = "
                                              + receipt.GetRefundCount(ecr, cardType)
                                              + " Amount = "
                                              + receipt.GetRefundAmount(ecr, cardType));

                            Console.WriteLine("\t\tCorrection: Count = "
                                              + receipt.GetCorrectionCount(ecr, cardType)
                                              + " Amount = "
                                              + receipt.GetCorrectionAmount(ecr,
                                                                            cardType));
                        }
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 17
0
        public static void Main(string[] args)
        {
            string store_id  = "store5";
            string api_token = "yesguy";
            string order_id  = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string pan       = "4242424242424242";
            string expdate   = "1901"; //YYMM format
            string crypt     = "7";
            string processing_country_code = "CA";
            bool   status_check            = false;

            AvsInfo avsCheck = new AvsInfo();

            avsCheck.SetAvsStreetNumber("212");
            avsCheck.SetAvsStreetName("Payton Street");
            avsCheck.SetAvsZipCode("M1M1M1");

            CvdInfo cvdCheck = new CvdInfo();

            cvdCheck.SetCvdIndicator("1");
            cvdCheck.SetCvdValue("099");

            CofInfo cof = new CofInfo();

            cof.SetPaymentIndicator("U");
            cof.SetPaymentInformation("2");
            cof.SetIssuerId("168451306048014");

            CardVerification cardVerification = new CardVerification();

            cardVerification.SetOrderId(order_id);
            cardVerification.SetPan(pan);
            cardVerification.SetExpDate(expdate);
            cardVerification.SetCryptType(crypt);
            cardVerification.SetAvsInfo(avsCheck);
            cardVerification.SetCvdInfo(cvdCheck);
            cardVerification.SetCofInfo(cof);

            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(cardVerification);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("ISO = " + receipt.GetISO());
                Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Ticket = " + receipt.GetTicket());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
                Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 18
0
        public static void Main(string[] args)
        {
            string store_id  = "store5";
            string api_token = "yesguy";
            string ecr_no    = "66013455";
            //string ecr_no = "66013455";
            string processing_country_code = "CA";

            OpenTotals opentotals = new OpenTotals();

            opentotals.SetEcrno(ecr_no);

            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(opentotals);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                if ((receipt.GetReceiptId()).Equals("Global Error Receipt") ||
                    receipt.GetReceiptId().Equals("") ||
                    receipt.GetReceiptId().Equals("null"))
                {
                    Console.WriteLine("CardType = null ");
                    Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                    Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                    Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                    Console.WriteLine("TransType = " + receipt.GetTransType());
                    Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                    Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                    Console.WriteLine("ISO = " + receipt.GetISO());
                    Console.WriteLine("BankTotals = null");
                    Console.WriteLine("Message = " + receipt.GetMessage());
                    Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                    Console.WriteLine("Complete = " + receipt.GetComplete());
                    Console.WriteLine("TransDate = " + receipt.GetTransDate());
                    Console.WriteLine("TransTime = " + receipt.GetTransTime());
                    Console.WriteLine("Ticket = " + receipt.GetTicket());
                    Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                }
                else
                {
                    foreach (string ecr in receipt.GetTerminalIDs())
                    {
                        Console.WriteLine("ECR: " + ecr);
                        foreach (string cardType in receipt.GetCreditCards(ecr))
                        {
                            Console.WriteLine("\tCard Type: " + cardType);

                            Console.WriteLine("\t\tPurchase: Count = "
                                              + receipt.GetPurchaseCount(ecr, cardType)
                                              + " Amount = "
                                              + receipt.GetPurchaseAmount(ecr,
                                                                          cardType));

                            Console.WriteLine("\t\tRefund: Count = "
                                              + receipt.GetRefundCount(ecr, cardType)
                                              + " Amount = "
                                              + receipt.GetRefundAmount(ecr, cardType));

                            Console.WriteLine("\t\tCorrection: Count = "
                                              + receipt.GetCorrectionCount(ecr, cardType)
                                              + " Amount = "
                                              + receipt.GetCorrectionAmount(ecr,
                                                                            cardType));
                        }
                    }
                }
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 19
0
        public static void Main(string[] args)
        {
            string store_id                = "store5";
            string api_token               = "yesguy";
            string order_id                = "Test20160815041411";
            string txn_number              = "118147-0_10";
            string crypt                   = "7";
            string dynamic_descriptor      = "123456";
            string processing_country_code = "CA";
            bool   status_check            = false;

            PurchaseCorrection purchasecorrection = new PurchaseCorrection();

            purchasecorrection.SetOrderId(order_id);
            purchasecorrection.SetTxnNumber(txn_number);
            purchasecorrection.SetCryptType(crypt);
            purchasecorrection.SetDynamicDescriptor(dynamic_descriptor);
            purchasecorrection.SetCustId("my customer id");

            //Optional - Set for Multi-Currency only
            //purchasecorrection.SetMCPCurrencyCode("840"); //ISO-4217 country currency number

            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(purchasecorrection);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("ISO = " + receipt.GetISO());
                Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Ticket = " + receipt.GetTicket());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
                Console.WriteLine("MCPAmount = " + receipt.GetMCPAmount());
                Console.WriteLine("MCPCurrencyCode = " + receipt.GetMCPCurrencyCode());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public static void Main(string[] args)
        {
            string order_id   = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string store_id   = "store5";
            string api_token  = "yesguy";
            string data_key   = "rS7DbroQHJmJxdBfXFXiauQc4";
            string amount     = "1.00";
            string cust_id    = "customer1";
            string crypt_type = "1";
            string processing_country_code = "CA";
            bool   status_check            = false;

            MCPResIndRefundCC mcpResIndRefundCC = new MCPResIndRefundCC();

            mcpResIndRefundCC.SetOrderId(order_id);
            mcpResIndRefundCC.SetCustId(cust_id);
            mcpResIndRefundCC.SetAmount(amount);
            mcpResIndRefundCC.SetCryptType(crypt_type);
            mcpResIndRefundCC.SetDataKey(data_key);

            //MCP Fields
            mcpResIndRefundCC.SetMCPVersion("1.0");
            mcpResIndRefundCC.SetCardholderAmount("500");
            mcpResIndRefundCC.SetCardholderCurrencyCode("840");
            //mcpResIndRefundCC.SetMCPRateToken("P1538681661706745");

            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(mcpResIndRefundCC);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("DataKey = " + receipt.GetDataKey());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
                Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
                Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
                Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
                Console.WriteLine("Phone = " + receipt.GetResDataPhone());
                Console.WriteLine("Email = " + receipt.GetResDataEmail());
                Console.WriteLine("Note = " + receipt.GetResDataNote());
                Console.WriteLine("Masked Pan = " + 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.WriteLine("MerchantSettlementAmount = " + receipt.GetMerchantSettlementAmount());
                Console.WriteLine("CardholderAmount = " + receipt.GetCardholderAmount());
                Console.WriteLine("CardholderCurrencyCode = " + receipt.GetCardholderCurrencyCode());
                Console.WriteLine("MCPRate = " + receipt.GetMCPRate());
                Console.WriteLine("MCPErrorStatusCode = " + receipt.GetMCPErrorStatusCode());
                Console.WriteLine("MCPErrorMessage = " + receipt.GetMCPErrorMessage());
                Console.WriteLine("HostId = " + receipt.GetHostId());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 21
0
        public static void Main(string[] args)
        {
            string store_id                = "store5";
            string api_token               = "yesguy";
            string amount                  = "2.00";
            string crypt                   = "7";
            string dynamic_descriptor      = "123456";
            string custid                  = "mycust9";
            string order_id                = "Test20190426104211";
            string txn_number              = "421264-0_14";
            string processing_country_code = "CA";
            bool   status_check            = false;

            MCPRefund mcpRefund = new MCPRefund();

            mcpRefund.SetTxnNumber(txn_number);
            mcpRefund.SetOrderId(order_id);
            mcpRefund.SetAmount(amount);
            mcpRefund.SetCryptType(crypt);
            mcpRefund.SetCustId(custid);
            mcpRefund.SetDynamicDescriptor(dynamic_descriptor);

            //MCP Fields
            mcpRefund.SetMCPVersion("1.0");
            mcpRefund.SetCardholderAmount("500");
            mcpRefund.SetCardholderCurrencyCode("840");
            //mcpRefund.SetMCPRateToken("P1538681661706745");

            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(mcpRefund);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("ISO = " + receipt.GetISO());
                Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Ticket = " + receipt.GetTicket());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());

                Console.WriteLine("MerchantSettlementAmount = " + receipt.GetMerchantSettlementAmount());
                Console.WriteLine("CardholderAmount = " + receipt.GetCardholderAmount());
                Console.WriteLine("CardholderCurrencyCode = " + receipt.GetCardholderCurrencyCode());
                Console.WriteLine("MCPRate = " + receipt.GetMCPRate());
                Console.WriteLine("MCPErrorStatusCode = " + receipt.GetMCPErrorStatusCode());
                Console.WriteLine("MCPErrorMessage = " + receipt.GetMCPErrorMessage());
                Console.WriteLine("HostId = " + receipt.GetHostId());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public static void Main(string[] args)
        {
            string store_id                = "moneris";
            string api_token               = "hurgle";
            string order_id                = "paypass_test1";
            string cust_id                 = "customer1";
            string amount                  = "1.00";
            string mp_request_token        = "47edbc7b56cac2b7ed27ab4d62214407";
            string crypt_type              = "7";
            string dynamic_descriptor      = "paypass1";
            string processing_country_code = "CA";

            PaypassPreauth paypassPreauth = new PaypassPreauth();

            paypassPreauth.SetOrderId(order_id);
            paypassPreauth.SetCustId(cust_id);
            paypassPreauth.SetAmount(amount);
            paypassPreauth.SetMpRequestToken(mp_request_token);
            paypassPreauth.SetCryptType(crypt_type);
            paypassPreauth.SetDynamicDescriptor(dynamic_descriptor);

            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(paypassPreauth);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("ISO = " + receipt.GetISO());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("Ticket = " + receipt.GetTicket());
                Console.WriteLine("MPRequestToken = " + receipt.GetMPRequestToken());
                Console.WriteLine("MPRedirectUrl = " + receipt.GetMPRedirectUrl());

                //PayPassInfo
                Console.WriteLine("\nCardBrandId = " + receipt.GetCardBrandId());
                Console.WriteLine("CardBrandName = " + receipt.GetCardBrandName());
                Console.WriteLine("CardBillingAddressCity = " + receipt.GetCardBillingAddressCity());
                Console.WriteLine("CardBillingAddressCountry = " + receipt.GetCardBillingAddressCountry());
                Console.WriteLine("CardBillingAddressCountrySubdivision = " + receipt.GetCardBillingAddressCountrySubdivision());
                Console.WriteLine("CardBillingAddressLine1 = " + receipt.GetCardBillingAddressLine1());
                Console.WriteLine("CardBillingAddressLine2 = " + receipt.GetCardBillingAddressLine2());
                Console.WriteLine("CardBillingAddressPostalCode = " + receipt.GetCardBillingAddressPostalCode());
                Console.WriteLine("CardCardHolderName = " + receipt.GetCardCardHolderName());
                Console.WriteLine("CardExpiryMonth = " + receipt.GetCardExpiryMonth());
                Console.WriteLine("CardExpiryYear = " + receipt.GetCardExpiryYear());
                Console.WriteLine("TransactionId = " + receipt.GetTransactionId());
                Console.WriteLine("ContactEmailAddress = " + receipt.GetContactEmailAddress());
                Console.WriteLine("ContactFirstName = " + receipt.GetContactFirstName());
                Console.WriteLine("ContactLastName = " + receipt.GetContactLastName());
                Console.WriteLine("ContactPhoneNumber = " + receipt.GetContactPhoneNumber());
                Console.WriteLine("ShippingAddressCity = " + receipt.GetShippingAddressCity());
                Console.WriteLine("ShippingAddressCountry = " + receipt.GetShippingAddressCountry());
                Console.WriteLine("ShippingAddressCountrySubdivision = " + receipt.GetShippingAddressCountrySubdivision());
                Console.WriteLine("ShippingAddressLine1 = " + receipt.GetShippingAddressLine1());
                Console.WriteLine("ShippingAddressLine2 = " + receipt.GetShippingAddressLine2());
                Console.WriteLine("ShippingAddressPostalCode = " + receipt.GetShippingAddressPostalCode());
                Console.WriteLine("ShippingAddressRecipientName = " + receipt.GetShippingAddressRecipientName());
                Console.WriteLine("ShippingAddressRecipientPhoneNumber = " + receipt.GetShippingAddressRecipientPhoneNumber());
                Console.WriteLine("PayPassWalletIndicator = " + receipt.GetPayPassWalletIndicator());
                Console.WriteLine("AuthenticationOptionsAuthenticateMethod = " + receipt.GetAuthenticationOptionsAuthenticateMethod());
                Console.WriteLine("AuthenticationOptionsCardEnrollmentMethod = " + receipt.GetAuthenticationOptionsCardEnrollmentMethod());
                Console.WriteLine("CardAccountNumber = " + receipt.GetCardAccountNumber());
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public static void Main(string[] args)
        {
            string store_id    = "store5";
            string api_token   = "yesguy";
            string order_id    = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string amount      = "10.00";
            string pan         = "4242424242424242";
            string expiry_date = "1901"; //YYMM format
            string crypt       = "7";

            /************************* Recur Variables **********************************/

            string recur_unit              = "month"; //eom = end of month
            string start_now               = "true";
            string start_date              = "2016/07/28";
            string num_recurs              = "12";
            string period                  = "1";
            string recur_amount            = "30.00";
            string processing_country_code = "CA";
            bool   status_check            = false;

            /************************* Recur Object Option1 ******************************/

            Recur recurring_cycle = new Recur(recur_unit, start_now, start_date,
                                              num_recurs, period, recur_amount);

            /************************* Recur Object Option2 ******************************/

            Hashtable recur_hash = new Hashtable();

            recur_hash.Add("recur_unit", recur_unit);
            recur_hash.Add("start_now", start_now);
            recur_hash.Add("start_date", start_date);
            recur_hash.Add("num_recurs", num_recurs);
            recur_hash.Add("period", period);
            recur_hash.Add("recur_amount", recur_amount);

            Recur recurring_cycle2 = new Recur(recur_hash);

            /************************ Transactional Object *******************************/

            Purchase purchase = new Purchase(order_id, amount, pan, expiry_date, crypt);

            /******************************* Set Recur ***********************************/

            purchase.SetRecur(recurring_cycle);

            CofInfo cof = new CofInfo();

            cof.SetPaymentIndicator("R");
            cof.SetPaymentInformation("2");
            cof.SetIssuerId("168451306048014");

            purchase.SetCofInfo(cof);

            /**************************** Https Post Request ***************************/

            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(purchase);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            /******************************* Receipt ***********************************/

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("ISO = " + receipt.GetISO());
                Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Ticket = " + receipt.GetTicket());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("Recur Success = " + receipt.GetRecurSuccess());
                Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
                Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public static void Main(string[] args)
        {
            string store_id  = "store5";
            string api_token = "yesguy";
            string data_key  = "V6F9PJKdXQj6vKiCMNrWbsyJ2";
            string order_id  = "Test_P_033333_6";
            string cust_id   = "Customer1";
            string crypt     = "7";
            string processing_country_code = "CA";
            bool   status_check            = false;

            /*************** Address Verification Service **********************/

            AvsInfo avsCheck = new AvsInfo();

            avsCheck.SetAvsStreetNumber("212");
            avsCheck.SetAvsStreetName("Payton Street");
            avsCheck.SetAvsZipCode("M1M1M1");

            /****************** Card Validation Digits *************************/

            CvdInfo cvdCheck = new CvdInfo();

            cvdCheck.SetCvdIndicator("1");
            cvdCheck.SetCvdValue("099");

            /*************** Credential on File *************************************/
            CofInfo cof = new CofInfo();

            cof.SetPaymentIndicator("U");
            cof.SetPaymentInformation("2");
            cof.SetIssuerId("168451306048014");

            ResCardVerificationCC rescardverify = new ResCardVerificationCC();

            rescardverify.SetDataKey(data_key);
            rescardverify.SetOrderId(order_id);
            rescardverify.SetCustId(cust_id);
            //rescardverify.SetExpDate("1612");  //for use with Temp Tokens only
            rescardverify.SetCryptType(crypt);
            rescardverify.SetAvsInfo(avsCheck);
            rescardverify.SetCvdInfo(cvdCheck);
            rescardverify.SetCofInfo(cof);

            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(rescardverify);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("ISO = " + receipt.GetISO());
                Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Ticket = " + receipt.GetTicket());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
                Console.WriteLine("IssuerId = " + receipt.GetIssuerId());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public static void Main(string[] args)
        {
            string store_id  = "moneris";
            string api_token = "hurgle";
            string processing_country_code = "CA";
            bool   status_check            = false;

            string order_id    = "ord-210916-12:06:38";
            string comp_amount = "62.37";
            string txn_number  = "18924-0_11";
            string crypt       = "7";

            //Create Table 1 with details
            string n101 = "R6";                           //Entity ID Code
            string n102 = "Retailing Inc. International"; //Name
            string n301 = "919 Oriole Rd.";               //Address Line 1
            string n401 = "Toronto";                      //City
            string n402 = "On";                           //State or Province
            string n403 = "H1T6W3";                       //Postal Code

            string[] ref01 = { "4C", "CR" };              //Reference ID Qualifier
            string[] ref02 = { "M5T3A5", "16802309004" }; //Reference ID

            string big04 = "PO7758545";                   //Purchase Order Number
            string big05 = "RN0049858";                   //Release Number
            string big10 = "INV99870E";                   //Invoice Number

            AxRef axRef1 = new AxRef();

            axRef1.SetRef(ref01[0], ref02[0]);
            axRef1.SetRef(ref01[1], ref02[1]);

            AxN1Loop n1Loop = new AxN1Loop();

            n1Loop.SetN1Loop(n101, n102, n301, n401, n402, n403, axRef1);

            AxTable1 table1 = new AxTable1();

            table1.SetBig04(big04);
            table1.SetBig05(big05);
            table1.SetBig10(big10);
            table1.SetN1Loop(n1Loop);

            //Create Table 2 with details
            //the sum of the extended amount field (pam05) must equal the level 1 amount field
            string[] it102 = { "1", "1", "1", "1", "1" };                                        //Line item quantity invoiced
            string[] it103 = { "EA", "EA", "EA", "EA", "EA" };                                   //Line item unit or basis of measurement code
            string[] it104 = { "10.00", "25.00", "8.62", "10.00", "-10.00" };                    //Line item unit price
            string[] it105 = { "", "", "", "", "" };                                             //Line item basis of unit price code

            string[] it10618 = { "MG", "MG", "MG", "MG", "MG" };                                 //Product/Service ID qualifier
            string[] it10719 = { "DJFR4", "JFJ49", "FEF33", "FEE43", "DISCOUNT" };               //Product/Service ID (corresponds to it10618)

            string[] txi01_GST = { "GS", "GS", "GS", "GS", "GS" };                               //Tax type code
            string[] txi02_GST = { "0.70", "1.75", "1.00", "0.80", "0.00" };                     //Monetary amount
            string[] txi03_GST = { "", "", "", "", "" };                                         //Percent
            string[] txi06_GST = { "", "", "", "", "" };                                         //Tax exempt code

            string[] txi01_PST = { "PG", "PG", "PG", "PG", "PG" };                               //Tax type code
            string[] txi02_PST = { "0.80", "2.00", "1.00", "0.80", "0.00" };                     //Monetary amount
            string[] txi03_PST = { "", "", "", "", "" };                                         //Percent
            string[] txi06_PST = { "", "", "", "", "" };                                         //Tax exempt code

            string[] pam05 = { "11.50", "28.75", "10.62", "11.50", "-10.00" };                   //Extended line-item amount
            string[] pid05 = { "Stapler", "Lamp", "Bottled Water", "Fountain Pen", "DISCOUNT" }; //Line item description

            AxIt106s[] it106s = { new AxIt106s(), new AxIt106s(), new AxIt106s(), new AxIt106s(), new AxIt106s() };

            it106s[0].SetIt10618(it10618[0]);
            it106s[0].SetIt10719(it10719[0]);

            it106s[1].SetIt10618(it10618[1]);
            it106s[1].SetIt10719(it10719[1]);

            it106s[2].SetIt10618(it10618[2]);
            it106s[2].SetIt10719(it10719[2]);

            it106s[3].SetIt10618(it10618[3]);
            it106s[3].SetIt10719(it10719[3]);

            it106s[4].SetIt10618(it10618[4]);
            it106s[4].SetIt10719(it10719[4]);

            AxTxi[] txi = { new AxTxi(), new AxTxi(), new AxTxi(), new AxTxi(), new AxTxi() };

            txi[0].SetTxi(txi01_GST[0], txi02_GST[0], txi03_GST[0], txi06_GST[0]);
            txi[0].SetTxi(txi01_PST[0], txi02_PST[0], txi03_PST[0], txi06_PST[0]);

            txi[1].SetTxi(txi01_GST[1], txi02_GST[1], txi03_GST[1], txi06_GST[1]);
            txi[1].SetTxi(txi01_PST[1], txi02_PST[1], txi03_PST[1], txi06_PST[1]);

            txi[2].SetTxi(txi01_GST[2], txi02_GST[2], txi03_GST[2], txi06_GST[2]);
            txi[2].SetTxi(txi01_PST[2], txi02_PST[2], txi03_PST[2], txi06_PST[2]);

            txi[3].SetTxi(txi01_GST[3], txi02_GST[3], txi03_GST[3], txi06_GST[3]);
            txi[3].SetTxi(txi01_PST[3], txi02_PST[3], txi03_PST[3], txi06_PST[3]);

            txi[4].SetTxi(txi01_GST[4], txi02_GST[4], txi03_GST[4], txi06_GST[4]);
            txi[4].SetTxi(txi01_PST[4], txi02_PST[4], txi03_PST[4], txi06_PST[4]);

            AxIt1Loop it1Loop = new AxIt1Loop();

            it1Loop.SetIt1Loop(it102[0], it103[0], it104[0], it105[0], it106s[0], txi[0], pam05[0], pid05[0]);
            it1Loop.SetIt1Loop(it102[1], it103[1], it104[1], it105[1], it106s[1], txi[1], pam05[1], pid05[1]);
            it1Loop.SetIt1Loop(it102[2], it103[2], it104[2], it105[2], it106s[2], txi[2], pam05[2], pid05[2]);
            it1Loop.SetIt1Loop(it102[3], it103[3], it104[3], it105[3], it106s[3], txi[3], pam05[3], pid05[3]);
            it1Loop.SetIt1Loop(it102[4], it103[4], it104[4], it105[4], it106s[4], txi[4], pam05[4], pid05[4]);

            AxTable2 table2 = new AxTable2();

            table2.SetIt1Loop(it1Loop);

            //Create Table 3 with details
            AxTxi taxTbl3 = new AxTxi();

            taxTbl3.SetTxi("GS", "4.25", "", "");               //sum of GST taxes
            taxTbl3.SetTxi("PG", "4.60", "", "");               //sum of PST taxes
            taxTbl3.SetTxi("TX", "8.85", "", "");               //sum of all taxes

            AxTable3 table3 = new AxTable3();

            table3.SetTxi(taxTbl3);

            //Create and Set Level23 Object
            AxLevel23 level23 = new AxLevel23();

            level23.SetTable1(table1);
            level23.SetTable2(table2);
            level23.SetTable3(table3);

            AxCompletion axCompletion = new AxCompletion();

            axCompletion.SetOrderId(order_id);
            axCompletion.SetCompAmount(comp_amount);
            axCompletion.SetTxnNumber(txn_number);
            axCompletion.SetCryptType(crypt);
            axCompletion.SetAxLevel23(level23);

            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(axCompletion);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("ISO = " + receipt.GetISO());
                Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Ticket = " + receipt.GetTicket());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 26
0
        public static void Main(string[] args)
        {
            string order_id  = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string store_id  = "monusqa138";
            string api_token = "qatoken";
            //string status = "true";
            string amount = "10.00";

            //ACHInfo Variables
            string sec                     = "ppd";
            string cust_first_name         = "Bob";
            string cust_last_name          = "Smith";
            string cust_address1           = "3300 Bloor St W";
            string cust_address2           = "4th floor west tower";
            string cust_city               = "Toronto";
            string cust_state              = "ON";
            string cust_zip                = "M1M1M1";
            string routing_num             = "490000018";
            string account_num             = "222222";
            string check_num               = "11";
            string account_type            = "checking";
            string micr                    = "t071000013t742941347o128";
            string dl_num                  = "CO-12312312";
            string magstripe               = "no";
            string image_front             = "";
            string image_back              = "";
            string convenience_fee         = "2.00";
            string processing_country_code = "US";
            bool   status_check            = false;

            ACHInfo achinfo = new ACHInfo(sec, cust_first_name, cust_last_name,
                                          cust_address1, cust_address2, cust_city, cust_state, cust_zip,
                                          routing_num, account_num, check_num, account_type, micr);

            ConvFeeInfo convFeeInfo = new ConvFeeInfo();

            convFeeInfo.SetConvenienceFee(convenience_fee);

            achinfo.SetImgFront(image_front);
            achinfo.SetImgBack(image_back);
            achinfo.SetDlNum(dl_num);
            achinfo.SetMagstripe(magstripe);

            ACHDebit achdebit = new ACHDebit();

            achdebit.SetOrderId(order_id);
            achdebit.SetAmount(amount);
            achdebit.SetAchInfo(achinfo);
            achdebit.SetConvFeeInfo(convFeeInfo);

            //************************OPTIONAL VARIABLES***************************

            //Cust_id Variable
            string cust_id = "customer1";

            achdebit.SetCustId(cust_id);

            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(achdebit);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            /*Status Check Example
             * ACHHttpsPostRequest mpgReq = new ACHHttpsPostRequest(host, store_id, api_token, status, achdebit);
             */

            /**********************   REQUEST  ************************/

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Ticket = " + receipt.GetTicket());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("CfSuccess = " + receipt.GetCfSuccess());
                Console.WriteLine("CfStatus = " + receipt.GetCfStatus());
                Console.WriteLine("FeeAmount = " + receipt.GetFeeAmount());
                Console.WriteLine("FeeRate = " + receipt.GetFeeRate());
                Console.WriteLine("FeeType = " + receipt.GetFeeType());
                //Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
                //Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
Exemplo n.º 27
0
        public static void Main(string[] args)
        {
            string store_id                = "monusqa002";
            string api_token               = "qatoken";
            string order_id                = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string cust_id                 = "my customer id";
            string amount                  = "9.00";
            string pan                     = "4242424242424242";
            string expdate                 = "1902"; //YYMM format
            string presentation_type       = "my presentation type";
            string intended_use            = "my indended use";
            string p_account_number        = "1234567890";
            string processing_country_code = "US";
            bool   status_check            = false;

            PinlessDebitPurchase pinless = new PinlessDebitPurchase();

            pinless.SetOrderId(order_id);
            pinless.SetCustId(cust_id);
            pinless.SetAmount(amount);
            pinless.SetPan(pan);
            pinless.SetExpDate(expdate);
            pinless.SetPresentationType(presentation_type);
            pinless.SetIntendedUse(intended_use);
            pinless.SetPAccountNumber(p_account_number);
            pinless.SetDynamicDescriptor("2134565");

            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(pinless);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Ticket = " + receipt.GetTicket());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                //Console.WriteLine("CardLevelResult = " + receipt.GetCardLevelResult());
                //Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
                //Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public static void Main(string[] args)
        {
            string store_id                = "monusqa002";
            string api_token               = "qatoken";
            string order_id                = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string amount                  = "5.00";
            string pan                     = "4242424242424242";
            string expdate                 = "1902"; //YYMM format
            string cust_id                 = "my customer id";
            string crypt                   = "7";
            string commcard_invoice        = "INV98798";
            string commcard_tax_amount     = "1.00";
            string processing_country_code = "US";
            bool   status_check            = false;

            AvsInfo avsCheck = new AvsInfo();

            avsCheck.SetAvsStreetNumber("212");
            avsCheck.SetAvsStreetName("Payton Street");
            avsCheck.SetAvsZipCode("M1M1M1");

            CvdInfo cvdCheck = new CvdInfo();

            cvdCheck.SetCvdIndicator("1");
            cvdCheck.SetCvdValue("099");

            Purchase purchase = new Purchase();

            purchase.SetOrderId(order_id);
            purchase.SetCustId(cust_id);
            purchase.SetAmount(amount);
            purchase.SetPan(pan);
            purchase.SetExpDate(expdate);
            purchase.SetCryptType(crypt);
            purchase.SetCommcardInvoice(commcard_invoice);
            purchase.SetCommcardTaxAmount(commcard_tax_amount);
            purchase.SetAvsInfo(avsCheck);
            purchase.SetCvdInfo(cvdCheck);

            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(purchase);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("ISO = " + receipt.GetISO());
                Console.WriteLine("BankTotals = " + receipt.GetBankTotals());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Ticket = " + receipt.GetTicket());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("Avs Response = " + receipt.GetAvsResultCode());
                Console.WriteLine("Cvd Response = " + receipt.GetCvdResultCode());
                Console.WriteLine("CardLevelResult = " + receipt.GetCardLevelResult());
                //Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
                //Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
        public static void Main(string[] args)
        {
            string order_id   = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string store_id   = "store5";
            string api_token  = "yesguy";
            string data_key   = "rS7DbroQHJmJxdBfXFXiauQc4";
            string amount     = "1.00";
            string cust_id    = "customer1"; //if sent will be submitted, otherwise cust_id from profile will be used
            string crypt_type = "1";
            string descriptor = "my descriptor";
            string processing_country_code = "CA";
            bool   status_check            = false;

            CofInfo cof = new CofInfo();

            cof.SetPaymentIndicator("U");
            cof.SetPaymentInformation("2");
            cof.SetIssuerId("168451306048014");

            ResPurchaseCC resPurchaseCC = new ResPurchaseCC();

            resPurchaseCC.SetDataKey(data_key);
            resPurchaseCC.SetOrderId(order_id);
            resPurchaseCC.SetCustId(cust_id);
            resPurchaseCC.SetAmount(amount);
            resPurchaseCC.SetCryptType(crypt_type);
            resPurchaseCC.SetDynamicDescriptor(descriptor);
            resPurchaseCC.SetCofInfo(cof);
            //resPurchaseCC.SetExpDate("1511"); //optional - use for temp token only

            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(resPurchaseCC);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("DataKey = " + receipt.GetDataKey());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("ResSuccess = " + receipt.GetResSuccess());
                Console.WriteLine("PaymentType = " + receipt.GetPaymentType());
                Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());
                Console.WriteLine("IssuerId = " + receipt.GetIssuerId());

                Console.WriteLine("Cust ID = " + receipt.GetResDataCustId());
                Console.WriteLine("Phone = " + receipt.GetResDataPhone());
                Console.WriteLine("Email = " + receipt.GetResDataEmail());
                Console.WriteLine("Note = " + receipt.GetResDataNote());
                Console.WriteLine("Masked Pan = " + 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);
            }
        }
        public static void Main(string[] args)
        {
            string store_id                = "monca00392";
            string api_token               = "qYdISUhHiOdfTr1CLNpN";
            string order_id                = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string amount                  = "5.00";
            string pan                     = "4242424242424242";
            string expdate                 = "1602"; //YYMM format
            string crypt                   = "7";
            string convenience_fee         = "1.00";
            string processing_country_code = "CA";
            bool   status_check            = false;

            ConvFeeInfo convFeeInfo = new ConvFeeInfo();

            convFeeInfo.SetConvenienceFee(convenience_fee);

            Purchase purchase = new Purchase();

            purchase.SetOrderId(order_id);
            purchase.SetAmount(amount);
            purchase.SetPan(pan);
            purchase.SetExpDate(expdate);
            purchase.SetCryptType(crypt);
            purchase.SetConvFeeInfo(convFeeInfo);

            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(purchase);
            mpgReq.SetStatusCheck(status_check);
            mpgReq.Send();

            try
            {
                Receipt receipt = mpgReq.GetReceipt();

                Console.WriteLine("CardType = " + receipt.GetCardType());
                Console.WriteLine("TransAmount = " + receipt.GetTransAmount());
                Console.WriteLine("TxnNumber = " + receipt.GetTxnNumber());
                Console.WriteLine("ReceiptId = " + receipt.GetReceiptId());
                Console.WriteLine("TransType = " + receipt.GetTransType());
                Console.WriteLine("ReferenceNum = " + receipt.GetReferenceNum());
                Console.WriteLine("ResponseCode = " + receipt.GetResponseCode());
                Console.WriteLine("Message = " + receipt.GetMessage());
                Console.WriteLine("AuthCode = " + receipt.GetAuthCode());
                Console.WriteLine("Complete = " + receipt.GetComplete());
                Console.WriteLine("TransDate = " + receipt.GetTransDate());
                Console.WriteLine("TransTime = " + receipt.GetTransTime());
                Console.WriteLine("Ticket = " + receipt.GetTicket());
                Console.WriteLine("TimedOut = " + receipt.GetTimedOut());
                Console.WriteLine("CfSuccess = " + receipt.GetCfSuccess());
                Console.WriteLine("CfStatus = " + receipt.GetCfStatus());
                Console.WriteLine("FeeAmount = " + receipt.GetFeeAmount());
                Console.WriteLine("FeeRate = " + receipt.GetFeeRate());
                Console.WriteLine("FeeType = " + receipt.GetFeeType());
                //Console.WriteLine("CardLevelResult = " + receipt.GetCardLevelResult());
                //Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
                //Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }