Lasso Soft Inc. > Home


AuthorJason Huck
LicensePublic Domain
Posted25 Oct 2007
Updated15 May 2009
More by this author...


Version 4 of the Payflow Pro interface now allows direct communication with the Payflow servers over HTTPS, without going through the Java or .NET SDK's. This tag is a wrapper for [include_url] that constructs the appropriate request headers for that communication and submits parameters in NVP format. Returns a map of parameters provided in the response.

In addition to the tag-specific parameters listed below, consult the Payflow Pro documentation for a complete list of supported options.

Sample Usage

	-street='1234 This Way',
	-name='Joe Schmoe'

-> map: (RESPMSG)=(Approved), (IAVS)=(N), (AVSZIP)=(N), 
(POSTFPSMSG)=(No Rules Triggered), (PREFPSMSG)=(No Rules Triggered), 
(CVV2MATCH)=(Y), (AUTHCODE)=(xxxxx), (PNREF)=(xxxxxxxx), 

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

	-opt='test', -type='boolean',
	-description='Wrapper for PayPal Payflow Pro direct HTTPS integration.'
	// submit to the test server or the production server?
	!local_defined('test') ? local('test') = false;
	local('url') = 'https://' + (#test ? 'pilot-') + '';	

	// assign a unique id for this transaction unless re-trying
	!local_defined('requestid') ? local('requestid') = lasso_uniqueid;

	// assemble the body of the post from the given params
	local('body') = string;

	// exclude params passed just for the tag
	local('extraparams') = (: '-test', '-requestid', '-appid');
	iterate(params, local('i'));
		if(#extraparams !>> #i->first);
			local('n') = string(#i->first)->removeleading('-')&uppercase&;
			local('v') = string(#i->second)->replace('"','')&;
			(: '&','=') >> #v ? #n += '[' + #v->size + ']';
			#body += #n + '=' + #v + '&';
	// assemble extra MIME headers
	local('lassoversion') = decimal(lasso_version( -lassoversion))->setformat( -precision=1)&;
	local('headers') = (:
		'Content-Type'						=	'text/namevalue',
		'Content-Length'						=	#body->size,
		'X-VPS-REQUEST-ID'					=	#requestid,
		'X-VPS-CLIENT-TIMEOUT'				=	'45',
		'X-VPS-VIT-INTEGRATION-PRODUCT'		=	'Lasso Professional Server',
		'X-VPS-VIT-INTEGRATION-VERSION'		=	#lassoversion,
		'X-VPS-VIT-OS-NAME'					=	lasso_version( -lassoplatform),
		// 'X-VPS-VIT-OS-VERSION'			=	'',
		'X-VPS-VIT-RUNTIME-VERSION'			=	#lassoversion
	// submit the transaction
	local('response') = string;
		#response = include_url(
	// parse the response
	!#response->size ? return('Connection timed out.');
	local('out') = map('REQUESTID' = #requestid);
	iterate(#response->split('&'), local('i'));
			'n' = #i->split('=')->first,
			'v' = #i->split('=')->second
		#out->insert(#n = #v);

Related Tags


15 May 2009, Jason Huck

Compatibility Updates

Updated to use the current server addresses and report the content "size" per the latest requirements. Thanks to Randy Phillips for supplying the changes.

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home



©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft