views:

8

answers:

0

I receive a POST with the necessary details from the credit card processing company on SiteA, SiteA determines if that post is for itself, if not it will again post the details to SiteB

Here's the code on SiteA

    if request.post?  ## this request obj contains the info posted by the cc company
      if params[:site_name].downcase != "SiteA.com" ##if the data is not for SiteA 
      http = Net::HTTP.new("SiteB.com")
      http.use_ssl = false
      path = "/success"
      headers = { 'Cookie' => request.cookies } ## here request.cookies has the correct data , but setting it this way produces an error saying "strip" method missing, commenting it out works fine
      data  = ""
      params.each {|k,v| data += "#{k} => #{v} ,"} ## post method requires data to be string
      response = http.post(path, data, request.cookies)

When I check on SiteB there are no cookies present in the data sent by SiteA, and further processing of the transaction fails in absence of session data.

What am I doing wrong?