[Monetra]

Description

Link: [Monetra]
Author: Marc Pope
Category: Custom Tag
Version: 8.x
License:
Posted: Jan. 16, 2006
Updated: Jan. 17, 2006
More by this author...
The Monetra tag connects to the Monetra Transaction Server to process credit card transactions. Monetra is a high-end multi-threaded virtual terminal for connecting to major processors such as Vital & First Data among others. If you are processing a large volume of credit cards each month, I highly recommend you check out this software. It's very comprehensive. Runs on many platforms including Mac, Win, Unix. See: www.monetra.com for more info. Props to Kyle Jessup for help with this tag.

Parameters

none


Sample Usage

<?Lassoscript
		
var: 'transactionID' = (lasso_uniqueID);
		
var: 'm_transaction'  = (map);
$m_transaction->(insert:'username'='YOUR_USERNAME',
			'password'='YOUR_PASS',
			'action'='preauth',
			'account'=$monetra_ccno,
			'expdate'=$monetra_expdate,
			'amount'=$monetra_authAmount,
			'street'=$address,
			'zip'=$zip,
			'cv'=$cv_code,
			'ptrannum'=$transactionID,
			'clerkid'='001');
							
		
		// attempt to preauthorize the amount		
		
			var: 'result' = (monetra: $transactionID , $m_transaction);

?>
						

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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?Lassoscript

// Monetra Script for Lasso
// written by Marc Pope
// v1.12

define_tag: 'monetra', -required='transID', -required='query';

/*  config Monetra server variables  */

	local: 'm_server'  = '127.0.0.1';		// server IP or DNS name where server is
	local: 'm_port'    =  8333;				// port number for TCPIP on Monetra (default is 8333)
	local: 'm_timeout' =  8;
	local: 'readpacket'= (string);
	local: 'm_query' = (string);

	iterate: #query, local:'m_temp';
		#m_query += #m_temp->(first) + '=' + #m_temp->(second) + '\r\n';		
	/iterate;

    local:'m_packet' = bytes;
		#m_packet->import8Bits:0x02;
		#m_packet->(importString:#transID, 'ISO-8859-1');
		#m_packet->import8Bits:0x1c;
		#m_packet->(importString:#m_query, 'ISO-8859-1');
		#m_packet->import8Bits:0x03;

		local:'_stx'= bytes;
		#_stx->import8Bits:0x02;

		local:'_fs'= bytes;
		#_fs->import8Bits:0x1c;

		local:'_etx'= bytes;
		#_etx->import8Bits:0x03;
		
		
	local:'m_connect'=(net);
	local:'result'=(string);
	local:'m_result'=(map);
	
	#m_connect->setBlocking:false;
	#m_connect->(connect: #m_server, #m_port);
	
		if: #m_connect->(wait:#m_timeout, net_waitwrite) == net_waitwrite;
		
			protect;
			#m_connect->setBlocking:true;
			#readpacket = #m_connect->(write: #m_packet);
			
			// loop until end of transaction
			
			while: #result !>> #_etx;
				#result += #m_connect->(read:4096);
			/while;
			/protect;

		// parse #result into #m_result array
			
			protect;
			#m_result = #result->(split: #_fs)->(get:2)->(split:#_etx)->(get:1);
			#m_result = #m_result->(split:'\r\n');
			#m_result->(remove: (#m_result->(size)));
			/protect;

		else;
		
			#m_result->(insert:'Error,100');
			#m_result->(insert:'ErrorMsg,Unable to connect to Monetra server!');
		/if;
	
	
	#m_connect->(close);

	return: #m_result;
	
/define_tag;	

?>

 

Related Tags



Comments

none

Email:


Password:



Newest

Most Popular

Support tagSwap.net