Closed PerWiklander closed 11 years ago
I think a better approach will be to change the return type of the create method. The "create" action for preauthorizations actually returns a transaction, the preauthorization is a field (that already exists in the transaction object).
That would be great, but then It would also have to take a Transaction
as input, since the generics require it to return the same type as it takes in. Since it is just moving values to a map and the Transaction
type has the same fields I guess it would work with minimal changes to that code. But I guess it would break the API and everyones code.
We can simply include an additional method that still takes a Preauthorization object as parameter but returns a Transaction. About the map conversion: it might not be a bad idea to change the way it's done right now, I am thinking about annotations in the model classes.
When using
PreauthorizationService#create
the method can only return aPreauthorization
(by design, it extendsAbstractService<Preauthorization>
). Although it actually has an instance ofTransaction
there at the end, there is no vay of getting the transaction id from the returnedPreauthorization
. Could we add aTransaction
field to thePreauthorization
class?