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 = "2"; 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); /************************* Recur Variables **********************************/ string recur_unit = "month"; string start_now = "true"; string start_date = "2019/12/01"; string num_recurs = "12"; string period = "1"; string recur_amount = "30.00"; /************************* Recur Object Option1 ******************************/ Recur recurring_cycle = new Recur(recur_unit, start_now, start_date, num_recurs, period, recur_amount); resPurchaseCC.SetRecur(recurring_cycle); /********************* Credential on File *****************************************/ CofInfo cof = new CofInfo(); cof.SetPaymentIndicator("R"); cof.SetPaymentInformation("2"); cof.SetIssuerId("168451306048014"); resPurchaseCC.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(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("AVSResponse = " + receipt.GetAvsResultCode()); Console.WriteLine("CVDResponse = " + receipt.GetCvdResultCode()); Console.WriteLine("RecurSuccess = " + receipt.GetRecurSuccess()); Console.WriteLine("ResSuccess = " + receipt.GetResSuccess()); Console.WriteLine("PaymentType = " + receipt.GetPaymentType()); 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 = "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"); ResCavvPreauthCC resCavvPreauthCC = new ResCavvPreauthCC(); resCavvPreauthCC.SetOrderId(order_id); resCavvPreauthCC.SetDataKey(data_key); resCavvPreauthCC.SetCustId(cust_id); resCavvPreauthCC.SetAmount(amount); resCavvPreauthCC.SetCavv(cavv); //resCavvPreauthCC.SetExpDate(expdate); //mandatory for temp token only resCavvPreauthCC.SetThreeDSVersion("2"); //Mandatory for 3DS Version 2.0+ resCavvPreauthCC.SetThreeDSServerTransId("e11d4985-8d25-40ed-99d6-c3803fe5e68f"); //Mandatory for 3DS Version 2.0+ - obtained from MpiCavvLookup or MpiThreeDSAuthentication resCavvPreauthCC.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(resCavvPreauthCC); 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) { string store_id = "store5"; string api_token = "yesguy"; string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss"); string amount = "5.00"; string pan = "4242424242424242"; string expdate = "0412"; string crypt = "7"; string processing_country_code = "CA"; bool status_check = false; CofInfo cof = new CofInfo(); cof.SetPaymentIndicator("U"); cof.SetPaymentInformation("2"); cof.SetIssuerId("168451306048014"); PreAuth preauth = new PreAuth(); preauth.SetOrderId(order_id); preauth.SetAmount(amount); preauth.SetPan(pan); preauth.SetExpDate(expdate); preauth.SetCryptType(crypt); //preauth.SetWalletIndicator(""); //Refer to documentation for details preauth.SetCofInfo(cof); //preauth.SetCmId("8nAK8712sGaAkls56"); //set only for usage with Offlinx - Unique max 50 alphanumeric characters transaction id generated by merchant 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("IsVisaDebit = " + receipt.GetIsVisaDebit()); //Console.WriteLine("StatusCode = " + receipt.GetStatusCode()); //Console.WriteLine("StatusMessage = " + receipt.GetStatusMessage()); Console.WriteLine("IssuerId = " + receipt.GetIssuerId()); Console.ReadLine(); } catch (Exception e) { Console.WriteLine(e); } }
public static void Test(string StoreName, string Api_Token, string CreditCardNumber) { string order_id = "Test" + DateTime.Now.ToString("yyyyMMddhhmmss"); //string store_id = "store5"; string store_id = StoreName; //string api_token = "yesguy"; string api_token = Api_Token; string amount = "5.00"; string pan = "4242424242424242"; string expdate = "1901"; //YYMM format string crypt = "7"; string processing_country_code = "CA"; bool status_check = false; CofInfo cof = new CofInfo(); cof.SetPaymentIndicator("U"); cof.SetPaymentInformation("2"); cof.SetIssuerId("168451306048014"); Purchase purchase = new Purchase(); purchase.SetOrderId(order_id); purchase.SetAmount(amount); ///Credit card number purchase.SetPan(pan); purchase.SetExpDate("2011"); purchase.SetCryptType(crypt); purchase.SetDynamicDescriptor("2134565"); //purchase.SetWalletIndicator(""); //Refer to documentation for details //purchase.SetCofInfo(cof); //Optional - Set for Multi-Currency only //setAmount must be 0.00 when using multi-currency //purchase.SetMCPAmount("500"); //penny value amount 1.25 = 125 //purchase.SetMCPCurrencyCode("840"); //ISO-4217 country currency number //purchase.SetCmId("8nAK8712sGaAkls56"); //set only for usage with Offlinx - Unique max 50 alphanumeric characters transaction id generated by merchant HttpsPostRequest mpgReq = new HttpsPostRequest(); var sp = ServicePointManager.SecurityProtocol; ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; 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(); ServicePointManager.SecurityProtocol = sp; 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("HostId = " + receipt.GetHostId()); Console.WriteLine("MCPAmount = " + receipt.GetMCPAmount()); Console.WriteLine("MCPCurrencyCode = " + receipt.GetMCPCurrencyCode()); Console.WriteLine("IssuerId = " + receipt.GetIssuerId()); 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 amount = "5.00"; string pan = "4242424242424242"; string expdate = "1901"; //YYMM format string crypt = "7"; string processing_country_code = "CA"; bool status_check = false; CofInfo cof = new CofInfo(); cof.SetPaymentIndicator("U"); cof.SetPaymentInformation("2"); cof.SetIssuerId("168451306048014"); MCPPurchase mcpPurchase = new MCPPurchase(); mcpPurchase.SetOrderId(order_id); mcpPurchase.SetAmount(amount); mcpPurchase.SetPan(pan); mcpPurchase.SetExpDate("2011"); mcpPurchase.SetCryptType(crypt); mcpPurchase.SetDynamicDescriptor("2134565"); //mcpPurchase.SetWalletIndicator(""); //Refer to documentation for details mcpPurchase.SetCofInfo(cof); //MCP Fields mcpPurchase.SetMCPVersion("1.0"); mcpPurchase.SetCardholderAmount("500"); mcpPurchase.SetCardholderCurrencyCode("840"); //mcpPurchase.SetMCPRateToken("P1538681661706745"); //mcpPurchase.SetCmId("8nAK8712sGaAkls56"); //set only for usage with Offlinx - Unique max 50 alphanumeric characters transaction id generated by merchant 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(mcpPurchase); 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("HostId = " + receipt.GetHostId()); Console.WriteLine("IssuerId = " + receipt.GetIssuerId()); 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 = "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 = "1911"; //YYMM format 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"); CavvPreAuth cavvPreauth = new CavvPreAuth(); cavvPreauth.SetOrderId(order_id); cavvPreauth.SetCustId(cust_id); cavvPreauth.SetAmount(amount); cavvPreauth.SetPan(pan); cavvPreauth.SetExpDate(expdate); cavvPreauth.SetCavv(cavv); cavvPreauth.SetCryptType(crypt_type); //Mandatory for AMEX cards only cavvPreauth.SetDynamicDescriptor(dynamic_descriptor); //cavvPreauth.SetWalletIndicator(wallet_indicator); //set only wallet transactions e.g. APPLE PAY //cavvPreauth.SetCmId("8nAK8712sGaAkls56"); //set only for usage with Offlinx - Unique max 50 alphanumeric characters transaction id generated by merchant cavvPreauth.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(cavvPreauth); 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.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 dynamic_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"); ResPreauthCC resPreauthCC = new ResPreauthCC(); resPreauthCC.SetDataKey(data_key); resPreauthCC.SetOrderId(order_id); resPreauthCC.SetCustId(cust_id); resPreauthCC.SetAmount(amount); resPreauthCC.SetCryptType(crypt_type); resPreauthCC.SetDynamicDescriptor(dynamic_descriptor); resPreauthCC.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(resPreauthCC); 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 = "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; /************************* Recur Variables **********************************/ string recur_unit = "month"; //eom = end of month string start_now = "true"; string start_date = "2018/02/25"; string num_recurs = "12"; string period = "1"; string recur_amount = "30.00"; /************************* 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); CofInfo cof = new CofInfo(); cof.SetPaymentIndicator("R"); 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.SetRecur(recurring_cycle); 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); } }
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 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); } }
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); } }