SecurePay-GROOVY (PA)

import groovy.json.JsonSlurper
public static String prepareCheckout() {
 def connection = url.openConnection()

 connection.setRequestMethod("POST")
 connection.doOutput = true
  String parameters ="authentication.userId=8a8294184f45ce7e014f4b1d16cc12df" +
       "&authentication.password=j3zCJ2ENaD"+
       "&authentication.entityId=8a8294184f45ce7e014f4b1d16bd12db" +
         "&paymentType=PA" +
         "&amount=599.99" +
         "&currency=RSD"
 connection.outputStream << parameters
 def json = new JsonSlurper().parseText(connection.inputStream.text)
}
println prepareCheckout()