本文整理汇总了Java中com.github.devnied.emvnfccard.parser.IProvider类的典型用法代码示例。如果您正苦于以下问题:Java IProvider类的具体用法?Java IProvider怎么用?Java IProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IProvider类属于com.github.devnied.emvnfccard.parser包,在下文中一共展示了IProvider类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testPPSEVisa
import com.github.devnied.emvnfccard.parser.IProvider; //导入依赖的package包/类
@Test
public void testPPSEVisa() throws CommunicationException {
IProvider prov = new PpseProviderVisaTest();
EmvParser parser = new EmvParser(prov, true);
EmvCard card = parser.readEmvCard();
if (card != null) {
LOGGER.debug(card.toString());
}
Assertions.assertThat(card).isNotNull();
Assertions.assertThat(card.getAid()).isEqualTo("A0000000421010");
Assertions.assertThat(card.getCardNumber()).isEqualTo("4999999999999999");
Assertions.assertThat(card.getType()).isEqualTo(EmvCardScheme.VISA);
Assertions.assertThat(card.getHolderLastname()).isNull();
Assertions.assertThat(card.getHolderFirstname()).isNull();
Assertions.assertThat(card.getApplicationLabel()).isEqualTo("CB");
Assertions.assertThat(card.getListTransactions().size()).isEqualTo(30);
SimpleDateFormat sdf = new SimpleDateFormat("MM/yyyy");
Assertions.assertThat(sdf.format(card.getExpireDate())).isEqualTo("09/2015");
Assertions.assertThat(card.isNfcLocked()).isFalse();
}
示例2: testPPSEVisa3
import com.github.devnied.emvnfccard.parser.IProvider; //导入依赖的package包/类
@Test
public void testPPSEVisa3() throws CommunicationException {
IProvider prov = new PpseProviderVisa3Test();
EmvParser parser = new EmvParser(prov, true);
EmvCard card = parser.readEmvCard();
if (card != null) {
LOGGER.debug(card.toString());
}
Assertions.assertThat(card).isNotNull();
Assertions.assertThat(card.getAid()).isEqualTo("A0000000421010");
Assertions.assertThat(card.getCardNumber()).isEqualTo("4999999999999999");
Assertions.assertThat(card.getType()).isEqualTo(EmvCardScheme.VISA);
Assertions.assertThat(card.getHolderFirstname()).isNull();
Assertions.assertThat(card.getHolderLastname()).isNull();
Assertions.assertThat(card.getApplicationLabel()).isEqualTo(null);
Assertions.assertThat(card.getListTransactions().size()).isEqualTo(0);
SimpleDateFormat sdf = new SimpleDateFormat("MM/yyyy");
Assertions.assertThat(sdf.format(card.getExpireDate())).isEqualTo("06/2018");
Assertions.assertThat(card.isNfcLocked()).isFalse();
}
示例3: testPPSEVisaNullLog
import com.github.devnied.emvnfccard.parser.IProvider; //导入依赖的package包/类
@Test
public void testPPSEVisaNullLog() throws CommunicationException {
IProvider prov = new PpseProviderVisaNulTransactionsTest();
EmvParser parser = new EmvParser(prov, true);
EmvCard card = parser.readEmvCard();
if (card != null) {
LOGGER.debug(card.toString());
}
Assertions.assertThat(card).isNotNull();
Assertions.assertThat(card.getAid()).isEqualTo("A0000000421010");
Assertions.assertThat(card.getCardNumber()).isEqualTo("4999999999999999");
Assertions.assertThat(card.getType()).isEqualTo(EmvCardScheme.VISA);
Assertions.assertThat(card.getHolderLastname()).isNull();
Assertions.assertThat(card.getHolderFirstname()).isNull();
Assertions.assertThat(card.getApplicationLabel()).isEqualTo("CB");
Assertions.assertThat(card.getListTransactions().size()).isEqualTo(0);
SimpleDateFormat sdf = new SimpleDateFormat("MM/yyyy");
Assertions.assertThat(sdf.format(card.getExpireDate())).isEqualTo("09/2015");
Assertions.assertThat(card.isNfcLocked()).isFalse();
}
示例4: testPPSEMasterCard
import com.github.devnied.emvnfccard.parser.IProvider; //导入依赖的package包/类
@Test
public void testPPSEMasterCard() throws CommunicationException {
IProvider prov = new PpseProviderMasterCardTest();
EmvParser parser = new EmvParser(prov, true);
EmvCard card = parser.readEmvCard();
if (card != null) {
LOGGER.debug(card.toString());
}
Assertions.assertThat(card).isNotNull();
Assertions.assertThat(card.getAid()).isEqualTo("A0000000421010");
Assertions.assertThat(card.getCardNumber()).isEqualTo("5599999999999999");
Assertions.assertThat(card.getType()).isEqualTo(EmvCardScheme.MASTER_CARD);
Assertions.assertThat(card.getHolderLastname()).isNull();
Assertions.assertThat(card.getHolderFirstname()).isNull();
Assertions.assertThat(card.getApplicationLabel()).isEqualTo("CB");
Assertions.assertThat(card.getListTransactions()).isEmpty();
SimpleDateFormat sdf = new SimpleDateFormat("MM/yyyy");
Assertions.assertThat(sdf.format(card.getExpireDate())).isEqualTo("09/2015");
Assertions.assertThat(card.isNfcLocked()).isFalse();
}
示例5: testPPSEVisa2
import com.github.devnied.emvnfccard.parser.IProvider; //导入依赖的package包/类
@Test
public void testPPSEVisa2() throws CommunicationException {
IProvider prov = new PpseProviderVisa2Test();
EmvParser parser = new EmvParser(prov, true);
EmvCard card = parser.readEmvCard();
if (card != null) {
LOGGER.debug(card.toString());
}
Assertions.assertThat(card).isNotNull();
Assertions.assertThat(card.getAid()).isEqualTo("A0000000421010");
Assertions.assertThat(card.getCardNumber()).isEqualTo("4999999999999999");
Assertions.assertThat(card.getType()).isEqualTo(EmvCardScheme.VISA);
Assertions.assertThat(card.getHolderLastname()).isNull();
Assertions.assertThat(card.getHolderFirstname()).isNull();
Assertions.assertThat(card.getApplicationLabel()).isEqualTo("CB");
SimpleDateFormat sdf = new SimpleDateFormat("MM/yyyy");
Assertions.assertThat(sdf.format(card.getExpireDate())).isEqualTo("09/2015");
Assertions.assertThat(card.isNfcLocked()).isFalse();
}
示例6: testAid
import com.github.devnied.emvnfccard.parser.IProvider; //导入依赖的package包/类
@Test
public void testAid() throws CommunicationException {
IProvider prov = new ProviderAidTest();
EmvParser parser = new EmvParser(prov, true);
EmvCard card = parser.readEmvCard();
if (card != null) {
LOGGER.debug(card.toString());
}
Assertions.assertThat(card).isNotNull();
Assertions.assertThat(card.getAid()).isEqualTo("A0000000031010");
Assertions.assertThat(card.getCardNumber()).isEqualTo("5772829193253472");
Assertions.assertThat(card.getType()).isEqualTo(EmvCardScheme.VISA);
Assertions.assertThat(card.getApplicationLabel()).isEqualTo("VISA");
Assertions.assertThat(card.getHolderLastname()).isNull();
Assertions.assertThat(card.getHolderFirstname()).isNull();
SimpleDateFormat sdf = new SimpleDateFormat("MM/yyyy");
Assertions.assertThat(sdf.format(card.getExpireDate())).isEqualTo("08/2014");
Assertions.assertThat(card.isNfcLocked()).isFalse();
}
示例7: testPPSEMasterCard2
import com.github.devnied.emvnfccard.parser.IProvider; //导入依赖的package包/类
@Test
public void testPPSEMasterCard2() throws CommunicationException {
IProvider prov = new PpseProviderMasterCard2Test();
EmvParser parser = new EmvParser(prov, true);
EmvCard card = parser.readEmvCard();
if (card != null) {
LOGGER.debug(card.toString());
}
Assertions.assertThat(card).isNotNull();
Assertions.assertThat(card.getAid()).isEqualTo("A0000000041010");
Assertions.assertThat(card.getCardNumber()).isEqualTo("5200000000000000");
Assertions.assertThat(card.getType()).isEqualTo(EmvCardScheme.MASTER_CARD);
Assertions.assertThat(card.getHolderLastname()).isNull();
Assertions.assertThat(card.getHolderFirstname()).isNull();
Assertions.assertThat(card.getLeftPinTry()).isEqualTo(2);
Assertions.assertThat(card.getApplicationLabel()).isEqualTo(null);
SimpleDateFormat sdf = new SimpleDateFormat("MM/yyyy");
Assertions.assertThat(sdf.format(card.getExpireDate())).isEqualTo("07/2002");
Assertions.assertThat(card.getListTransactions()).isNotEmpty();
Assertions.assertThat(card.getListTransactions().size()).isEqualTo(10);
EmvTransactionRecord record = card.getListTransactions().get(0);
Assertions.assertThat(record.getAmount()).isEqualTo(2200);
Assertions.assertThat(record.getCyptogramData()).isEqualTo("40");
Assertions.assertThat(record.getCurrency()).isEqualTo(CurrencyEnum.TRY);
Assertions.assertThat(record.getDate()).isNotNull();
SimpleDateFormat sdf2 = new SimpleDateFormat("dd/MM/yyyy");
Assertions.assertThat(sdf2.format(record.getDate())).isEqualTo("12/01/2011");
Assertions.assertThat(card.isNfcLocked()).isFalse();
}
示例8: testPPSEMasterCard3
import com.github.devnied.emvnfccard.parser.IProvider; //导入依赖的package包/类
@Test
public void testPPSEMasterCard3() throws CommunicationException {
IProvider prov = new PpseProviderMasterCard3Test();
EmvParser parser = new EmvParser(prov, true);
EmvCard card = parser.readEmvCard();
if (card != null) {
LOGGER.debug(card.toString());
}
Assertions.assertThat(card).isNotNull();
Assertions.assertThat(card.getAid()).isEqualTo("A0000000041010");
Assertions.assertThat(card.getCardNumber()).isEqualTo("5200000000000000");
Assertions.assertThat(card.getType()).isEqualTo(EmvCardScheme.MASTER_CARD);
Assertions.assertThat(card.getHolderLastname()).isNull();
Assertions.assertThat(card.getHolderFirstname()).isNull();
Assertions.assertThat(card.getLeftPinTry()).isEqualTo(2);
Assertions.assertThat(card.getApplicationLabel()).isEqualTo(null);
SimpleDateFormat sdf = new SimpleDateFormat("MM/yyyy");
Assertions.assertThat(sdf.format(card.getExpireDate())).isEqualTo("11/2019");
Assertions.assertThat(card.getListTransactions()).isNotEmpty();
Assertions.assertThat(card.getListTransactions().size()).isEqualTo(10);
EmvTransactionRecord record = card.getListTransactions().get(0);
Assertions.assertThat(record.getAmount()).isEqualTo(2200);
Assertions.assertThat(record.getCyptogramData()).isEqualTo("40");
Assertions.assertThat(record.getCurrency()).isEqualTo(CurrencyEnum.TRY);
Assertions.assertThat(record.getDate()).isNotNull();
SimpleDateFormat sdf2 = new SimpleDateFormat("dd/MM/yyyy");
Assertions.assertThat(sdf2.format(record.getDate())).isEqualTo("12/01/2011");
Assertions.assertThat(card.isNfcLocked()).isFalse();
}
示例9: testPSE
import com.github.devnied.emvnfccard.parser.IProvider; //导入依赖的package包/类
@Test
public void testPSE() throws CommunicationException {
IProvider prov = new PseProviderTest();
EmvParser parser = new EmvParser(prov, false);
EmvCard card = parser.readEmvCard();
if (card != null) {
LOGGER.debug(card.toString());
}
Assertions.assertThat(card).isNotNull();
Assertions.assertThat(card.getAid()).isEqualTo("A0000000421010");
Assertions.assertThat(card.getCardNumber()).isEqualTo("4979670123453600");
Assertions.assertThat(card.getType()).isEqualTo(EmvCardScheme.VISA);
Assertions.assertThat(card.getHolderLastname()).isNull();
Assertions.assertThat(card.getHolderFirstname()).isNull();
Assertions.assertThat(card.getApplicationLabel()).isEqualTo("CB");
Assertions.assertThat(card.getLeftPinTry()).isEqualTo(3);
SimpleDateFormat sdf = new SimpleDateFormat("MM/yyyy");
Assertions.assertThat(sdf.format(card.getExpireDate())).isEqualTo("02/2016");
Assertions.assertThat(card.getListTransactions()).isNotNull();
Assertions.assertThat(card.getListTransactions().size()).isEqualTo(30);
EmvTransactionRecord record = card.getListTransactions().get(0);
Assertions.assertThat(record.getAmount()).isEqualTo(4000);
Assertions.assertThat(record.getCyptogramData()).isEqualTo("80");
Assertions.assertThat(record.getTransactionType()).isEqualTo(TransactionTypeEnum.PURCHASE);
Assertions.assertThat(record.getCurrency()).isEqualTo(CurrencyEnum.EUR);
Assertions.assertThat(record.getTerminalCountry()).isEqualTo(CountryCodeEnum.FR);
Assertions.assertThat(record.getDate()).isNotNull();
Assertions.assertThat(card.isNfcLocked()).isFalse();
}
示例10: testException
import com.github.devnied.emvnfccard.parser.IProvider; //导入依赖的package包/类
@Test
public void testException() throws CommunicationException {
IProvider prov = new ExceptionProviderTest();
EmvParser parser = new EmvParser(prov, true);
try {
parser.readEmvCard();
Assert.fail();
} catch (CommunicationException e) {
Assert.assertTrue(true);
}
}