Coder Social home page Coder Social logo

place-node's People

Contributors

ianhalpern avatar

Watchers

 avatar  avatar  avatar

place-node's Issues

delete_all method doesn't work

Description

When calling delete_all method for specific resource with correct id the request is successful, but the resource is not deleted.

Steps to Reproduce

  • Create payment method.
  • Get the payment method id.
  • Try to delete it through the SDK.

Expected Behavior

The payment method is marked as deleted.

Actual Behavior

The payment method is not marked as deleted.

Code snipped that reproduce the issue:

place.PaymentMethod.delete_all([{
    id: '3bZubZyPWpM6tRdQrH6TQ'
}])
.then(function(result) {
    // the correct payment method is returned, but it is not deleted
});

Exception is thrown when invalid api_key is passed

Description

If you pass invalid api_key to the place object and try to make a request an exception is thrown.

Steps to Reproduce

  • Set invalid access token to the place object (for example test_private_key_invalid_value).
  • try to make any request.

Expected Behavior

The promise should be rejected.

Actual Behavior

Exception is thrown. The exception cannot be catched.

Code snipped that reproduce the issue:

const place = require('place-api');
place.api_key = 'test_private_key_invalid_value';

try {
    var account = place.Account.get()
        .then(function(account) {
            console.log(account)
        }).catch(function(error) {
            console.log(error);
    });
} catch (error) {
    console.log(error);
}

Output:

Unauthorized: api_sessions
    at Request._callback (/Users/atanasov/Desktop/work/place-test/node_modules/place-api/lib/APIResource.js:138:31)
    at Request.self.callback (/Users/atanasov/Desktop/work/place-test/node_modules/request/request.js:185:22)
    at emitTwo (events.js:126:13)
    at Request.emit (events.js:214:7)
    at Request.<anonymous> (/Users/atanasov/Desktop/work/place-test/node_modules/request/request.js:1161:10)
    at emitOne (events.js:116:13)
    at Request.emit (events.js:211:7)
    at IncomingMessage.<anonymous> (/Users/atanasov/Desktop/work/place-test/node_modules/request/request.js:1083:12)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:111:20)

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.