本文整理汇总了Java中us.fatehi.creditcardnumber.AccountNumber类的典型用法代码示例。如果您正苦于以下问题:Java AccountNumber类的具体用法?Java AccountNumber怎么用?Java AccountNumber使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AccountNumber类属于us.fatehi.creditcardnumber包,在下文中一共展示了AccountNumber类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: iin_1
import us.fatehi.creditcardnumber.AccountNumber; //导入依赖的package包/类
@Test
public void iin_1()
{
final String rawAccountNumber = "5266092201416173";
final AccountNumber pan = new AccountNumber(rawAccountNumber);
assertTrue("Should not pass Luhn check", !pan.passesLuhnCheck());
assertEquals(CardBrand.MasterCard, pan.getCardBrand());
assertEquals(MajorIndustryIdentifier.mii_5,
pan.getMajorIndustryIdentifier());
assertTrue(pan.hasRawData());
assertTrue(pan.hasAccountNumber());
assertTrue(pan.hasLastFourDigits());
assertTrue(pan.hasIssuerIdentificationNumber());
assertEquals("6173", pan.getLastFourDigits());
assertEquals("526609", pan.getIssuerIdentificationNumber());
pan.disposeIssuerIdentificationNumber();
assertTrue(!pan.hasRawData());
assertTrue(!pan.hasAccountNumber());
assertTrue(pan.hasLastFourDigits());
assertTrue(!pan.hasIssuerIdentificationNumber());
assertEquals("6173", pan.getLastFourDigits());
assertEquals(null, pan.getIssuerIdentificationNumber());
}
示例2: iin_2
import us.fatehi.creditcardnumber.AccountNumber; //导入依赖的package包/类
@Test
public void iin_2()
{
final String rawAccountNumber = "573";
final AccountNumber pan = new AccountNumber(rawAccountNumber);
assertTrue("Should not pass Luhn check", !pan.passesLuhnCheck());
assertEquals(CardBrand.Unknown, pan.getCardBrand());
assertEquals(MajorIndustryIdentifier.mii_5,
pan.getMajorIndustryIdentifier());
assertTrue(pan.hasRawData());
assertTrue(pan.hasAccountNumber());
assertTrue(pan.hasLastFourDigits());
assertTrue(pan.hasIssuerIdentificationNumber());
assertEquals("0573", pan.getLastFourDigits());
assertEquals("573000", pan.getIssuerIdentificationNumber());
pan.disposeIssuerIdentificationNumber();
assertTrue(!pan.hasRawData());
assertTrue(!pan.hasAccountNumber());
assertTrue(pan.hasLastFourDigits());
assertTrue(!pan.hasIssuerIdentificationNumber());
assertEquals("0573", pan.getLastFourDigits());
assertEquals(null, pan.getIssuerIdentificationNumber());
}
示例3: lastFourDigits_1
import us.fatehi.creditcardnumber.AccountNumber; //导入依赖的package包/类
@Test
public void lastFourDigits_1()
{
final String rawAccountNumber = "5266092201416173";
final AccountNumber pan = new AccountNumber(rawAccountNumber);
assertTrue("Should not pass Luhn check", !pan.passesLuhnCheck());
assertEquals(CardBrand.MasterCard, pan.getCardBrand());
assertEquals(MajorIndustryIdentifier.mii_5,
pan.getMajorIndustryIdentifier());
assertTrue(pan.hasRawData());
assertTrue(pan.hasAccountNumber());
assertTrue(pan.hasLastFourDigits());
assertTrue(pan.hasIssuerIdentificationNumber());
assertEquals("6173", pan.getLastFourDigits());
assertEquals("526609", pan.getIssuerIdentificationNumber());
pan.disposeLastFourDigits();
assertTrue(!pan.hasRawData());
assertTrue(!pan.hasAccountNumber());
assertTrue(!pan.hasLastFourDigits());
assertTrue(pan.hasIssuerIdentificationNumber());
assertEquals(null, pan.getLastFourDigits());
assertEquals("526609", pan.getIssuerIdentificationNumber());
}
示例4: lastFourDigits_2
import us.fatehi.creditcardnumber.AccountNumber; //导入依赖的package包/类
@Test
public void lastFourDigits_2()
{
final String rawAccountNumber = "573";
final AccountNumber pan = new AccountNumber(rawAccountNumber);
assertTrue("Should not pass Luhn check", !pan.passesLuhnCheck());
assertEquals(CardBrand.Unknown, pan.getCardBrand());
assertEquals(MajorIndustryIdentifier.mii_5,
pan.getMajorIndustryIdentifier());
assertTrue(pan.hasRawData());
assertTrue(pan.hasAccountNumber());
assertTrue(pan.hasLastFourDigits());
assertTrue(pan.hasIssuerIdentificationNumber());
assertEquals("0573", pan.getLastFourDigits());
assertEquals("573000", pan.getIssuerIdentificationNumber());
pan.disposeLastFourDigits();
assertTrue(!pan.hasRawData());
assertTrue(!pan.hasAccountNumber());
assertTrue(!pan.hasLastFourDigits());
assertTrue(pan.hasIssuerIdentificationNumber());
assertEquals(null, pan.getLastFourDigits());
assertEquals("573000", pan.getIssuerIdentificationNumber());
}
示例5: Track2
import us.fatehi.creditcardnumber.AccountNumber; //导入依赖的package包/类
private Track2(final String rawTrackData,
final AccountNumber pan,
final ExpirationDate expirationDate,
final ServiceCode serviceCode,
final String discretionaryData)
{
super(rawTrackData, pan, expirationDate, serviceCode, discretionaryData);
}
示例6: Track1FormatB
import us.fatehi.creditcardnumber.AccountNumber; //导入依赖的package包/类
private Track1FormatB(final String rawTrackData,
final AccountNumber pan,
final ExpirationDate expirationDate,
final Name name,
final ServiceCode serviceCode,
final String formatCode,
final String discretionaryData)
{
super(rawTrackData, pan, expirationDate, serviceCode, discretionaryData);
this.formatCode = formatCode;
this.name = name;
}
示例7: BaseBankCardTrackData
import us.fatehi.creditcardnumber.AccountNumber; //导入依赖的package包/类
BaseBankCardTrackData(final String rawTrackData,
final AccountNumber pan,
final ExpirationDate expirationDate,
final ServiceCode serviceCode,
final String discretionaryData)
{
super(rawTrackData, discretionaryData);
this.pan = pan;
this.expirationDate = expirationDate;
this.serviceCode = serviceCode;
}
示例8: main
import us.fatehi.creditcardnumber.AccountNumber; //导入依赖的package包/类
public static void main(final String[] args)
{
final AccountNumber pan = new AccountNumber("5266-0922-0141-6174");
final ExpirationDate expiration = new ExpirationDate(2015, 4);
final Name name = new Name("Sualeh", "Fatehi");
final BankCard card = new BankCard(pan, expiration, name);
System.out.println(card);
}
示例9: pan_1
import us.fatehi.creditcardnumber.AccountNumber; //导入依赖的package包/类
@Test
public void pan_1()
{
final String rawAccountNumber = null;
final AccountNumber pan = new AccountNumber(rawAccountNumber);
assertEquals(rawAccountNumber, pan.getRawData());
assertTrue(!pan.hasAccountNumber());
}
示例10: pan_2
import us.fatehi.creditcardnumber.AccountNumber; //导入依赖的package包/类
@Test
public void pan_2()
{
final String rawAccountNumber = "\t\t";
final AccountNumber pan = new AccountNumber(rawAccountNumber);
assertEquals(rawAccountNumber, pan.getRawData());
assertTrue(!pan.hasAccountNumber());
}
示例11: pan_3
import us.fatehi.creditcardnumber.AccountNumber; //导入依赖的package包/类
@Test
public void pan_3()
{
final String rawAccountNumber = "5266092201416173";
final AccountNumber pan = new AccountNumber(rawAccountNumber);
assertEquals(rawAccountNumber, pan.getRawData());
assertTrue("Should not pass Luhn check", !pan.passesLuhnCheck());
check(rawAccountNumber, pan, rawAccountNumber);
}
示例12: pan1
import us.fatehi.creditcardnumber.AccountNumber; //导入依赖的package包/类
@Test
public void pan1()
{
final String rawAccountNumber = "5266092201416174";
final AccountNumber pan = new AccountNumber(rawAccountNumber);
assertTrue("Does not pass Luhn check", pan.passesLuhnCheck());
check(rawAccountNumber, pan, rawAccountNumber);
}
示例13: pan2
import us.fatehi.creditcardnumber.AccountNumber; //导入依赖的package包/类
@Test
public void pan2()
{
final String rawAccountNumber = " 5266-0922-0141-6174 ";
final String accountNumber = "5266092201416174";
final AccountNumber pan = new AccountNumber(rawAccountNumber);
assertTrue("Does not pass Luhn check", pan.passesLuhnCheck());
check(rawAccountNumber, pan, accountNumber);
}
示例14: pan3
import us.fatehi.creditcardnumber.AccountNumber; //导入依赖的package包/类
@Test
public void pan3()
{
final String rawAccountNumber = " 5266-0922-0141-6174-7889 ";
final String accountNumber = "52660922014161747889";
final AccountNumber pan = new AccountNumber(rawAccountNumber);
assertTrue("Should not pass Luhn check", !pan.passesLuhnCheck());
assertTrue("Should not pass Luhn check", pan.exceedsMaximumLength());
check(rawAccountNumber, pan, accountNumber);
}
示例15: pan4
import us.fatehi.creditcardnumber.AccountNumber; //导入依赖的package包/类
@Test
public void pan4()
{
final String rawAccountNumber = " 5266-0922 ";
final String accountNumber = "52660922";
final AccountNumber pan = new AccountNumber(rawAccountNumber);
assertTrue("Should not pass Luhn check", !pan.passesLuhnCheck());
check(rawAccountNumber, pan, accountNumber);
}