1313
1414import static com .flutterwave .bean .AuthorizationModes .PIN ;
1515import static com .flutterwave .bean .ChargeTypes .CARD ;
16+ import static com .flutterwave .utility .Properties .getProperty ;
1617
1718class CardChargeTest {
1819 CardRequest cardRequest ;
1920
2021 @ BeforeEach
2122 void setUp () {
22- Environments .setUp ();
2323
24- cardRequest = new CardRequest ("5531886652142950" ,
24+ Environment .setSecretKey (getProperty ("SEC_KEY" ));
25+ Environment .setPublicKey (getProperty ("PUB_KEY" ));
26+ Environment .setEncryptionKey (getProperty ("ENCR_KEY" ));
27+
28+ cardRequest = new CardRequest ("5438898014560229" ,
2529 "564" ,
2630 "09" ,
2731 "32" ,
2832 "NGN" ,
29- new BigDecimal ("100" ),
33+ new BigDecimal ("100.88 " ),
3034 "Yolande Aglaé Colbert" ,
31- "stefan.wexler@hotmail.eu " ,
32- "MC-3243e248 " ,
35+ "tafchaty@gmail.com " ,
36+ "javasdk-test " ,
3337 "https://www,flutterwave.ng" ,
3438 null );
3539 }
@@ -44,7 +48,7 @@ void authorizeTransactionPin() {
4448 Optional .ofNullable (new CardCharge ().runTransaction (cardRequest ))
4549 .map (response -> {
4650 switch (response .getMeta ().getAuthorization ().getMode ()){
47- case PIN -> cardRequest .setAuthorization (new Authorization ().pinAuthorization ("3306 " ));
51+ case PIN -> cardRequest .setAuthorization (new Authorization ().pinAuthorization ("3310 " ));
4852 case AUS_NOAUTH -> cardRequest .setAuthorization (new Authorization ().avsAuthorization ("" ,
4953 "" ,
5054 "" ,
@@ -64,13 +68,15 @@ void authorizeTransactionPin() {
6468
6569 //verify
6670 verifyTransaction (authorizeResponse .getData ().getId ());
71+ //Response verifyResponse = new CardCharge().(cardRequest);
72+ //System.out.println("verifyResponse response ==>" + verifyResponse);
6773 return null ;
6874 });
6975 }
7076
7177 void validateTransaction (String flw_ref ) {
72- cardRequest .setAuthorization (new Authorization ().pinAuthorization ("3306 " ));
73- Assertions .assertEquals ("success" , new ValidateCharge ("1111 " , flw_ref , Optional .of (CARD )).runTransaction ().getStatus ());
78+ cardRequest .setAuthorization (new Authorization ().pinAuthorization ("3310 " ));
79+ Assertions .assertEquals ("success" , new ValidateCharge ("12345 " , flw_ref , Optional .of (CARD )).runTransaction ().getStatus ());
7480 }
7581
7682 void verifyTransaction (int id ) {
0 commit comments