Giter VIP home page Giter VIP logo

veritrans-node's People

Contributors

alwint3r avatar imjalul avatar sgpagek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

veritrans-node's Issues

syntaxerror: use of const in strict mode

Hello,

The module works fine when I am in localhost. However, when I am running it on my AWS Machine, it shows error:
syntaxerror: use of const in strict mode

Complete error message as below:
/home/ubuntu/finhop/node_modules/veritrans/index.js:3
const _ = require('lodash');
^^^^^
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)

I tried running it on different environment and I use the simple: "node app.js" command to run it.

Any clue? Does this happen to you or anyone else?

multiple items in "item_details" not working

As stated in VeriTrans API Documentations, for multiple items inside item_details is supported by having them inside array like the following:
"item_details" : [{/item1/}, {/item2/}, ...]

However, this module does not seem to support the multiple items inside "item_details" and that appears in the validate_transaction.js file, which does not consider the possibility of having "item_details" in array format.

if (utils.hasProperty(payload, 'item_details')) {
if (!utils.hasProperty(payload.item_details, requiredItemDetailsProps)) {
return callback(new Error('item_details field requires: ' + requiredItemDetailsProps + ' fields'));
}
}

Edit:
Further code review seems to indicate the array fails at the following lines:
if (object.constructor !== Object) {
return false;
}

at utils.js

404 - Error: The requested resource is not found

Saya coba bikin simple app pake ExpressJS manfaatin lib ini untuk check status dari orderan saya yg sudah sukses masuk ke Veritrans via Sandbox, berikut code saya:

var PORT = 4040;
var serverKey = "-SERVERKEY-";
var clientKey = "-CLIENTKEY-";
var url = "https://api.sandbox.veritrans.co.id/v2";


const config2 = {
    serverKey: serverKey,
    clientKey: clientKey,
    url: url
};
const Veritrans = require('veritrans');
const vt = new Veritrans(config2);

var http = require('http');
var express = require('express');
var bodyParser = require('body-parser');
var app = express();

app.use(bodyParser.json());
app.use(express.static(__dirname + '/public')); 
app.use(bodyParser.json());

app.use(function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    next();
});


app.get('/status/:id', function(req, res) {
    var id = req.params.id;
    console.log(id)

    vt.transaction.status(id, (err, result) => {
        if (err) {
            console.error(err);
            return res.redirect('/transaction/' + id);
        }
        return res.redirect('/transaction/' + id);
    });
});

app.listen(PORT, function() {
    console.log('Express listening on port ' + PORT + '!');
});

Lalu saya coba GET Request via Postman
http://localhost:4040/status/100030002_prepaid_1462182481
Di Console saya keluar error:
{ [Error: The requested resource is not found] code: '404' }
Padahal orderID ini ada di Sandbox nya
Screen Shot 2016 05 02 at 11 24 14 PM

Ini kenapa ya? Apakah saya ada yang kelewatan?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.