當前位置: 首頁>>代碼示例>>Java>>正文


Java AccountNumber類代碼示例

本文整理匯總了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());
}
 
開發者ID:sualeh,項目名稱:credit_card_number,代碼行數:27,代碼來源:SecureAccountNumberTest.java

示例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());
}
 
開發者ID:sualeh,項目名稱:credit_card_number,代碼行數:27,代碼來源:SecureAccountNumberTest.java

示例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());
}
 
開發者ID:sualeh,項目名稱:credit_card_number,代碼行數:27,代碼來源:SecureAccountNumberTest.java

示例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());
}
 
開發者ID:sualeh,項目名稱:credit_card_number,代碼行數:27,代碼來源:SecureAccountNumberTest.java

示例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);
}
 
開發者ID:IDPay,項目名稱:magnetic-track-parser,代碼行數:9,代碼來源:Track2.java

示例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;
}
 
開發者ID:IDPay,項目名稱:magnetic-track-parser,代碼行數:13,代碼來源:Track1FormatB.java

示例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;
}
 
開發者ID:IDPay,項目名稱:magnetic-track-parser,代碼行數:12,代碼來源:BaseBankCardTrackData.java

示例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);
}
 
開發者ID:sualeh,項目名稱:credit_card_number,代碼行數:9,代碼來源:SampleCode1.java

示例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());
}
 
開發者ID:sualeh,項目名稱:credit_card_number,代碼行數:9,代碼來源:PrimaryAccountNumberTest.java

示例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());
}
 
開發者ID:sualeh,項目名稱:credit_card_number,代碼行數:9,代碼來源:PrimaryAccountNumberTest.java

示例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);
}
 
開發者ID:sualeh,項目名稱:credit_card_number,代碼行數:10,代碼來源:PrimaryAccountNumberTest.java

示例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);
}
 
開發者ID:sualeh,項目名稱:credit_card_number,代碼行數:9,代碼來源:PrimaryAccountNumberTest.java

示例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);
}
 
開發者ID:sualeh,項目名稱:credit_card_number,代碼行數:10,代碼來源:PrimaryAccountNumberTest.java

示例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);
}
 
開發者ID:sualeh,項目名稱:credit_card_number,代碼行數:11,代碼來源:PrimaryAccountNumberTest.java

示例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);
}
 
開發者ID:sualeh,項目名稱:credit_card_number,代碼行數:10,代碼來源:PrimaryAccountNumberTest.java


注:本文中的us.fatehi.creditcardnumber.AccountNumber類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。