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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
|
<?LassoScript
Define_Tag: 'AuthorizeNet_AIM',
-Required='AIMParams',
-Criteria=(#AIMParams->(Type) == 'map');
/*
---------------------------------
Description
---------------------------------
This tag is an update to the AuthorizeNet_AIM payment processing tag for Lasso 8 and the new Authorize.net AIM v3.1 payment processing gateway.
This tag receives one parameter, an unnamed map of name/value pairs representing the parameters to be passed to Authorize.Net.
This tag returns a value whcih is either a string or a map. If the returned value is a string, the string is the plain text error message returned by Authorize.Net. If the returned value is a map, it contains the name/value pairs of non-empty parameters returned by Authorize.Net.
---------------------------------
Usage
---------------------------------
It is highly recommend to store this file on your web server in a location that cannot be served, preferably outside of your web root. You do *not* want your login or transaction key to be served as a plain text file.
Build a map of AIM parameters.
var('AIMParams' = (map:
'x_first_name' = $first_name,
'x_last_name' = $last_name,
'x_amount' = $amount,
... and so on...
));
When calling [AuthorizeNet_AIM], store the results in a variable so you can easily display values from the $AIM_results map on a receipt page or email:
var: 'AIM_results' = (AuthorizeNet_AIM: $AIMParams);
'Thank you, '; $AIM_results->(Find:'x_first_name'); '!';
'You have personally enriched me by $'; $AIM_results->(Find:'x_amount'); '.';
You can add merchant-defined results labels to #AIMResultLabels, and access them after they are echoed by AIM.
See the comments embedded in the code below for proper configuration.
---------------------------------
Additional eCommerce Resources
---------------------------------
The following information does not constitute an endorsement, warranty or guarantee of service. This information is provided for the sake of comparison. These are the lowest fees I have found over the years.
For further information on developing for AIM, download the AIM Guide:
<http://www.authorize.net/support/AIM_guide.pdf>
You can sign up for a developer account, or you can have the client purchase their own Authorize.net account and create a "webmaster" user that has the required access.
<http://authorize.net/solutions/partnersolutions/certifieddeveloperprocess/>
<http://developer.authorize.net/testaccount/>
In addition to this tag, there are the following requirements:
(1) Dedicated IP for SSL.
(2) SSL (~$10/month for both (1) and (2)).
(3) Secure certificate ($29.99/year from GoDaddy.com)
(4) Merchant account that accepts payments over the Internet. Some brick and mortar retailers already have a merchant account, so sometimes it is easier to add this feature to their existing merchant account. If you need a merchant account, you can support the continued development of the AuthorizeNet_AIM tag by following this link:
<http://www.freeauthnet.com/index.php?partner=100434>
As of June 18, 2008, the merchant account costs $8.95/month, plus 2.14% of the transaction amount and 24 cents per transaction. Current pricing can be found here:
<http://stevepiercy.com/services.lasso>
(5) payment gateway (an Authorize.net account, for example). I am an Authorize.net account reseller. You can support the continued development of the AuthorizeNet_AIM tag by following this link:
<https://ems.authorize.net/oap/home.aspx?SalesRepID=39&ResellerID=11937>
As of June 18, 2008, the cost is $17.95/month, plus $99.00 account setup, plus $0.10 per transaction. Current pricing can be found here:
<http://stevepiercy.com/services.lasso>
I am available as a consultant for ecommerce solutions. Please see the following web page for more information:
<http://stevepiercy.com/services.lasso>
=================================
Version History: 1.2
Date: Sep 26, 2007
Author: Steve Piercy
URL: http://www.stevepiercy.com/
URL: http://tagSwap.net/AuthorizeNet_AIM
Added comments regarding AIM gateway response fields.
Improved usage guidelines documentation.
Corrected names of response labels for positions 39 and 40.
Added empty AIM 3.1 reserved fields for positions through 68. May be used for future expansion of AIM.
Added check that compares the sizes of the AIMResultLabels and AIMResultArray arrays to prevent "invalid position passed to get" error, and to generate ennumerated labels for results that are out of range of the labels array.
=================================
Version History: 1.1
Date: Oct 6, 2006
Author: Steve Piercy
URL: http://www.stevepiercy.com/
URL: http://tagSwap.net/AuthorizeNet_AIM
Updated for Lasso 8.1 and AIM 3.1. Thanks to Jonathan Guthrie for schooling me on iterate.
=================================
Version History: 1.0
Date: March 3, 2003
Author: Trigger Consulting
URL: http://www.trigger.biz/
Disclaimer:
While Trigger Consulting has made every effort to deliver a high
quality product, we do not guarantee that this product is free from
defects. The software is provided "as is," and you use the software
at your own risk. Trigger Consulting makes no warranties as to
performance, merchantability, fitness for a particular purpose, or
any other warranties whether expressed or implied. No oral or written
communication from or information provided by Trigger Consulting
shall create a warranty. Under no circumstances shall Trigger
Consulting be liable for direct, indirect, special, incidental, or
consequential damages resulting from the use, misuse, or inability to
use this software, even if Trigger Consulting has been advised of the
possibility of such damages. These exclusions and limitations may not
apply in all jurisdictions. You may have additional rights and some
of these limitations may not apply to you.
AuthorizeNet_AIM is in the public domain and free for your
use. Obviously, Trigger Consulting would appreciate credit where
credit is due. No pun intended.
*/
Local: 'CurrentParam' = null;
Local: 'AIMParamArray' = (Array);
Local: 'AIMParamString' = (String);
Local: 'AIMURL' = (String);
Local: 'AIMResult' = (String);
Local: 'AIMResultArray' = (Array);
Local: 'AIMResultLabelArray' = (Array);
Local: 'AIMCurrentResultLabel' = (null);
Local: 'Output' = null;
// The first 68 result labels are reserved by the AIM gateway for version 3.1. Do not alter their order or names.
Local: 'AIMResultLabels' = (Array:
'x_response_code',
'x_response_subcode',
'x_response_reason_code',
'x_response_reason_text',
'x_approval_code',
'x_avs_result_code',
'x_transaction_id',
'x_invoice_num',
'x_description',
'x_amount',
'x_method',
'x_type',
'x_cust_id',
'x_first_name',
'x_last_name',
'x_company',
'x_address',
'x_city',
'x_state',
'x_zip',
'x_country',
'x_phone',
'x_fax',
'x_email',
'x_ship_to_first_name',
'x_ship_to_last_name',
'x_ship_to_company',
'x_ship_to_address',
'x_ship_to_city',
'x_ship_to_state',
'x_ship_to_zip',
'x_ship_to_country',
'x_tax',
'x_duty',
'x_freight',
'x_tax_exempt',
'x_po_num',
'x_MD5_hash',
'x_card_code',
'x_cavv_resp_code',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
// The following labels are optionally defined by the merchant and echoed by the AIM gateway. If you do not add them here, they will not be echoed by the AIM Results Array and not added to the map $results.
'x_comments',
'x_another_example'
);
/*
Commented parameters are set through the web interface on Authorize.net.
If you set a parameter in Authorize.net, comment it here;
and if you do not set a parameter in Authorize.net, then uncomment it here.
In other words, define parameters in one and only one place.
Configure these two lines:
#AIMParams->(Insert: 'x_login'='ENTER_YOUR_LOGIN');
#AIMParams->(Insert: 'x_tran_key'='ENTER_YOUR_TRANSACTION_KEY');
*/
// #AIMParams->(Insert: 'x_version'='3.1');
// #AIMParams->(Insert: 'x_delim_data'='TRUE');
#AIMParams->(Insert: 'x_relay_response'='FALSE');
#AIMParams->(Insert: 'x_login'='ENTER_YOUR_LOGIN');
#AIMParams->(Insert: 'x_tran_key'='ENTER_YOUR_TRANSACTION_KEY');
#AIMParams->(Insert: 'x_type'='AUTH_CAPTURE');
Iterate: #AIMParams, (Local: 'CurrentAIMParam');
#AIMParamArray->(Insert: #CurrentAIMParam->(First)=#CurrentAIMParam->(Second));
/Iterate;
#AIMURL = 'https://secure.authorize.net/gateway/transact.dll';
#AIMResult = (String: (Include_URL: #AIMURL, -POSTParams=#AIMParamArray));
/*
The character used in the following split must be the same as the character you use in your Authorize.net settings:
Account > Settings > Direct Response > Direct Response Delimiter
To make it easy, I used a pipe | because users will enter commas in their comments or name, Jr., whereas they seldom enter |. In Authorize.net, I use a pipe and no encapsulation characters:
Delimited Response: (X) Yes ( ) No
Default Field Separator | (pipe) or [ ]
Field Encapsulation Character [blank] or [ ]
*/
#AIMResultArray = #AIMResult->(Split: '|');
If: #AIMResultArray->Size == 1;
// uh-oh. There was a failure.
#Output = #AIMResult;
Else;
// Yippee! The payment was processed.
#Output = (Map);
Iterate: #AIMResultArray, (Local: 'current_result');
if(#AIMResultLabels->Size > Loop_Count);
// We are within the range of defined results labels.
Local: 'current_label' = #AIMResultLabels->(Get: Loop_Count);
If: #current_result != null;
#Output->(Insert: (#current_label)=(#current_result));
/If;
else;
// We are outside the range of defined results labels, and so we create ennumerated labels.
Local: 'current_label' = 'x_out_of_range_label_'+(Loop_Count);
If: #current_result != null;
#Output->(Insert: (#current_label)=(#current_result));
/If;
/if;
/Iterate;
/If;
Return: #Output;
/Define_Tag;
?>
|
Added Additional Resources for eCommerce in General
Download the tag or scroll through the source to see the additional eCeommerce resources.