2

I'm trying to implement HiPay API for my checkout process.

In my controller i do :

 http = Net::HTTP.new("https://test-www.hipay.com/")
 @response = http.post("/order", xml)

and i have this error :

SocketError in XController#new<br>
getaddrinfo: nodename nor servname provided, or not known

I build my xml in my controller like this :

xml = Builder::XmlMarkup.new

xml.HIPAY_MAPI_SimplePayment do
  xml.HIPAY_MAPI_PaymentParams do
    xml.login("7379")
    xml.password("1911")
    xml.itemAccount("7379")
    xml.taxAccount("7379")
    xml.insuranceAccount("7379")

    ...
end

I dont know what is my problem.

Does anyone have some experience with HiPay API ? May be https problem ?

Im in trouble with this API integration.

Thanks in advance.

Hiro
  • 29
  • 1
  • 6

1 Answers1

1

If you want to use HTTPS you should specify some additional parameters. Your snippet would work for a non-secure connection but for SSL look at the official documentation, this helpful HTTP cheat sheet or these SO questions: Using Net::HTTP.get for an https url, Ruby https POST with headers

Community
  • 1
  • 1
Kostas Rousis
  • 5,918
  • 1
  • 33
  • 38