本文整理汇总了C#中Litle.Sdk.contact类的典型用法代码示例。如果您正苦于以下问题:C# contact类的具体用法?C# contact怎么用?C# contact使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
contact类属于Litle.Sdk命名空间,在下文中一共展示了contact类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestSimple
public void TestSimple()
{
updateSubscription update = new updateSubscription();
update.billingDate = new DateTime(2002, 10, 9);
contact billToAddress = new contact();
billToAddress.name = "Greg Dake";
billToAddress.city = "Lowell";
billToAddress.state = "MA";
billToAddress.email = "[email protected]";
update.billToAddress = billToAddress;
cardType card = new cardType();
card.number = "4100000000000001";
card.expDate = "1215";
card.type = methodOfPaymentTypeEnum.VI;
update.card = card;
update.planCode = "abcdefg";
update.subscriptionId = 12345;
var mock = new Mock<Communications>();
mock.Setup(Communications => Communications.HttpPost(It.IsRegex(".*<litleOnlineRequest.*?<updateSubscription>\r\n<subscriptionId>12345</subscriptionId>\r\n<planCode>abcdefg</planCode>\r\n<billToAddress>\r\n<name>Greg Dake</name>.*?</billToAddress>\r\n<card>\r\n<type>VI</type>.*?</card>\r\n<billingDate>2002-10-09</billingDate>\r\n</updateSubscription>\r\n</litleOnlineRequest>.*?.*", RegexOptions.Singleline), It.IsAny<Dictionary<String, String>>()))
.Returns("<litleOnlineResponse version='8.20' response='0' message='Valid Format' xmlns='http://www.litle.com/schema'><updateSubscriptionResponse ><litleTxnId>456</litleTxnId><response>000</response><message>Approved</message><responseTime>2013-09-04</responseTime><subscriptionId>12345</subscriptionId></updateSubscriptionResponse></litleOnlineResponse>");
Communications mockedCommunication = mock.Object;
litle.setCommunication(mockedCommunication);
updateSubscriptionResponse response = litle.UpdateSubscription(update);
Assert.AreEqual("12345", response.subscriptionId);
Assert.AreEqual("456", response.litleTxnId);
Assert.AreEqual("000", response.response);
Assert.NotNull(response.responseTime);
}
示例2: complexCaptureGivenAuth
public void complexCaptureGivenAuth()
{
captureGivenAuth capturegivenauth = new captureGivenAuth();
capturegivenauth.amount = 106;
capturegivenauth.orderId = "12344";
authInformation authInfo = new authInformation();
DateTime authDate = new DateTime(2002, 10, 9);
authInfo.authDate = authDate;
authInfo.authCode = "543216";
authInfo.authAmount = 12345;
capturegivenauth.authInformation = authInfo;
contact contact = new contact();
contact.name = "Bob";
contact.city = "lowell";
contact.state = "MA";
contact.email ="litle.com";
capturegivenauth.billToAddress = contact;
processingInstructions processinginstructions = new processingInstructions();
processinginstructions.bypassVelocityCheck = true;
capturegivenauth.processingInstructions = processinginstructions;
capturegivenauth.orderSource = orderSourceType.ecommerce;
cardType card = new cardType();
card.type = methodOfPaymentTypeEnum.VI;
card.number = "4100000000000000";
card.expDate = "1210";
capturegivenauth.card = card;
captureGivenAuthResponse response = litle.CaptureGivenAuth(capturegivenauth);
Assert.AreEqual("Approved", response.message);
}
示例3: EcheckSaleWithEcheckToken
public void EcheckSaleWithEcheckToken()
{
echeckSale echeckSaleObj = new echeckSale();
echeckSaleObj.reportGroup = "Planets";
echeckSaleObj.amount = 123456;
echeckSaleObj.verify = true;
echeckSaleObj.orderId = "12345";
echeckSaleObj.orderSource = orderSourceType.ecommerce;
echeckTokenType echeckTokenTypeObj = new echeckTokenType();
echeckTokenTypeObj.accType = echeckAccountTypeEnum.Checking;
echeckTokenTypeObj.litleToken = "1234565789012";
echeckTokenTypeObj.routingNum = "123456789";
echeckTokenTypeObj.checkNum = "123455";
customBilling customBillingObj = new customBilling();
customBillingObj.phone = "123456789";
customBillingObj.descriptor = "good";
contact contactObj = new contact();
contactObj.name = "Bob";
contactObj.city = "lowell";
contactObj.state = "MA";
contactObj.email = "litle.com";
echeckSaleObj.token = echeckTokenTypeObj;
echeckSaleObj.customBilling = customBillingObj;
echeckSaleObj.billToAddress = contactObj;
echeckSalesResponse response = litle.EcheckSale(echeckSaleObj);
StringAssert.AreEqualIgnoringCase("Approved", response.message);
}
示例4: SimpleEcheckVerification
public void SimpleEcheckVerification()
{
LitleOnline lOnlineObj = new LitleOnline();
echeckVerification echeckVerificationObject = new echeckVerification();
echeckVerificationObject.amount = 123456;
echeckVerificationObject.orderId = "12345";
echeckVerificationObject.orderSource = orderSourceType.ecommerce;
echeckType echeckTypeObj = new echeckType();
echeckTypeObj.accType = echeckAccountTypeEnum.Checking;
echeckTypeObj.accNum = "12345657890";
echeckTypeObj.routingNum = "123456789";
echeckTypeObj.checkNum = "123455";
contact contactObj = new contact();
contactObj.name = "Bob";
contactObj.city = "lowell";
contactObj.state = "MA";
contactObj.email = "litle.com";
echeckVerificationObject.echeck = echeckTypeObj;
echeckVerificationObject.billToAddress = contactObj;
echeckVerificationResponse response = lOnlineObj.EcheckVerification(echeckVerificationObject);
StringAssert.AreEqualIgnoringCase("Approved", response.message);
}
示例5: test37
public void test37()
{
echeckVerification verification = new echeckVerification();
verification.orderId = "37";
verification.amount = 3001;
verification.orderSource = orderSourceType.telephone;
contact billToAddress = new contact();
billToAddress.firstName = "Tom";
billToAddress.lastName = "Black";
verification.billToAddress = billToAddress;
echeckType echeck = new echeckType();
echeck.accNum = "[email protected]";
echeck.accType = echeckAccountTypeEnum.Checking;
echeck.routingNum = "053100300";
verification.echeck = echeck;
echeckVerificationResponse response = litle.EcheckVerification(verification);
Assert.AreEqual("301", response.response);
Assert.AreEqual("Invalid Account Number", response.message);
}
示例6: test32
public void test32()
{
authorization auth = new authorization();
auth.orderId = "32";
auth.amount = 10010;
auth.orderSource = orderSourceType.ecommerce;
contact billToAddress = new contact();
billToAddress.name = "John Smith";
billToAddress.addressLine1 = "1 Main St.";
billToAddress.city = "Burlington";
billToAddress.state = "MA";
billToAddress.zip = "01803-3747";
billToAddress.country = countryTypeEnum.US;
auth.billToAddress = billToAddress;
cardType card = new cardType();
card.number = "4457010000000009";
card.expDate = "0112";
card.cardValidationNum = "349";
card.type = methodOfPaymentTypeEnum.VI;
auth.card = card;
authorizationResponse authorizeResponse = litle.Authorize(auth);
Assert.AreEqual("000", authorizeResponse.response);
Assert.AreEqual("Approved", authorizeResponse.message);
Assert.AreEqual("11111 ", authorizeResponse.authCode);
Assert.AreEqual("01", authorizeResponse.fraudResult.avsResult);
Assert.AreEqual("M", authorizeResponse.fraudResult.cardValidationResult);
capture capture = new capture();
capture.litleTxnId = authorizeResponse.litleTxnId;
capture.amount = 5005;
captureResponse captureResponse = litle.Capture(capture);
Assert.AreEqual("000", captureResponse.response);
Assert.AreEqual("Approved", captureResponse.message);
authReversal reversal = new authReversal();
reversal.litleTxnId = authorizeResponse.litleTxnId;
authReversalResponse reversalResponse = litle.AuthReversal(reversal);
Assert.AreEqual("111", reversalResponse.response);
Assert.AreEqual("Authorization amount has already been depleted", reversalResponse.message);
}
示例7: test38
public void test38()
{
echeckVerification verification = new echeckVerification();
verification.orderId = "38";
verification.amount = 3002;
verification.orderSource = orderSourceType.telephone;
contact billToAddress = new contact();
billToAddress.firstName = "John";
billToAddress.lastName = "Smith";
billToAddress.phone = "999-999-9999";
verification.billToAddress = billToAddress;
echeckType echeck = new echeckType();
echeck.accNum = "1099999999";
echeck.accType = echeckAccountTypeEnum.Checking;
echeck.routingNum = "053000219";
verification.echeck = echeck;
echeckVerificationResponse response = litle.EcheckVerification(verification);
Assert.AreEqual("000", response.response);
Assert.AreEqual("Approved", response.message);
}
示例8: TestContactShouldSendEmailForEmail_NotZip
public void TestContactShouldSendEmailForEmail_NotZip()
{
authorization auth = new authorization();
auth.orderId = "12344";
auth.amount = 2;
auth.orderSource = orderSourceType.ecommerce;
auth.reportGroup = "Planets";
contact billToAddress = new contact();
billToAddress.email = "[email protected]";
billToAddress.zip = "12345";
auth.billToAddress = billToAddress;
var mock = new Mock<Communications>();
mock.Setup(Communications => Communications.HttpPost(It.IsRegex(".*<zip>12345</zip>.*<email>[email protected]</email>.*", RegexOptions.Singleline), It.IsAny<Dictionary<String, String>>()))
.Returns("<litleOnlineResponse version='8.14' response='0' message='Valid Format' xmlns='http://www.litle.com/schema'><authorizationResponse><litleTxnId>123</litleTxnId></authorizationResponse></litleOnlineResponse>");
Communications mockedCommunication = mock.Object;
litle.setCommunication(mockedCommunication);
litle.Authorize(auth);
}
示例9: echeckCreditWithToken
public void echeckCreditWithToken()
{
echeckCredit echeckcredit = new echeckCredit();
echeckcredit.amount = 12L;
echeckcredit.orderId = "12345";
echeckcredit.orderSource = orderSourceType.ecommerce;
echeckTokenType echeckToken = new echeckTokenType();
echeckToken.accType = echeckAccountTypeEnum.Checking;
echeckToken.litleToken = "1234565789012";
echeckToken.routingNum = "123456789";
echeckToken.checkNum = "123455";
echeckcredit.echeckToken = echeckToken;
contact billToAddress = new contact();
billToAddress.name = "Bob";
billToAddress.city = "Lowell";
billToAddress.state = "MA";
billToAddress.email = "litle.com";
echeckcredit.billToAddress = billToAddress;
echeckCreditResponse response = litle.EcheckCredit(echeckcredit);
Assert.AreEqual("Approved", response.message);
}
示例10: test39
public void test39()
{
echeckVerification verification = new echeckVerification();
verification.orderId = "39";
verification.amount = 3003;
verification.orderSource = orderSourceType.telephone;
contact billToAddress = new contact();
billToAddress.firstName = "Robert";
billToAddress.lastName = "Jones";
billToAddress.companyName = "Good Goods Inc";
billToAddress.phone = "9999999999";
verification.billToAddress = billToAddress;
echeckType echeck = new echeckType();
echeck.accNum = "3099999999";
echeck.accType = echeckAccountTypeEnum.Corporate;
echeck.routingNum = "053100300";
verification.echeck = echeck;
echeckVerificationResponse response = litle.EcheckVerification(verification);
Assert.AreEqual("950", response.response);
Assert.AreEqual("Declined - Negative Information on File", response.message);
}
示例11: test33
public void test33()
{
authorization auth = new authorization();
auth.orderId = "33";
auth.amount = 20020;
auth.orderSource = orderSourceType.ecommerce;
contact billToAddress = new contact();
billToAddress.name = "Mike J. Hammer";
billToAddress.addressLine1 = "2 Main St.";
billToAddress.addressLine2 = "Apt. 222";
billToAddress.city = "Riverside";
billToAddress.state = "RI";
billToAddress.zip = "02915";
billToAddress.country = countryTypeEnum.US;
auth.billToAddress = billToAddress;
cardType card = new cardType();
card.number = "5112010000000003";
card.expDate = "0212";
card.cardValidationNum = "261";
card.type = methodOfPaymentTypeEnum.MC;
auth.card = card;
fraudCheckType fraud = new fraudCheckType();
fraud.authenticationValue = "BwABBJQ1AgAAAAAgJDUCAAAAAAA=";
auth.cardholderAuthentication = fraud;
authorizationResponse authorizeResponse = litle.Authorize(auth);
Assert.AreEqual("000", authorizeResponse.response);
Assert.AreEqual("Approved", authorizeResponse.message);
Assert.AreEqual("22222", authorizeResponse.authCode);
Assert.AreEqual("10", authorizeResponse.fraudResult.avsResult);
Assert.AreEqual("M", authorizeResponse.fraudResult.cardValidationResult);
authReversal reversal = new authReversal();
reversal.litleTxnId = authorizeResponse.litleTxnId;
authReversalResponse reversalResponse = litle.AuthReversal(reversal);
Assert.AreEqual("000", reversalResponse.response);
Assert.AreEqual("Approved", reversalResponse.message);
}
示例12: AuthWithAmpersand
public void AuthWithAmpersand()
{
authorization authorization = new authorization();
authorization.orderId = "1";
authorization.amount = 10010;
authorization.orderSource = orderSourceType.ecommerce;
contact contact = new contact();
contact.name = "John & Jane Smith";
contact.addressLine1 = "1 Main St.";
contact.city = "Burlington";
contact.state = "MA";
contact.zip = "01803-3747";
contact.country = countryTypeEnum.US;
authorization.billToAddress = contact;
cardType card = new cardType();
card.type = methodOfPaymentTypeEnum.VI;
card.number = "4457010000000009";
card.expDate = "0112";
card.cardValidationNum = "349";
authorization.card = card;
authorizationResponse response = litle.Authorize(authorization);
Assert.AreEqual("000", response.response);
}
示例13: Test3dsAuthenticatedShouldNotSayItem
public void Test3dsAuthenticatedShouldNotSayItem()
{
authorization auth = new authorization();
auth.orderId = "12344";
auth.amount = 2;
auth.orderSource = orderSourceType.item3dsAuthenticated;
auth.reportGroup = "Planets";
contact billToAddress = new contact();
billToAddress.email = "[email protected]";
billToAddress.zip = "12345";
auth.billToAddress = billToAddress;
var mock = new Mock<Communications>();
mock.Setup(Communications => Communications.HttpPost(It.IsRegex(".*<amount>2</amount>.*<orderSource>3dsAuthenticated</orderSource>.*", RegexOptions.Singleline), It.IsAny<Dictionary<String, String>>()))
.Returns("<litleOnlineResponse version='8.14' response='0' message='Valid Format' xmlns='http://www.litle.com/schema'><authorizationResponse><litleTxnId>123</litleTxnId></authorizationResponse></litleOnlineResponse>");
Communications mockedCommunication = mock.Object;
litle.setCommunication(mockedCommunication);
authorizationResponse authorizationResponse = litle.Authorize(auth);
Assert.NotNull(authorizationResponse);
Assert.AreEqual(123, authorizationResponse.litleTxnId);
}
示例14: test35
public void test35()
{
authorization auth = new authorization();
auth.orderId = "35";
auth.amount = 40040;
auth.orderSource = orderSourceType.ecommerce;
contact billToAddress = new contact();
billToAddress.name = "Bob Black";
billToAddress.addressLine1 = "4 Main St.";
billToAddress.city = "Laurel";
billToAddress.state = "MD";
billToAddress.zip = "20708";
billToAddress.country = countryTypeEnum.US;
auth.billToAddress = billToAddress;
cardType card = new cardType();
card.number = "375001000000005";
card.expDate = "0412";
card.type = methodOfPaymentTypeEnum.AX;
auth.card = card;
authorizationResponse authorizeResponse = litle.Authorize(auth);
Assert.AreEqual("000", authorizeResponse.response);
Assert.AreEqual("Approved", authorizeResponse.message);
Assert.AreEqual("44444", authorizeResponse.authCode);
Assert.AreEqual("12", authorizeResponse.fraudResult.avsResult);
capture capture = new capture();
capture.litleTxnId = authorizeResponse.litleTxnId;
capture.amount = 20020;
captureResponse captureResponse = litle.Capture(capture);
Assert.AreEqual("000", captureResponse.response);
Assert.AreEqual("Approved", captureResponse.message);
authReversal reversal = new authReversal();
reversal.litleTxnId = authorizeResponse.litleTxnId;
reversal.amount = 20020;
authReversalResponse reversalResponse = litle.AuthReversal(reversal);
Assert.AreEqual("000", reversalResponse.response);
Assert.AreEqual("Approved", reversalResponse.message);
}
示例15: test3AVS
public void test3AVS()
{
authorization authorization = new authorization();
authorization.orderId = "3";
authorization.amount = 0;
authorization.orderSource = orderSourceType.ecommerce;
contact contact = new contact();
contact.name = "Eileen Jones";
contact.addressLine1 = "3 Main St.";
contact.city = "Bloomfield";
contact.state = "CT";
contact.zip = "06002";
contact.country = countryTypeEnum.US;
authorization.billToAddress = contact;
cardType card = new cardType();
card.type = methodOfPaymentTypeEnum.DI;
card.number = "6011010000000003";
card.expDate = "0312";
card.cardValidationNum = "758";
authorization.card = card;
authorizationResponse response = litle.Authorize(authorization);
Assert.AreEqual("000", response.response);
Assert.AreEqual("Approved", response.message);
Assert.AreEqual("33333", response.authCode);
Assert.AreEqual("10", response.fraudResult.avsResult);
Assert.AreEqual("M", response.fraudResult.cardValidationResult);
}