Permalink
Browse files

Merge pull request #25 from reggi/patch-1

syntax highlighting
  • Loading branch information...
2 parents 9267f40 + c0e353e commit f8c07a1eadde5f8032f4eefcd6ccb1bcaf166f83 @indexzero indexzero committed Feb 1, 2016
Showing with 30 additions and 28 deletions.
  1. +30 −28 docs/AuthorizeNet.md
View
@@ -10,34 +10,36 @@ This client provides functionality for interacting with Authorize.net. Certifica
Here's an example using the minimal fields needed to process a payment.
- var authorizenet = require('paynode').use('authorizenet');
-
- var client = authorizenet.createClient({
- level:authorizenet.levels.sandbox
- ,login:'<yourlogin>'
- ,tran_key:'<yourtran_key>'
- })
-
- client.performAimTransaction({
- "x_type": "AUTH_CAPTURE",
- "x_method": "CC",
- "x_card_num": "4111111111111111",
- "x_exp_date": "0115",
-
- "x_amount": "19.99",
- "x_description": "Sample Transaction",
-
- "x_first_name": "John",
- "x_last_name": "Doe",
- "x_address": "1234 Street",
- "x_state": "WA",
- "x_zip": "98004"})
- .on('success', function(err, result){
- // do something to handle a successful transaction
- })
- .on('failure', function(err, result){
- // do something to handle a failed transaction
- })
+```js
+var authorizenet = require('paynode').use('authorizenet');
+
+var client = authorizenet.createClient({
+ level:authorizenet.levels.sandbox
+ ,login:'<yourlogin>'
+ ,tran_key:'<yourtran_key>'
+})
+
+client.performAimTransaction({
+ "x_type": "AUTH_CAPTURE",
+ "x_method": "CC",
+ "x_card_num": "4111111111111111",
+ "x_exp_date": "0115",
+
+ "x_amount": "19.99",
+ "x_description": "Sample Transaction",
+
+ "x_first_name": "John",
+ "x_last_name": "Doe",
+ "x_address": "1234 Street",
+ "x_state": "WA",
+ "x_zip": "98004"})
+ .on('success', function(err, result){
+ // do something to handle a successful transaction
+ })
+ .on('failure', function(err, result){
+ // do something to handle a failed transaction
+ })
+```
## Notes
Currently the callbacks for these methods use function(err, result). However, this format will be reverted and a new event named 'exception' will be fired when an exceptional case is reached (DNS resolution failure, 500 error from host, etc).

0 comments on commit f8c07a1

Please sign in to comment.