public Result processPayment ( Payment payment ) throws PaytrailException { try { String data = marshaller . objectToString ( payment ) ; String url = serviceUrl + "/api-payment/create" ; IOHandlerResult requestResult = postJsonRequest ( url , data ) ; if ( requestResult . getCode ( ) != 201 ) { JsonError jsonError = marshaller . stringToObject ( JsonError . class , requestResult . getResponse ( ) ) ; throw new PaytrailException ( jsonError . getErrorMessage ( ) ) ; } return marshaller . stringToObject ( Result . class , requestResult . getResponse ( ) ) ; } catch ( IOException e ) { throw new PaytrailException ( e ) ; } }
Get url for payment