99import org .junit .jupiter .api .Test ;
1010
1111import java .math .BigDecimal ;
12+ import java .util .Date ;
1213import java .util .Optional ;
1314
1415import static com .flutterwave .bean .AuthorizationModes .PIN ;
@@ -25,22 +26,24 @@ void setUp() {
2526 Environment .setPublicKey (getProperty ("PUB_KEY" ));
2627 Environment .setEncryptionKey (getProperty ("ENCR_KEY" ));
2728
28- cardRequest = new CardRequest ("5438898014560229 " ,
29- "564 " ,
30- "09 " ,
31- "32 " ,
32- "NGN " ,
33- new BigDecimal ("100.88 " ),
34- "Yolande Aglaé Colbert " ,
35- "tafchaty @gmail.com " ,
36- "javasdk-test" ,
29+ cardRequest = new CardRequest ("4187427415564246 " ,
30+ "NG " ,
31+ "812 " ,
32+ "10 " ,
33+ "33 " ,
34+ "NGN" , new BigDecimal ("10000 " ),
35+ "Tafa Chati " ,
36+ "test @gmail.io " ,
37+ "javasdk-test-" + new Date () ,
3738 "https://www,flutterwave.ng" ,
3839 null );
3940 }
4041
4142 @ Test
4243 void runTransaction () {
4344 Assertions .assertEquals ("success" , new CardCharge ().runTransaction (cardRequest ).getStatus ());
45+ //System.out.println(new CardCharge().runTransaction(cardRequest).getData().getId());
46+ //verifyTransaction(new CardCharge().runTransaction(cardRequest).getData().getId());
4447 }
4548
4649 @ Test
@@ -57,6 +60,8 @@ void authorizeTransactionPin() {
5760 case REDIRECT -> {
5861 //redirect user
5962 }
63+ case OTP -> cardRequest .setAuthorization (new Authorization ().pinAuthorization ("3310" ));
64+ default -> throw new IllegalArgumentException ("Unexpected value: " + response .getMeta ().getAuthorization ().getMode ());
6065 }
6166 Response authorizeResponse = new CardCharge ().runTransaction (cardRequest );
6267 System .out .println ("authorizeResponse response ==>" + authorizeResponse );
0 commit comments