https://github.com/nswbmw/simple-authorizenet-sdk
https://github.com/nswbmw/simple-authorizenet-sdk
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nswbmw/simple-authorizenet-sdk
- Owner: nswbmw
- Created: 2025-04-16T03:16:47.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2025-04-16T03:18:54.000Z (6 months ago)
- Last Synced: 2025-06-09T11:48:55.889Z (4 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## simple-authorizenet-sdk
Simple AuthorizeNet SDK for Node.js
### No proxy
```js
const AuthorizeNet = require('simple-authorizenet-sdk')
const authorizeNetClient = new AuthorizeNet({
environment: 'sandbox' // sandbox|production
});(async () => {
const res = await authorizeNetClient.execute({
createTransactionRequest: {
merchantAuthentication: {
name: 'xxx',
transactionKey: 'xxx'
},
transactionRequest: {
transactionType: 'authCaptureTransaction',
amount: '10',
payment: {
creditCard: {
cardNumber: '4242424242424242',
expirationDate: '2029-04',
cardCode: '999'
}
},
order: { invoiceNumber: 'INV-1' },
lineItems: {
lineItem: [
{
itemId: '1',
name: 'apple',
description: 'Red Fuji Apple',
quantity: '10',
unitPrice: 1
}
]
},
customer: { email: 'test@example.com' },
billTo: {
firstName: 'Ellen',
lastName: 'Johnson',
address: '12 Main Street',
city: 'Pecan Springs',
state: 'TX',
zip: '44628',
country: 'US',
phoneNumber: '1234567890',
email: 'test@example.com'
},
shipTo: {
firstName: 'Ellen',
lastName: 'Johnson',
address: '12 Main Street',
city: 'Pecan Springs',
state: 'TX',
zip: '44628',
country: 'US'
},
customerIP: '164.70.95.228'
}
}
})
console.dir(res, { depth: 10 })
})().catch(console.error)
```### Proxy
```js
const AuthorizeNet = require('simple-authorizenet-sdk')
const authorizeNetClient = new AuthorizeNet({
environment: 'sandbox',
proxy: {
protocol: 'http', // http|socks
host: '127.0.0.1',
port: 1234,
username: 'admin',
password: '123456'
}
});(async () => {
const res = await authorizeNetClient.execute({
createTransactionRequest: {
merchantAuthentication: {
name: 'xxx',
transactionKey: 'xxx'
},
transactionRequest: {
transactionType: 'authCaptureTransaction',
amount: '10',
payment: {
creditCard: {
cardNumber: '4242424242424242',
expirationDate: '2029-04',
cardCode: '999'
}
},
order: { invoiceNumber: 'INV-1' },
lineItems: {
lineItem: [
{
itemId: '1',
name: 'apple',
description: 'Red Fuji Apple',
quantity: '10',
unitPrice: 1
}
]
},
customer: { email: 'test@example.com' },
billTo: {
firstName: 'Ellen',
lastName: 'Johnson',
address: '12 Main Street',
city: 'Pecan Springs',
state: 'TX',
zip: '44628',
country: 'US',
phoneNumber: '1234567890',
email: 'test@example.com'
},
shipTo: {
firstName: 'Ellen',
lastName: 'Johnson',
address: '12 Main Street',
city: 'Pecan Springs',
state: 'TX',
zip: '44628',
country: 'US'
},
customerIP: '164.70.95.228'
}
}
})
console.dir(res, { depth: 10 })
})().catch(console.error)
```