Page Index Toggle Pages: [1] 2  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) SSL web connections with Sesame (Read 2070 times)
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
SSL web connections with Sesame
Dec 1st, 2011 at 3:59am
Print Post Print Post  
Bharat asked for a bit more info, so here you go...

We have a command button on a Sesame form that we use daily to connect to a secure website to get and receive all kinds of data. We do this with a program called cURL (http://curl.haxx.se/)

cURL is a command line utility that can be launched from a Sesame command button (or run from a Mass Update, etc). Sesame supplies the web address URL and other data needed for cURL to make the connection, get and send the data, and then Sesame parses the data into the record using RegExBetweenString() commands, since the data we receive is in XML format.

This procedure can be used for things like downloading orders from an eCommerce website, getting tracking data from UPS, capturing a transaction with Paypal, searching for a transaction at Authorize.net....the list goes on and on.

cURL supports a plethora of switches and options, which was rather overwhelming to me, but Mark and Erika slammed out a custom program that I just copied into my form and it's been rock solid ever since.

If anyone wants more details, just post a request here...or call Mark and Erika for some custom work. (www.HammerData.com)

Steve
  
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: SSL web connections with Sesame
Reply #1 - Dec 1st, 2011 at 2:29pm
Print Post Print Post  
Does cURL program supports providing UserID and Password through code (without manually entering) to the secured website?  I believe that would be the step #1. Thanks to Steve for opening up the thread on this subject and providing info.
  
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: SSL web connections with Sesame
Reply #2 - Dec 1st, 2011 at 3:20pm
Print Post Print Post  
Bharat,

In the code that calls cURL, Sesame will include all the XML (or other data) that includes the login name, password, security key, Order Number, Customer info, etc etc etc.

EVERYTHING is done automatically, once programmed. It adds TREMENDOUS power to Sesame, which is already a stout program, as you know.

The only thing needed is a connection to the internet. I couldn't ask for a more perfect tool for order processing.

Steve

  
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: SSL web connections with Sesame
Reply #3 - Dec 1st, 2011 at 3:40pm
Print Post Print Post  
How can I get cURL program or snippet and try it out? I guess Mark or Erika will respond to this. Is this program inbuilt in Sesame3? Since a lot of transaction takes place through webs, such facility will be very useful indeed. Thanks.
  
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: SSL web connections with Sesame
Reply #4 - Dec 1st, 2011 at 4:18pm
Print Post Print Post  
Yes, I'll leave it to them to reply.
  
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: SSL web connections with Sesame
Reply #5 - Dec 1st, 2011 at 6:01pm
Print Post Print Post  
Bharat_Naik wrote on Dec 1st, 2011 at 3:40pm:
How can I get cURL program or snippet and try it out? I guess Mark or Erika will respond to this. Is this program inbuilt in Sesame3? Since a lot of transaction takes place through webs, such facility will be very useful indeed. Thanks.


No. cURL is a standalone free third party utility program. It has its origins on Unix/Linux, but has been ported to Windows (and others).

http://curl.haxx.se/

Wikipedia article:
http://en.wikipedia.org/wiki/CURL
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: SSL web connections with Sesame
Reply #6 - Dec 1st, 2011 at 6:38pm
Print Post Print Post  
Thanks Mark. I will look into this.
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: SSL web connections with Sesame
Reply #7 - Dec 2nd, 2011 at 1:48am
Print Post Print Post  
Steve_in_Texas wrote on Dec 1st, 2011 at 3:59am:
a bit more info, so here you go... a program called cURL (http://curl.haxx.se/)

cURL is a command line utility....


Steve and Mark Thanks for the info! Any tips and tools like these are always great to hear about. The learning curve is not so bad when others are pointing us in the correct direction and location.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: SSL web connections with Sesame
Reply #8 - Dec 6th, 2011 at 9:22pm
Print Post Print Post  
FYI: I just finished building Steve a suite of functions that lets him interface with PayPal from his Sesame order records using this method. It works great!
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: SSL web connections with Sesame
Reply #9 - Dec 6th, 2011 at 9:39pm
Print Post Print Post  
This sounds really great. If one can login to PayPal site using cURL, I am sure any other sites also can be logged in and perform whatever interchange of data needed to be performed can be carried out. Erika, can you please give some concrete examples automatic login and carrying out exchange of data using cURL?  Thanks.
  
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: SSL web connections with Sesame
Reply #10 - Dec 6th, 2011 at 9:41pm
Print Post Print Post  
Quote:
It works great!


Yes, indeed! Erika's code is a work of art. I ran a few transactions flawlessly.

I highly recommend!
  
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: SSL web connections with Sesame
Reply #11 - Dec 6th, 2011 at 9:54pm
Print Post Print Post  
Bharat_Naik wrote on Dec 6th, 2011 at 9:39pm:
This sounds really great. If one can login to PayPal site using cURL, I am sure any other sites also can be logged in and perform whatever interchange of data needed to be performed can be carried out. Erika, can you please give some concrete examples automatic login and carrying out exchange of data using cURL?  Thanks.


cURL has a whole lot of flags to meet the demands of various API's and every SOAP API has its own specific structure, so most examples don't extrapolate very well. However, here is what I use to capture an authorized PayPal transaction.

Code
Select All
FUNCTION hdsBuildDoCaptureRequest(aTrx as String, aAmt as String) as String
var vRet as String

	vRet = "<soapenv:Envelope xmlns:soapenv=" + @CHR(34) + "http://schemas.xmlsoap.org/soap/envelope/" + @CHR(34)
	+ " xmlns:urn=" + @CHR(34) + "urn:ebay:api:PayPalAPI" + @CHR(34)
	+ " xmlns:urn1=" + @CHR(34) + "urn:ebay:apis:eBLBaseComponents" + @CHR(34) + ">
	   <soapenv:Header>
	      <urn:RequesterCredentials>
	            <urn1:Credentials>
	                <urn1:Username>" + SOAP_USER + "</urn1:Username>
	          	  <urn1:Password>" + SOAP_PASS + "</urn1:Password>
	             	  <urn1:Signature>" + SOAP_SIG + "</urn1:Signature>
	            </urn1:Credentials>
	      </urn:RequesterCredentials>
	   </soapenv:Header>
	   <soapenv:Body>
	      <urn:DoCaptureReq>
	         <urn:DoCaptureRequest>
	            <urn1:Version>84.0</urn1:Version>
	            <urn:AuthorizationID>" + aTrx + "</urn:AuthorizationID>
	            <urn:Amount currencyID=" + @CHR(34) + "USD" + @CHR(34) + ">" + aAmt + "</urn:Amount>
	            <urn:CompleteType>NotComplete</urn:CompleteType>
	         </urn:DoCaptureRequest>
	      </urn:DoCaptureReq>
	   </soapenv:Body>
	</soapenv:Envelope>"
	Return(vRet)

END FUNCTION

var vResult as String
var vAck as String
var vCode as String
var vTrxId as String
var vTrxAmt as String
var vGrossAmt as String
var vFeeAmt as String

	// ----------------- Do Capture -----------------
	vTrxId = CaptureTrxId
	vTrxAmt = CaptureTrxAmt
	If ((vTrxId <> "") And (@ToNumber(vTrxAmt) > 0))
	{
		vTrxAmt = @Decimals(vTrxAmt, 2)
		vCode = hdsBuildDoCaptureRequest(vTrxId, vTrxAmt)
		vResult = @RedirectProcess(curl_command, vCode)
		vAck = hdsPPSOAPErrHandler(vResult)
		If vAck = "Success"
		{
			vGrossAmt = @RegexBetweenString(vResult, "<GrossAmount[^>]*>", "</GrossAmount>", 1, 0)
			vFeeAmt = @RegexBetweenString(vResult, "<FeeAmount[^>]*>", "</FeeAmount>", 1, 0)
			@MsgBox("***** CAPTURE SUCCESSFUL *****", "Gross Amt: $" + @Decimals(vGrossAmt, 2) + @Newline() + "Fee Amt: $" + @Decimals(vFeeAmt, 2) + @Newline() + "Net Amt: $" + @Decimals(@ToNumber(vGrossAmt) - @ToNumber(vFeeAmt), 2), "")
		}
	}
 



Note that the stuff in caps, like SOAP_SERVER, SOAP_USER, SOAP_SIG, and SOAP_PASS are defines that provide the account-specific credentials. curl_command is a static variable that is set to provide what PayPal wants in GLOBAL CODE to:

Code
Select All
curl_command = "curl.exe -s -H " + @chr(34) + "Content-Type: text/xml; charset=utf-8 SOAPAction:" + @chr(34) + " --insecure  -d @- -X POST " + @chr(34) + SOAP_SERVER + @chr(34) 

  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: SSL web connections with Sesame
Reply #12 - Dec 6th, 2011 at 10:35pm
Print Post Print Post  
Thank Erika. XML and cURL plus API and Browser interactions.  A lot to learn and digest here but the fact is that it is doable with Sesame is very encouraging. Thanks again.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: SSL web connections with Sesame
Reply #13 - Dec 13th, 2011 at 5:52pm
Print Post Print Post  
FYI: Google Checkout works too.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Acebanner
Full Member
***
Offline



Posts: 123
Location: New York City
Joined: Jan 23rd, 2008
Re: SSL web connections with Sesame
Reply #14 - Dec 14th, 2011 at 1:49pm
Print Post Print Post  
Anyone ever use cURL to access FedEx's servers? I figure a lot of people could use that sort of functionality.
  
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send Topic Send Topic Print Print