public static void Main(string[] args)
        {
            string order_id  = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string store_id  = "store5";
            string api_token = "yesguy";
            string cust_id   = "my customer id";
            string amount    = "20.00";
            string pan       = "4242424242424242";
            string expdate   = "1901"; //YYMM
            string crypt     = "7";
            string processing_country_code = "CA";
            bool   status_check            = false;

            IndependentRefund indrefund = new IndependentRefund();

            indrefund.SetOrderId(order_id);
            indrefund.SetCustId(cust_id);
            indrefund.SetAmount(amount);
            indrefund.SetPan(pan);
            indrefund.SetExpDate(expdate);
            indrefund.SetCryptType(crypt);
            indrefund.SetDynamicDescriptor("123456");

            //Optional - Set for Multi-Currency only
            //setAmount must be 0.00 when using multi-currency
            //indrefund.SetMCPAmount("500"); //penny value amount 1.25 = 125
            //indrefund.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(indrefund);
            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 store_id                = "store5";
            string api_token               = "yesguy";
            string order_id                = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string cust_id                 = "LBriggs";
            string amount                  = "1.00";
            string pos_code                = "00";
            string device_type             = "idtech_bdk";
            string processing_country_code = "CA";
            bool   status_check            = false;
            string dynamic_descriptor      = "my descriptor";

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


            EncTrack2Purchase encpurchase = new EncTrack2Purchase();

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

            AvsInfo avsCheck = new AvsInfo();

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

            encpurchase.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(encpurchase);
            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("MaskedPan = " + receipt.GetMaskedPan());
                Console.WriteLine("CardLevelResult = " + receipt.GetCardLevelResult());
                Console.WriteLine("AVS Response = " + receipt.GetAvsResultCode());
            }
            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        = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string cust_id         = "CUST13343";
            string amount          = "5.00";
            string pan             = "4242424254545454";
            string expiry_date     = "2012";       //YYMM
            string auth_code       = "123456";
            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";

            VsForcePost vsForcePost = new VsForcePost();

            vsForcePost.SetOrderId(order_id);
            vsForcePost.SetCustId(cust_id);
            vsForcePost.SetAmount(amount);
            vsForcePost.SetPan(pan);
            vsForcePost.SetExpDate(expiry_date);
            vsForcePost.SetAuthCode(auth_code);
            vsForcePost.SetCryptType(crypt);
            vsForcePost.SetNationalTax(national_tax);
            vsForcePost.SetMerchantVatNo(merchant_vat_no);
            vsForcePost.SetLocalTax(local_tax);
            vsForcePost.SetCustomerVatNo(customer_vat_no);
            vsForcePost.SetCri(cri);
            vsForcePost.SetCustomerCode(customer_code);
            vsForcePost.SetInvoiceNumber(invoice_number);
            vsForcePost.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(vsForcePost);
            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)
        {
            /************************* Post Request Variables *****************************/

            string host      = "esqa.moneris.com";
            string store_id  = "store5";
            string api_token = "yesguy";

            /************************* Transactional Variables ***************************/

            string order_id      = "Need_Unique_Order_ID_1234567";
            string orig_order_id = "Need_Unique_Order_ID_12345";
            string amount        = "304.00";
            string txn_number    = "174885-0_7";
            string crypt         = "7";

            /********************* 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 **************************/

            ReAuth reauth = new ReAuth(order_id, orig_order_id, txn_number, amount, crypt);

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

            reauth.SetCustInfo(customer);

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

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

            /******************************* 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("IsVisaDebit = " + receipt.GetIsVisaDebit());
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
예제 #5
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                 = "LBriggs";
            string amount                  = "5.00";
            string track2                  = ";5258968987035454=06061015454001060101?";
            string pan                     = null;
            string exp                     = "0000"; //must send '0000' if swiped
            string pos_code                = "00";
            string commcard_invoice        = "INV98798";
            string commcard_tax_amount     = "1.00";
            string descriptor              = "my descriptor";
            string processing_country_code = "US";
            bool   status_check            = false;

            Track2PreAuth track2preauth = new Track2PreAuth();

            track2preauth.SetOrderId(order_id);
            track2preauth.SetCustId(cust_id);
            track2preauth.SetAmount(amount);
            track2preauth.SetTrack2(track2);
            track2preauth.SetPan(pan);
            track2preauth.SetExpDate(exp);
            track2preauth.SetPosCode(pos_code);
            track2preauth.SetDynamicDescriptor(descriptor);
            track2preauth.SetCommcardInvoice(commcard_invoice);
            track2preauth.SetCommcardTaxAmount(commcard_tax_amount);

            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(track2preauth);
            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("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                = "monusqa138";
            string api_token               = "qatoken";
            string order_id                = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss");
            string amount                  = "5.00";
            string pan                     = "4005554444444403";
            string expdate                 = "1602"; //YYMM format
            string crypt                   = "7";
            string commcard_invoice        = "INVC090";
            string commcard_tax_amount     = "1.00";
            string cust_id                 = "my customer id";
            string convenience_fee         = "1.00";
            string processing_country_code = "US";
            bool   status_check            = false;

            ConvFeeInfo convFeeInfo = new ConvFeeInfo();

            convFeeInfo.SetConvenienceFee(convenience_fee);

            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.SetConvFeeInfo(convFeeInfo);

            /********************* 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 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]);

            purchase.SetCustInfo(customer);

            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("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);
            }
        }
예제 #7
0
        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   = "Lance_Briggs_55";
            string amount    = "5.00";
            string track2    = "5268051119993326=0609AAAAAAAAAAAAA000";
            string processing_country_code = "CA";
            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 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]);

            /************************** Request *************************/

            IDebitPurchase IOP_Txn = new IDebitPurchase();

            IOP_Txn.SetOrderId(order_id);
            IOP_Txn.SetCustId(cust_id);
            IOP_Txn.SetAmount(amount);
            IOP_Txn.SetIdebitTrack2(track2);

            IOP_Txn.SetCustInfo(customer);

            //IOP_Txn.SetDynamicDescriptor("dynamicdescriptor1");

            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(IOP_Txn);
            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.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
예제 #8
0
        public static void Main()
        {
            string host       = "esqa.moneris.com";
            string store_id   = "moneris";
            string api_token  = "hurgle";
            string order_id   = "PPOPOOLO";
            string txn_number = "25972-283-1";

            string customerCode    = "ACCOUNTING OPERAT";
            double taxAmount0      = 0.98;
            double freightAmount   = 0.0;
            string shipToPosCode   = "V6Z 2V8";
            string shipFromPosCode = "V5C 3W9";
            double dutyAmount      = 0.0;
            string altTaxAmtInd    = "Y";
            double altTaxAmt       = 0.0;
            string desCouCode      = "CAN";
            string supData         = "MASTERCARD";
            string salTaxColInd    = "Y";

            /***************************** Level 2 Addendum **********************************/

            MCLevel2Transaction level2 =
                new MCLevel2Transaction(customerCode, taxAmount0, freightAmount, shipToPosCode,
                                        shipFromPosCode, dutyAmount, altTaxAmtInd,
                                        altTaxAmt, desCouCode, supData, salTaxColInd);

            /***************************** Level 3 Addendum **********************************/

            MCLevel3Transaction[] level3 = new MCLevel3Transaction[2];

            string[] productCode            = new string[] { "OPTIBELT 4L1", "OPTIBELT 4L2" };
            string[] itemDescription        = new string[] { "OPTIBELT 4L250 FHP BELT", "OPTIBELT 4L260 FHP BELT" };
            int[]    itemQuantity           = new int[] { 2, 2 };
            string[] itemUom                = new string[] { "EA", "EA" };
            double[] extItemAmount          = new double[] { 0.01, 0.01 };
            string[] discountInd            = new string[] { "N", "N" };
            double[] discountAmount         = new double[] { 0.0, 0.0 };
            string[] netGroIndForExtItemAmt = new string[] { "N", "N" };
            double[] taxRateApp             = new double[] { 0.06, 0.11 };
            string[] taxTypeApp             = new string[] { "", "" };
            double[] taxAmount              = new double[] { 0.0, 0.0 };
            string[] debitCreditInd         = new string[] { "D", "D" };
            double[] altTaxIdeAmt           = new double[] { 0.0, 0.0 };

            level3[0] = new MCLevel3Transaction(productCode[0], itemDescription[0], itemQuantity[0],
                                                itemUom[0], extItemAmount[0], discountInd[0],
                                                discountAmount[0], netGroIndForExtItemAmt[0],
                                                taxRateApp[0], taxTypeApp[0], taxAmount[0],

                                                //the other way to create a MCLevel3Transaction object
                                                debitCreditInd[0], altTaxIdeAmt[0]);
            level3[1]                        = new MCLevel3Transaction();
            level3[1].ProductCode            = productCode[1];
            level3[1].ItemDescription        = itemDescription[1];
            level3[1].ItemQuantity           = itemQuantity[1];
            level3[1].ItemUom                = itemUom[1];
            level3[1].ExtItemAmount          = extItemAmount[1];
            level3[1].DiscountInd            = discountInd[1];
            level3[1].DiscountAmount         = discountAmount[1];
            level3[1].NetGroIndForExtItemAmt = netGroIndForExtItemAmt[1];
            level3[1].TaxRateApp             = taxRateApp[1];
            level3[1].TaxTypeApp             = taxTypeApp[1];
            level3[1].TaxAmount              = taxAmount[1];
            level3[1].DebitCreditInd         = debitCreditInd[1];
            level3[1].AltTaxIdeAmt           = altTaxIdeAmt[1];

            try
            {
                /******************************** Request **********************************/

                L23HttpsPostRequest request =
                    new L23HttpsPostRequest(host, store_id, api_token,
                                            new MCLevel23(order_id, txn_number, level2, level3));

                /******************************** Response **********************************/

                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);
            }
        }
예제 #9
0
        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   = "Test20170119035118";
            string amount     = "62.37";
            string txn_number = "660117311862017019155117711-0_11";
            string crypt      = "7";

            string airline_process_id  = "000";               //Airline three-digit IATA code, Mandatory, Alphanumberic/3
            string invoice_batch       = "580";               //Three-digit code that specifies processing options, Mandatory, Numeric/3
            string establishment_name  = "TestEstablishment"; //Name of the ticket issuer, Mandatory, Alphanumberic/21
            string carrier_name        = "M AIR";             //Name of the ticketing airline, Mandatory, Alphanumberic/8
            string ticket_id           = "83060915430001";    //Ticket or document number, Mandatory, Numeric/14
            string issue_city          = "Toronto";           //Name of the city, Mandatory, Alphanumberic/13
            string establishment_state = "ON";                //State or province code, Mandatory, Alphanumberic/2
            string number_in_party     = "2";                 //Number of the people, Optional, Numeric/3
            string passenger_name      = "TestPassenger";     //Passenger name, Mandatory, Alphanumberic/20
            string taa_routing         = "YYZ";               //Flight stopover and city/airport codes, Mandatory, Alphanumberic/20
            string carrier_code        = "ClassA";            //Carrier designator codes, Mandatory, Alphanumberic/8
            string fare_basis          = "Regular";           //Primary and secondary discount codes, Mandatory, Alphanumberic/24
            string document_type       = "00";                //Airline document type code, Mandatory, Numeric/2
            string doc_number          = "5908";              //Number assigned to the airline document, Mandatory, Numeric/4
            string departure_date      = "0916";              //Departure date, Mandatory, Numeric/4 (MMDD)

            AxRaLevel23 raLevel23 = new AxRaLevel23();

            raLevel23.SetAirlineProcessId(airline_process_id);
            raLevel23.SetInvoiceBatch(invoice_batch);
            raLevel23.SetEstablishmentName(establishment_name);
            raLevel23.SetCarrierName(carrier_name);
            raLevel23.SetTicketId(ticket_id);
            raLevel23.SetIssueCity(issue_city);
            raLevel23.SetEstablishmentState(establishment_state);
            raLevel23.SetNumberInParty(number_in_party);
            raLevel23.SetPassengerName(passenger_name);
            raLevel23.SetTaaRouting(taa_routing);
            raLevel23.SetCarrierCode(carrier_code);
            raLevel23.SetFareBasis(fare_basis);
            raLevel23.SetDocumentType(document_type);
            raLevel23.SetDocNumber(doc_number);
            raLevel23.SetDepartureDate(departure_date);

            AxRaRefund axRaRefund = new AxRaRefund();

            axRaRefund.SetOrderId(order_id);
            axRaRefund.SetAmount(amount);
            axRaRefund.SetTxnNumber(txn_number);
            axRaRefund.SetCryptType(crypt);
            axRaRefund.SetAxRaLevel23(raLevel23);

            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(axRaRefund);
            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);
            }
        }
예제 #10
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                 = "B_Urlac_54";
            string amount                  = "10.42";
            string pan                     = "4005554444444403";
            string expdate                 = "1901"; //YYMM format
            string cavv                    = "AAABBJg0VhI0VniQEjRWAAAAAAA";
            string crypt_type              = "5";
            string commcard_invoice        = "COINV982";
            string commcard_tax_amount     = "1.00";
            string dynamic_descriptor      = "my descriptor";
            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");

            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.SetCommcardInvoice(commcard_invoice);
            cavvPurchase.SetCommcardTaxAmount(commcard_tax_amount);
            cavvPurchase.SetAvsInfo(avsCheck);
            cavvPurchase.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(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("Avs Response = " + receipt.GetAvsResultCode());
                Console.WriteLine("Cvd Response = " + receipt.GetCvdResultCode());
                //Console.WriteLine("CardLevelResult = " + receipt.GetCardLevelResult());
                Console.WriteLine("CavvResultCode = " + receipt.GetCavvResultCode());
                //Console.WriteLine("StatusCode = " + receipt.GetStatusCode());
                //Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage());
                Console.ReadLine();
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }