本文整理汇总了C#中Litle.Sdk.authorization类的典型用法代码示例。如果您正苦于以下问题:C# authorization类的具体用法?C# authorization怎么用?C# authorization使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
authorization类属于Litle.Sdk命名空间,在下文中一共展示了authorization类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: posWithoutCapabilityAndEntryMode
public void posWithoutCapabilityAndEntryMode()
{
authorization authorization = new authorization();
authorization.reportGroup = "Planets";
authorization.orderId = "12344";
authorization.amount = 106;
authorization.orderSource = orderSourceType.ecommerce;
pos pos = new pos();
pos.cardholderId = posCardholderIdTypeEnum.pin;
authorization.pos = pos;
cardType card = new cardType();
card.type = methodOfPaymentTypeEnum.VI;
card.number = "4100000000000002";
card.expDate = "1210";
authorization.card = card; //This needs to compile
customBilling cb = new customBilling();
cb.phone = "1112223333"; //This needs to compile too
try
{
litle.Authorize(authorization);
//expected exception;
}
catch (LitleOnlineException e)
{
Assert.True(e.Message.StartsWith("Error validating xml data against the schema"));
}
}
示例2: test12
public void test12()
{
authorization authorization = new authorization();
authorization.orderId = "12";
authorization.amount = 50000;
authorization.orderSource = orderSourceType.ecommerce;
cardType card = new cardType();
card.type = methodOfPaymentTypeEnum.AX;
card.number = "375001014000009";
card.expDate = "0412";
authorization.card = card;
authorization.allowPartialAuth = true;
authorizationResponse response = litle.Authorize(authorization);
Assert.AreEqual("010", response.response);
Assert.AreEqual("Partially Approved", response.message);
Assert.AreEqual("40000", response.approvedAmount);
}
示例3: TestFraudFilterOverride
public void TestFraudFilterOverride()
{
authorization auth = new authorization();
auth.orderId = "12344";
auth.amount = 2;
auth.orderSource = orderSourceType.ecommerce;
auth.reportGroup = "Planets";
auth.fraudFilterOverride = true;
var mock = new Mock<Communications>();
mock.Setup(Communications => Communications.HttpPost(It.IsRegex(".*<fraudFilterOverride>true</fraudFilterOverride>.*", RegexOptions.Singleline), It.IsAny<Dictionary<String, String>>()))
.Returns("<litleOnlineResponse version='8.10' 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);
}
示例4: SimpleAuthWithCard
public void SimpleAuthWithCard()
{
authorization authorization = new authorization();
authorization.reportGroup = "Planets";
authorization.orderId = "12344";
authorization.amount = 106;
authorization.orderSource = orderSourceType.ecommerce;
cardType card = new cardType();
card.type = methodOfPaymentTypeEnum.VI;
card.number = "414100000000000000";
card.expDate = "1210";
authorization.card = card; //This needs to compile
customBilling cb = new customBilling();
cb.phone = "1112223333"; //This needs to compile too
authorizationResponse response = litle.Authorize(authorization);
Assert.AreEqual("000", response.response);
}
示例5: simpleAuthWithPaypal
public void simpleAuthWithPaypal()
{
authorization authorization = new authorization();
authorization.reportGroup = "Planets";
authorization.orderId = "123456";
authorization.amount = 106;
authorization.orderSource = orderSourceType.ecommerce;
payPal paypal = new payPal();
paypal.payerId = "1234";
paypal.token = "1234";
paypal.transactionId = "123456";
authorization.paypal = paypal; //This needs to compile
customBilling cb = new customBilling();
cb.phone = "1112223333"; //This needs to compile too
authorizationResponse response = litle.Authorize(authorization);
Assert.AreEqual("Approved", response.message);
}
示例6: test15
public void test15()
{
authorization authorization = new authorization();
authorization.orderId = "15";
authorization.amount = 3000;
authorization.orderSource = orderSourceType.ecommerce;
cardType card = new cardType();
card.type = methodOfPaymentTypeEnum.MC;
card.number = "5500000254444445";
card.expDate = "0312";
authorization.card = card;
authorizationResponse response = litle.Authorize(authorization);
Assert.AreEqual("000", response.response);
Assert.AreEqual("Approved", response.message);
Assert.AreEqual(fundingSourceTypeEnum.PREPAID, response.enhancedAuthResponse.fundingSource.type);
Assert.AreEqual("2000", response.enhancedAuthResponse.fundingSource.availableBalance);
Assert.AreEqual("YES", response.enhancedAuthResponse.fundingSource.reloadable);
Assert.AreEqual("PAYROLL", response.enhancedAuthResponse.fundingSource.prepaidCardType);
}
示例7: 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);
}
示例8: testAddAuthorization
public void testAddAuthorization()
{
authorization authorization = new authorization();
authorization.reportGroup = "Planets";
authorization.orderId = "12344";
authorization.amount = 106;
authorization.orderSource = orderSourceType.ecommerce;
cardType card = new cardType();
card.type = methodOfPaymentTypeEnum.VI;
card.number = "4100000000000002";
card.expDate = "1210";
authorization.card = card;
batchRequest.addAuthorization(authorization);
Assert.AreEqual(1, batchRequest.getNumAuthorization());
Assert.AreEqual(authorization.amount, batchRequest.getSumOfAuthorization());
mockLitleFile.Verify(litleFile => litleFile.createRandomFile(It.IsAny<String>(), It.IsAny<String>(), It.IsAny<String>(), mockLitleTime.Object));
mockLitleFile.Verify(litleFile => litleFile.AppendLineToFile(mockFilePath, authorization.Serialize()));
}
示例9: 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);
}
示例10: 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);
}
示例11: TestAuth
public void TestAuth()
{
authorization authorization = new authorization();
authorization.reportGroup = "Planets";
authorization.orderId = "12344";
authorization.amount = 106;
authorization.orderSource = orderSourceType.ecommerce;
cardType card = new cardType();
card.type = methodOfPaymentTypeEnum.VI;
card.number = "4100000000000002";
card.expDate = "1210";
authorization.card = card;
var mock = new Mock<Communications>();
mock.Setup(Communications => Communications.HttpPost(It.IsRegex(".*<litleOnlineRequest.*<authorization.*<card>.*<number>4100000000000002</number>.*</card>.*</authorization>.*", RegexOptions.Singleline), It.IsAny<Dictionary<String, String>>()))
.Returns("<litleOnlineResponse version='8.10' 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 authorize = litle.Authorize(authorization);
Assert.AreEqual(123, authorize.litleTxnId);
}
示例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: test5Auth
public void test5Auth()
{
authorization authorization = new authorization();
authorization.orderId = "5";
authorization.amount = 50050;
authorization.orderSource = orderSourceType.ecommerce;
cardType card = new cardType();
card.type = methodOfPaymentTypeEnum.VI;
card.number = "4457010200000007";
card.expDate = "0512";
card.cardValidationNum = "463";
authorization.card = card;
fraudCheckType authenticationvalue = new fraudCheckType();
authenticationvalue.authenticationValue = "BwABBJQ1AgAAAAAgJDUCAAAAAAA=";
authorization.cardholderAuthentication = authenticationvalue;
authorizationResponse response = litle.Authorize(authorization);
Assert.AreEqual("000", response.response);
Assert.AreEqual("Approved", response.message);
Assert.AreEqual("55555 ", response.authCode);
Assert.AreEqual("32", response.fraudResult.avsResult);
Assert.AreEqual("N", response.fraudResult.cardValidationResult);
capture capture = new capture();
capture.litleTxnId = response.litleTxnId;
captureResponse captureresponse = litle.Capture(capture);
Assert.AreEqual("000", captureresponse.response);
Assert.AreEqual("Approved", captureresponse.message);
credit credit = new credit();
credit.litleTxnId = captureresponse.litleTxnId;
creditResponse creditResponse = litle.Credit(credit);
Assert.AreEqual("000", creditResponse.response);
Assert.AreEqual("Approved", creditResponse.message);
voidTxn newvoid = new voidTxn();
newvoid.litleTxnId = creditResponse.litleTxnId;
litleOnlineResponseTransactionResponseVoidResponse voidResponse = litle.DoVoid(newvoid);
Assert.AreEqual("000", voidResponse.response);
Assert.AreEqual("Approved", voidResponse.message);
}
示例15: test9AVS
public void test9AVS()
{
authorization authorization = new authorization();
authorization.orderId = "9";
authorization.amount = 0;
authorization.orderSource = orderSourceType.ecommerce;
contact contact = new contact();
contact.name = "James Miller";
contact.addressLine1 = "9 Main St.";
contact.city = "Boston";
contact.state = "MA";
contact.zip = "02134";
contact.country = countryTypeEnum.US;
authorization.billToAddress = contact;
cardType card = new cardType();
card.type = methodOfPaymentTypeEnum.AX;
card.number = "375001010000003";
card.expDate = "0912";
card.cardValidationNum = "0421";
authorization.card = card;
authorizationResponse response = litle.Authorize(authorization);
Assert.AreEqual("303", response.response);
Assert.AreEqual("Pick Up Card", response.message);
Assert.AreEqual("34", response.fraudResult.avsResult);
}