I have the following request with these fields:
Payment (Type Payment) -> Parameters (Type Object). I know this Parameters class has these fields:
- token (String)
- type (String)
- cvv (String)
I´m trying to have access to the field token through request.getPayment().getParameters() but I don't really know how to make it work. I found something related to Reflection but I don´t really know how it can work.
I've tried something like but I still don't know howo to fetch this String "token":
Field field = org.springframework.util.ReflectionUtils.findField(String.class, "token"); org.springframework.util.ReflectionUtils.makeAccessible(field); String token = field.get(request.getPayment().getParameters().????) ????