本文整理汇总了C#中Purchase.SetCvdInfo方法的典型用法代码示例。如果您正苦于以下问题:C# Purchase.SetCvdInfo方法的具体用法?C# Purchase.SetCvdInfo怎么用?C# Purchase.SetCvdInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Purchase
的用法示例。
在下文中一共展示了Purchase.SetCvdInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
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("[email protected]");
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);
}
}