コード例 #1
0
 @Test
 public void missingBilling() throws Exception {
   EcheckCredit echeckcredit = new EcheckCredit();
   echeckcredit.setAmount(12L);
   echeckcredit.setOrderId("12345");
   echeckcredit.setOrderSource(OrderSourceType.ECOMMERCE);
   EcheckType echeck = new EcheckType();
   echeck.setAccType(EcheckAccountTypeEnum.CHECKING);
   echeck.setAccNum("12345657890");
   echeck.setRoutingNum("123456789");
   echeck.setCheckNum("123455");
   echeckcredit.setEcheck(echeck);
   try {
     litle.echeckCredit(echeckcredit);
     fail("Expected exception");
   } catch (LitleOnlineException e) {
     assertTrue(
         e.getMessage(),
         e.getMessage().startsWith("Error validating xml data against the schema"));
   }
 }
コード例 #2
0
 @Test
 public void echeckCreditWithEcheck() throws Exception {
   EcheckCredit echeckcredit = new EcheckCredit();
   echeckcredit.setAmount(12L);
   echeckcredit.setOrderId("12345");
   echeckcredit.setOrderSource(OrderSourceType.ECOMMERCE);
   EcheckType echeck = new EcheckType();
   echeck.setAccType(EcheckAccountTypeEnum.CHECKING);
   echeck.setAccNum("12345657890");
   echeck.setRoutingNum("123456789");
   echeck.setCheckNum("123455");
   echeckcredit.setEcheck(echeck);
   Contact billToAddress = new Contact();
   billToAddress.setName("Bob");
   billToAddress.setCity("Lowell");
   billToAddress.setState("MA");
   billToAddress.setEmail("litle.com");
   echeckcredit.setBillToAddress(billToAddress);
   EcheckCreditResponse response = litle.echeckCredit(echeckcredit);
   assertEquals("Approved", response.getMessage());
 }