SecurePay-RUBY (PA)

#!/usr/bin/env ruby

require 'net/https'
require 'uri'
require 'json'

def prepareCheckout()
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
req = Net::HTTP::Post.new(uri.path)
req.set_form_data({
 'authentication.userId' => '8a8294184f45ce7e014f4b1d16cc12df',
'authentication.password' => 'j3zCJ2ENaD',
'authentication.entityId' => '8a8294184f45ce7e014f4b1d16bd12db',
 'paymentType' => 'DB',
 'amount' => '59.99',
 'currency' => 'RSD'
})
return JSON.parse(http.request(req).body)
end

puts prepareCheckout()["id"]