HTTPSecureSocket and Authorize.net

Not sure if this belongs in web or not.
I am working on a desktop app for a POS system that will store customer information using authorize.net’s CIM System. As far as I can tell, their API can work by posting XML to a specific URL, but it is set up primarily as a tool for online merchants. My main question is can I create an HTTPSecureSocket object and post the XML as a string to the URL? My confusion comes from securing the connection, I don’t really know how the HTTPSecureSocket works underneath. Do I need a certificate file etc for the .Secure property to work? Or does setting this to True make all of the encryption happen somehow without it? Has anyone out there had success integrating with this service from a desktop platform already?

Thank you in advance, you help is greatly appreciated

You only need to create a certificate if you are creating a listening secure socket. If you just want to connect to a secure server then setting the secure property is all thats necessary. YOu might wish to watch some of the events and output the setting during the process for debugging and make sure it’s working properly. Connecting to someone elses secure server is a LOT easier than creating your own :wink:

Just use Xojo.Net.HTTPSocket. It’ll be secure if you use an “https” address.

Thank you Paul. I threw together a quick project to test if I could just send raw XML to URL. It worked, but the SetRequestContent method required a string not a memory block like it is indicated to in the documentation. Any ideas on what is going on there? Also, new to using the Text class, so maybe I am screwing something up there.

[code]Using Xojo.Core
Using Xojo.Data

dim s as string
dim content as text

s = RAW_XML_STUFF_THAT_REQUIRED_CONCATINATION_WHICH_TEXT_DID_NOT_LIKE
s = DefineEncoding(s, Encodings.UTF8)
content = s.ToText()

Dim data As MemoryBlock
data = TextEncoding.UTF8.ConvertTextToData(content)

self.aNetSocket.SetRequestContent(data, “application/x-www-form-urlencoded”)
self.aNetSocket.SendRequest(“POST”, “https://apitest.authorize.net/xml/v1/request.api”, f)[/code]

I get a compile error saying the “Parameter “content” expects type string, but this is class xojo.core.MemoryBlock”

I pass it s instead and it works great! But, I just felt like this inconsistency should be brought up.

You’re confusing the old and new sockets. If you’re using HTTPSecureSocket, it’ll be a string. If you’re using Xojo.Net.HTTPSocket, it’ll be a Xojo.Core.Memoryblock.