Skip to content
This repository was archived by the owner on Oct 1, 2019. It is now read-only.
This repository was archived by the owner on Oct 1, 2019. It is now read-only.

Not able to get success response from this function "authorizeTransaction(order,creditCard,prospect,other)" #13

@naveencasp

Description

@naveencasp

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: 'OkI00001Successful.1497O5LYP22256687610965D1BCFD1BDEF47658629D2A6F263E60XXXX1111KeyedVisa1This 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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions