13.01.2013 Views

Connecting to PaymentTrust's Secure Transaction Network - WorldPay

Connecting to PaymentTrust's Secure Transaction Network - WorldPay

Connecting to PaymentTrust's Secure Transaction Network - WorldPay

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

if (url_port == 443)<br />

{<br />

// HTTPS request<br />

pConnection = session.GetHttpConnection(server, INTERNET_FLAG_SECURE |<br />

INTERNET_FLAG_IGNORE_CERT_CN_INVALID, 443);<br />

pFile = pConnection->OpenRequest(1, outstring, NULL, 1, NULL, NULL,<br />

}<br />

266<br />

INTERNET_FLAG_SECURE|INTERNET_FLAG_IGNORE_CERT_CN_INVALID);<br />

}<br />

else<br />

{<br />

// HTTP request<br />

pConnection = session.GetHttpConnection(server, 0, 80);<br />

pFile = pConnection->OpenRequest(1, outstring, NULL, 1, NULL, NULL, 0);<br />

}<br />

pFile->SendRequest();<br />

x=pFile->Read(buffer, 9999);<br />

buffer[x]='\0'; // ‘buffer’ contain received data<br />

catch (...)<br />

{<br />

strcpy(buffer, "Exception Error"); // something went wrong<br />

}<br />

// POST Request<br />

try<br />

{<br />

// search for the '?' and replace it with a null termina<strong>to</strong>r<br />

// Note: this implies the URL will have a '?' in it<br />

strcpy(buffer, object);<br />

temp=strstr(buffer, "?");<br />

*temp='\0';<br />

if (url_port == 443)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!