private AvsInfo AssignAVSValidationFieldsFromPaymentMethod(Entity paymentMethod, AvsInfo avsCheck, LocalPluginContext localContext, IOrganizationService service)
 {
     localContext.TracingService.Trace("Entering AssignAVSValidationFieldsFromPaymentMethod().");
     try
     {
         if (!paymentMethod.Contains("msnfp_billing_line1") || !paymentMethod.Contains("msnfp_billing_postalcode"))
         {
             localContext.TracingService.Trace("Customer is missing either msnfp_billing_line1 or msnfp_billing_postalcode fields on their payment method. Exiting plugin.");
             throw new Exception("Customer is missing either msnfp_billing_line1 or msnfp_billing_postalcode fields on their payment method. Exiting plugin.");
         }
         string[] array = ((string)paymentMethod["msnfp_billing_line1"]).Split(' ');
         if (array.Length <= 1)
         {
             localContext.TracingService.Trace("Could not split address for AVS Validation. Please ensure the Street 1 billing address on the payment method is in the form '123 Example Street'. Exiting plugin.");
             throw new ArgumentNullException("msnfp_billing_line1");
         }
         string text = (string)paymentMethod["msnfp_billing_line1"];
         localContext.TracingService.Trace("Unformatted Street Name: " + text);
         text = text.Replace(array[0], "").Trim(' ');
         localContext.TracingService.Trace("Formatted Street Name: " + text);
         localContext.TracingService.Trace("Formatted Street Number: " + array[0]);
         avsCheck.SetAvsStreetNumber(array[0]);
         avsCheck.SetAvsStreetName(text);
         avsCheck.SetAvsZipCode((string)paymentMethod["msnfp_billing_postalcode"]);
         if (paymentMethod.Contains("msnfp_emailaddress1"))
         {
             avsCheck.SetAvsEmail((string)paymentMethod["msnfp_emailaddress1"]);
         }
         avsCheck.SetAvsShipMethod("G");
         if (paymentMethod.Contains("msnfp_telephone1"))
         {
             avsCheck.SetAvsCustPhone((string)paymentMethod["msnfp_telephone1"]);
         }
         localContext.TracingService.Trace("Updated AVS Check variable successfully.");
     }
     catch (Exception ex)
     {
         localContext.TracingService.Trace("AssignAVSValidationFieldsFromPaymentMethod() Error: " + ex.ToString());
         throw new Exception("AssignAVSValidationFieldsFromPaymentMethod() Error: " + ex.ToString());
     }
     return(avsCheck);
 }
예제 #2
0
        public static void Main(string[] args)
        {
            string host = "esqa.moneris.com";
              string store_id = "store5";
              string api_token = "yesguy";

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

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

               	AvsInfo avsCheck = new AvsInfo();

               	avsCheck.SetAvsStreetNumber ("212");
               	avsCheck.SetAvsStreetName ("Payton Street");
               	avsCheck.SetAvsZipCode ("M1M1M1");
            avsCheck.SetAvsEmail ("*****@*****.**");
            avsCheck.SetAvsHostname ("hostname");
            avsCheck.SetAvsBrowser ("Mozilla");
            avsCheck.SetAvsShipToCountry ("Canada");
            avsCheck.SetAvsShipMethod ("Ground");
            avsCheck.SetAvsMerchProdSku ("123456");
            avsCheck.SetAvsCustIp ("192.168.0.1");
            avsCheck.SetAvsCustPhone ("5556667777");

            ReAuth reauthTxn = new ReAuth(order_id, orig_order_id, txn_number, amount, crypt);
               	reauthTxn.SetAvsInfo (avsCheck);

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

               	CvdInfo cvdCheck = new CvdInfo();
               	cvdCheck.SetCvdIndicator ("1");
               	cvdCheck.SetCvdValue ("099");

               	reauthTxn.SetCvdInfo (cvdCheck);

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

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

            /************************** 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("Avs Response = " + receipt.GetAvsResultCode());
                Console.WriteLine("Cvd Response = " + receipt.GetCvdResultCode());
                Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());

            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }
예제 #3
0
        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 = "Test_eFraud_dotNET_1234";
            string amount = "10.02";
            string pan = "4242424242424242";
            string expiry_date = "1111";
            string crypt = "7";

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

               	AvsInfo avsCheck = new AvsInfo();

               	avsCheck.SetAvsStreetNumber ("212");
               	avsCheck.SetAvsStreetName ("Payton Street");
               	avsCheck.SetAvsZipCode ("M1M1M1");
            avsCheck.SetAvsEmail("*****@*****.**");
            avsCheck.SetAvsHostname("hostname");
            avsCheck.SetAvsBrowser("Mozilla");
            avsCheck.SetAvsShipToCountry("CAN");
            avsCheck.SetAvsShipMethod("G");
            avsCheck.SetAvsMerchProdSku("123456");
            avsCheck.SetAvsCustIp("192.168.0.1");
            avsCheck.SetAvsCustPhone("5556667777");

               	Purchase purchaseTxn = new Purchase(order_id, amount, pan, expiry_date, crypt);
               	purchaseTxn.SetAvsInfo (avsCheck);

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

               	CvdInfo cvdCheck = new CvdInfo();
               	cvdCheck.SetCvdIndicator ("1");
               	cvdCheck.SetCvdValue ("099");

               	purchaseTxn.SetCvdInfo (cvdCheck);

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

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

            /************************** 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("Avs Response = " + receipt.GetAvsResultCode());
                Console.WriteLine("Cvd Response = " + receipt.GetCvdResultCode());
                Console.WriteLine("ITD Response = " + receipt.GetITDResponse());
                Console.WriteLine("IsVisaDebit = " + receipt.GetIsVisaDebit());

            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
        }