continuous-software / node-authorize-net Goto Github PK
View Code? Open in Web Editor NEWNode.js SDK for Authorize.net payment gateway.
Home Page: https://authorize.net/
Node.js SDK for Authorize.net payment gateway.
Home Page: https://authorize.net/
Not integrated with Dashboard.incorporations.io properly
Hello , we are using authorize.net and node-authorize-net (node module ) , When we do transaction using Sandbox then in return it return subscription Id and reference Id , but authorize.net sends a csv file in email . In this email we got transaction Id is not assigned and amount is 0.0
We send this Json in arb.createSubscription():
{"refId": "197s8",
"subscription": {
"name": "plan2",
"order": {
"invoiceNumber": "inv-034989",
"description": "enterprise"
},
"paymentSchedule": {
"interval": {
"length": 1,
"unit": "months"
},
"startDate": "2015-06-25",
"totalOccurrences": "9999",
"trialOccurrences": "1"
},
"amount": "19.99",
"trialAmount": "0",
"payment": {
"creditCard": {
"cardNumber": "4007000000027",
"expirationDate": "2018-12",
"cardCode": "111"
}
},
"billTo": {
"firstName": "Jane",
"lastName": "Doe"
}
}
}
Is there any issue that we got amount 0.0 and transaction is not assigned
0.4.19
to 0.4.20
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
xml2js is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Hi,
I just wrote version 1 of johntom/machinepack-authorizenet (see http://node-machine.org/implementing/Getting-Started) but I'm a little confused with the authorize.net versions.
The following works for me (0.0.5) https://www.npmjs.com/package/node-authorize-net along with https://tonicdev.com/npm/node-authorize-net
my code
var service=require('node-authorize-net')(inputs.apiLoginId,inputs.transactionKey);
Service.authCaptureTransaction(inputs.amount,inputs.cardnumber,inputs.cardexpyear,inputs.cardexpmonth,inputs.cardcode).then(function (transaction) {
I follow link to github and get https://github.com/continuous-software/node-authorize-net install authorize.net which is version 1.0.0 and get error codes when trying to use
var AuhorizeNet = require('authorize-net');
var client = new AuthorizeNet({
API_LOGIN_ID: inputs.apiLoginId,
TRANSACTION_KEY: inputs.transactionKey
});
errors:
The machine triggered its error exit and returned a value:
ReferenceError: AuthorizeNet is not defined
at Object.module.exports.fn (C:\a\machinepack-authorizenet\machines\create-t
ransaction-request.js:64:23)
at _runMachine (C:\a\machinepack-authorizenet\node_modules\machine\lib\Machi
ne.prototype.exec.js:402:17)
at afterCacheLookup (C:\a\machinepack-authorizenet\node_modules\machine\lib\
Machine.prototype.exec.js:413:7)
at _cacheLookup (C:\a\machinepack-authorizenet\node_modules\machine\lib\Mach
ine.prototype.exec.js:193:25)
at Machine_prototype_exec [as exec] (C:\a\machinepack-authorizenet\node_modu
les\machine\lib\Machine.prototype.exec.js:244:5)
at Object.module.exports.fn (C:\Users\john\AppData\Roaming\npm\node_modules\
machinepack\node_modules\machinepack-localmachinepacks\node_modules\machinepack-
machines\machines\run-instantiated-machine.js:121:21)
at _runMachine (C:\Users\john\AppData\Roaming\npm\node_modules\machinepack\n
ode_modules\machine\lib\Machine.prototype.exec.js:416:17)
at afterCacheLookup (C:\Users\john\AppData\Roaming\npm\node_modules\machinep
ack\node_modules\machine\lib\Machine.prototype.exec.js:427:7)
at _cacheLookup (C:\Users\john\AppData\Roaming\npm\node_modules\machinepack\
node_modules\machine\lib\Machine.prototype.exec.js:199:25)
at Machine_prototype_exec [as exec] (C:\Users\john\AppData\Roaming\npm\node_
modules\machinepack\node_modules\machine\lib\Machine.prototype.exec.js:250:5)
at Object.module.exports.fn (C:\Users\john\AppData\Roaming\npm\node_modules\
machinepack\node_modules\machinepack-localmachinepacks\machines\run-machine.js:9
0:8)
at _runMachine (C:\Users\john\AppData\Roaming\npm\node_modules\machinepack\n
ode_modules\machine\lib\Machine.prototype.exec.js:416:17)
at afterCacheLookup (C:\Users\john\AppData\Roaming\npm\node_modules\machinep
ack\node_modules\machine\lib\Machine.prototype.exec.js:427:7)
at _cacheLookup (C:\Users\john\AppData\Roaming\npm\node_modules\machinepack\
node_modules\machine\lib\Machine.prototype.exec.js:199:25)
at Machine_prototype_exec [as exec] (C:\Users\john\AppData\Roaming\npm\node_
modules\machinepack\node_modules\machine\lib\Machine.prototype.exec.js:250:5)
at Object.Machine.build.exec.success (C:\Users\john\AppData\Roaming\npm\node
_modules\machinepack\node_modules\machinepack-localmachinepacks\machines\run-mac
hine-interactive.js:206:12)
Thanks,
John
Doesn't appear to work.
I've tried both of these:
authorize.authCaptureTransaction(
charge_amount,
req.body.card,
req.body.expy,
req.body.expm, {
payment : {
creditCard : {
cardCode : req.body.cvv
}
},
billTo : {
firstName : req.body.first_name,
lastName : req.body.last_name
}
}
)
and
authorize.authCaptureTransaction(
charge_amount,
req.body.card,
req.body.expy,
req.body.expm, {
cardCode : req.body.cvv,
firstName : req.body.first_name,
lastName : req.body.last_name
}
)
There is some unknown errors with tests. It's probably the best idea to get them working before doing any functional changes.
CODE :
var AuhorizeNet = require('authorize-net');
var obj = new AuhorizeNet({
API_LOGIN_ID: 'xxxxxx',
TRANSACTION_KEY: 'xxxxxxxxxxxx',
testMode:true
});
var order={amount :100};
var creditCard = {expirationYear:2018,expirationMonth:12,cvv2:123,creditCardNumber:4111111111111111};
var prospect = {
billingFirstName: 'adas',
billingLastName: 'p',
billingAddress1: 'qweqwe',
billingCity: 'wqeqwe',
billingState: 'weewq',
billingPostalCode: 'wqeqwe',
billingCountry: 'India',
shippingFirstName: 'qweqwe',
shippingLastName: 'p',
shippingAddress1: 'qweqw',
shippingCity: 'qweqwe',
shippingState: 'qweqwe',
shippingPostalCode: 'qweqwe',
shippingCountry: 'India'
}
var other = true;
var result = obj.authorizeTransaction(order,creditCard,prospect,other);
Actually we trigger this library the transaction response coming well.
file:\node_modules\bluebird\js\release\promise_array.js --->> from this file code getting fail here line no :61 (values = util.asArray(values);)
we got success xml in values variable
Response:
read: [Function],
body: 'ο»ΏOkI00001
Successful.1497O5LYP22256687610965D1BCFD1BDEF47658629D2A6F263E60XXXX1111KeyedVisa1
This transaction has been approved.' }
but it is giving error as terminating code
ERROR RESPONSE :
Unhandled rejection TypeError: expecting an array or an iterable object but got [object Null]
at apiRejection (z:\nodejs\shopsy\node_modules\bluebird\js\release\promise.js:10:27)
at PromiseArray.init as _init
at Promise._settlePromise (z:\nodejs\shopsy\node_modules\bluebird\js\release\promise.js:556:21)
at Promise._settlePromise0 (z:\nodejs\shopsy\node_modules\bluebird\js\release\promise.js:604:10)
at Promise._settlePromises (z:\nodejs\shopsy\node_modules\bluebird\js\release\promise.js:683:18)
at Promise._fulfill (z:\nodejs\shopsy\node_modules\bluebird\js\release\promise.js:628:18)
at Request._callback (z:\nodejs\shopsy\node_modules\bluebird\js\release\nodeback.js:42:21)
at Request.self.callback (z:\nodejs\shopsy\node_modules\authorize-net\node_modules\request\request.js:344:22)
at emitTwo (events.js:87:13)
at Request.emit (events.js:172:7)
at Request. (z:\nodejs\shopsy\node_modules\authorize-net\node_modules\request\request.js:1239:14)
at emitOne (events.js:82:20)
at Request.emit (events.js:169:7)
at IncomingMessage. (z:\nodejs\shopsy\node_modules\authorize-net\node_modules\request\request.js:1187:12)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
1.0.0
to 1.0.1
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
42-cent-base is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Hi,
Things are moving along very well with this version but I've hit a snag and hoping you could help. On a positive note the nodemachine I'm writing provides great documentation and will be easy for others to follow when complete(see http://node-machine.org/). The code fails on the sendTransactionRequest failing on throw new GatewayError(). Below is error (I'm hiding id and key).
Thanks,
John
this is a console log of service
service { endpoint: 'https://api.authorize.net/xml/v1/request.api',
API_LOGIN_ID: 'xxxx4Tk9K',
TRANSACTION_KEY: 'xxxxN24Hqm7C5V98' }
body { transactionType: 'authCaptureTransaction',
amount: 5,
payment:
{ creditCard:
{ cardNumber: '5424000000000015',
expirationDate: '1220',
cardCode: '999' } },
billTo:
{ firstName: 'john',
lastName: 'Thomas',
city: 'NY',
state: '10011',
zip: '10011',
country: 'USA' },
shipTo:
{ firstName: 'john',
lastName: 'Thomas',
city: 'New York',
state: 'NY',
zip: '10011',
country: 'USA' } }
Unhandled rejection TypeError: Cannot read property '0' of undefined
at C:\A\machinepack-authorizenet\node_modules\authorize-net\lib\AuthorizeNetGateway.js:113:94
at C:\A\machinepack-authorizenet\node_modules\authorize-net\lib\AuthorizeNetGateway.js:86:16
at tryCatcher (C:\A\machinepack-authorizenet\node_modules\authorize-net\node_modules\bluebird\js\main\util.js:26:23)
at Promise._settlePromiseFromHandler (C:\A\machinepack-authorizenet\node_modules\authorize-net\node_modules\bluebird
\js\main\promise.js:507:31)
at Promise._settlePromiseAt (C:\A\machinepack-authorizenet\node_modules\authorize-net\node_modules\bluebird\js\main\
promise.js:581:18)
at Promise._settlePromiseAtPostResolution (C:\A\machinepack-authorizenet\node_modules\authorize-net\node_modules\blu
ebird\js\main\promise.js:245:10)
at Async._drainQueue (C:\A\machinepack-authorizenet\node_modules\authorize-net\node_modules\bluebird\js\main\async.j
s:128:12)
at Async._drainQueues (C:\A\machinepack-authorizenet\node_modules\authorize-net\node_modules\bluebird\js\main\async.
js:133:10)
at Immediate.Async.drainQueues [as _onImmediate] (C:\A\machinepack-authorizenet\node_modules\authorize-net\node_modu
les\bluebird\js\main\async.js:15:14)
at processImmediate [as _immediateCallback] (timers.js:358:17)
3.5.2
to 3.5.3
.π¨ View failing branch.
This version is covered by your current version range and after updating it in your project the build failed.
bluebird is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
Bugfixes:
The new version differs by 7 commits.
a5a5b57
Release v3.5.3
c8a7714
update packagelock
8a765fd
Update getting-started.md (#1561)
f541801
deps: update acorn and add acorn-walk (#1560)
247e512
Update promise.each.md (#1555)
e2756e5
fixed browser cdn links (#1554)
7cfa9f7
Changed expected behaviour when promisifying (#1545)
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Branch | Build failing π¨ |
---|---|
Dependency | bluebird |
Current Version | 3.5.1 |
Type | dependency |
This version is covered by your current version range and after updating it in your project the build failed.
bluebird is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.
Bugfixes:
PromiseRejectionEvent
to contain .reason
and .promise
properties. (#1509, #1464)The new version differs by 22 commits.
50067ec
Release v3.5.2
f290da0
Fix memory being retained until promise queue is completely empty (#1544)
ad6d763
Update benchmarks (#1539)
49da1ac
Fix a typo. (#1534)
b06106a
Fix typo in readme introduced in #1530 (#1531)
c1dc5b9
Update README.md (#1530)
e35455f
chore: clone last 5 commits (#1521)
91ae9ce
chore: add Node.js 10 (#1523)
9159472
Added a simple usage example (#1369)
39081ba
Update promise.each.md (#1479)
77781fe
Fix header (#1513)
b8eedc1
Update LICENSE to 2018 (#1490)
4163e82
Added ES6 way to import the bluebird promise (#1461)
3790a92
DOC: add direct link to Promise.delay from API ref (#1465)
e8d8525
Update error documentation (#1469)
There are 22 commits in total.
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Branch | Build failing π¨ |
---|---|
Dependency |
mocha
|
Current Version | 5.1.1 |
Type | devDependency |
This version is covered by your current version range and after updating it in your project the build failed.
mocha is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.
mocha.opts
(@plroebuck)before
hooks when using --bail
(@outsideris)Buffer.from()
(@harrysarson)The new version differs by 30 commits.
5bd33a0
Release v5.2.0
0a5604f
reformat missed files
7c8f551
ensure scripts/*.js gets prettiered
d8ea2ba
update CHANGELOG.md for v5.2.0 [ci skip]
7203ed7
update all dependencies
fb5393b
migrate Mocha's tests to Unexpected assertion library (#3343)
fae9af2
docs(docs/index.md): Update "mocha.opts" documentation
9d9e6c6
feat(bin/options.js): Add support for comment lines in "mocha.opts"
e0306ff
fix busted lint-staged config
f2be6d4
Annotate when exceptions are caught but ignored; closes #3354 (#3356)
889e681
remove dead code in bin/_mocha
8712b95
fix(ocd): re-order Node.js tests in .travis.yml (descending)
3ab0e7e
fix to exit correctly when using bail flag
d87b12e
add Node.js v10 to build; fix win32 issues (#3350)
b392af5
update package-lock.json for npm@6 [ci skip]
There are 30 commits in total.
See the full diff
There is a collection of frequently asked questions. If those donβt help, you can always ask the humans behind Greenkeeper.
Your Greenkeeper Bot π΄
Line 337 (inside getTransactionList function):
return setRequest(service, 'createTransactionRequest', {
I believe the correct Authorize.net API method name should be: getTransactionListRequest.
When applying an array of lineItems to the "other" argument on a createTranstactionRequest, the XML conversion pulls them all into one object with too many attributes
Here's an example of the JSON to be sent to the XML converter:
{
"transactionRequest": {
"transactionType": "authCaptureTransaction",
"amount": 83.66,
"payment": {
"creditCard": {
"cardNumber": 4007000000027,
"expirationDate": "2018-01",
"cardCode": "123"
}
},
"lineItems": {
"lineItem": [
{
"itemId": "acu-mbo-001",
"name": "Mood Boost",
"description": "I am the description",
"quantity": 1,
"unitPrice": 38.95,
"taxable": true
},
{
"itemId": "acu-nwl-001",
"name": "Natural Weight Loss",
"description": "I am the description",
"quantity": 1,
"unitPrice": 38.95,
"taxable": true
}
]
}
},
"merchantAuthentication": {
"name": "...",
"transactionKey": "..."
}
}
This will create:
<?xml version="1.0" encoding="UTF-8"?>
<createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<merchantAuthentication>
<name>...</name>
<transactionKey>...</transactionKey>
</merchantAuthentication>
<transactionRequest>
<transactionType>authCaptureTransaction</transactionType>
<amount>83.66</amount>
<payment>
<creditCard>
<cardNumber>4007000000027</cardNumber>
<expirationDate>2018-01</expirationDate>
<cardCode>123</cardCode>
</creditCard>
</payment>
<lineItems>
<lineItem>
<itemId>acu-mbo-001</itemId>
<name>Mood Boost</name>
<description>I am the description</description>
<quantity>1</quantity>
<unitPrice>38.95</unitPrice>
<taxable>true</taxable>
<itemId>acu-nwl-001</itemId>
<name>Natural Weight Loss</name>
<description>I am the description</description>
<quantity>1</quantity>
<unitPrice>38.95</unitPrice>
<taxable>true</taxable>
</lineItem>
</lineItems>
</transactionRequest>
</createTransactionRequest>
Note how the objects aren't in individual branches in the XML.
If only one lineItem is specified, the XML generates as expected.
The taxable option is missing from lineItem schema, which causes
Unhandled rejection Error
when lineItems is set with lineItem values
as ttitle.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.