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 host = "esqa.moneris.com"; string store_id = "store5"; string api_token = "yesguy"; string data_key = "g90io5hS63qXu10Pu51512M8G"; string order_id = "res_purchase_7"; 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"; ResPurchaseCC resPurchaseCC = new ResPurchaseCC(data_key, order_id, cust_id, amount, crypt_type); /************************* Recur Variables **********************************/ string recur_unit = "month"; string start_now = "true"; string start_date = "2009/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); /********************** REQUEST ************************/ HttpsPostRequest mpgReq = new HttpsPostRequest(host, store_id, api_token, resPurchaseCC); 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()); //ResolveData Console.WriteLine("\nCust 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()); } catch (Exception e) { Console.WriteLine(e); } }