Purpose
The purpose of this project is to show how to connect to Authorize.Net (to your merchant account) and perform simple charge transactions (such as charging a credit card for a product or service you may offer). The focus of this tutorial is to demonstrate how to successfully transact with Authorize.Net from within a Amazon AWS Lambda function. As such I do not go into all the possible options you may have with a particular Authorize.Net function or series of functions (sometimes there are MANY). Instead, I'll show the 3 basic methods that are supported by Authorize.Net (the dll, xml, and, json) that you could use from within a Amazon AWS Lambda function. Lastly, you can get more information for working with different methods at Authorize.Net from HERE.

This is the "newest" JSON method that is currently labeled as "beta" at Authorize.net but, from what I understand, it can be used in production.

NOTE: There is a special character that I found as part of the json response from Authorize.net which would break using JSON.parse. However, if that 1st character in the response is filtered out (a "hovering dot" character) then you can use JSON.parse just fine. In the source code I attempted to preserve that character but it may not be there on your computer. If it is not there you can capture the response in the Lambda function to get the character and then filter it out.

While you can enlarge the image (to the left), you can also download a zip of the Lambda function source code HERE.

NOTE: While the Amazon AWS Lambda implimentation of Node.js does not include the capability to handle XML (such as from a 3rd party library as native Node.js could not handle it), I show a rather simple method of extracting data out of an XML response from the use of some regular expressions. I actually used that type of "trick" in the late 1990's when I was knee-deep in Perl.

While you can enlarge the image (to the left), you can also download a zip of the Lambda function source code HERE.