9
9
import org .junit .jupiter .api .Test ;
10
10
11
11
import java .math .BigDecimal ;
12
- import java .util .Date ;
13
12
import java .util .Optional ;
14
13
15
14
import static com .flutterwave .bean .AuthorizationModes .PIN ;
@@ -26,24 +25,22 @@ void setUp() {
26
25
Environment .setPublicKey (getProperty ("PUB_KEY" ));
27
26
Environment .setEncryptionKey (getProperty ("ENCR_KEY" ));
28
27
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 () ,
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" ,
38
37
"https://www,flutterwave.ng" ,
39
38
null );
40
39
}
41
40
42
41
@ Test
43
42
void runTransaction () {
44
43
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());
47
44
}
48
45
49
46
@ Test
@@ -60,8 +57,6 @@ void authorizeTransactionPin() {
60
57
case REDIRECT -> {
61
58
//redirect user
62
59
}
63
- case OTP -> cardRequest .setAuthorization (new Authorization ().pinAuthorization ("3310" ));
64
- default -> throw new IllegalArgumentException ("Unexpected value: " + response .getMeta ().getAuthorization ().getMode ());
65
60
}
66
61
Response authorizeResponse = new CardCharge ().runTransaction (cardRequest );
67
62
System .out .println ("authorizeResponse response ==>" + authorizeResponse );
0 commit comments