aplazame

0.1.3 • Public • Published

github-banner

Aplazame SDK for NodeJS

node install aplazame --save

Full example in: Github

var aplazame = require('aplazame')('privateKey');
 
// this example is using expressjs
app.post('/checkout/confirm', function (req, res) {
  var checkout_token = req.body.checkout_token,
      order = CheckoutOrder.get(checkout_token);
 
  if( !order ) {
    res.status(404).end();
  }
 
  aplazame.authorizeOrder(checkout_token)
    .then(function (response) {
      order.confirm().then(function () {
        res.status(204).end();
      });
    }, function (reason) {
      console.log('authorize error', reason);
      // [502 Bad Gateway] The server was acting as a gateway or proxy
      //   and received an invalid response from the upstream server.
      res.status(502).end();
    }).catch(function (err) {
      console.log('authorize error (2)', err);
    });
});
 

Readme

Keywords

Package Sidebar

Install

npm i aplazame

Weekly Downloads

5

Version

0.1.3

License

GPL-3.0

Last publish

Collaborators

  • juancamejoalarcon
  • jgermade
  • aplazame-dev
  • zzztor
  • luis.amor