New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

chargebee

Package Overview
Dependencies
Maintainers
1
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chargebee - npm Package Compare versions

Comparing version 2.22.2 to 2.22.3

17

lib/chargebee.js

@@ -7,3 +7,2 @@ var ChargeBee = {};

const IDEMPOTENCY_HEADER = "chargebee-idempotency-key";
const IDEMPOTENCY_REPLAY_HEADER = 'chargebee-idempotency-replayed';

@@ -15,3 +14,3 @@ ChargeBee._env = {

timeout: 80000,
clientVersion: 'v2.22.2',
clientVersion: 'v2.22.3',
port: 443,

@@ -162,7 +161,7 @@ timemachineWaitInMillis: 3000,

}
function callBackWrapper(err, response, headers, isIdempotencyReplayed) {
function callBackWrapper(err, response) {
if (err) {
deferred.reject(err);
} else {
deferred.resolve({'response': response, 'headers': headers, 'isIdempotencyReplayed' : isIdempotencyReplayed});
deferred.resolve(response);
}

@@ -240,9 +239,5 @@ };

response.http_status_code = res.statusCode;
callBack(response, null, res.headers);
callBack(response, null);
} else {
isIdempotencyReplayed = false
if(typeof res.headers[IDEMPOTENCY_REPLAY_HEADER] !== 'undefined' && res.headers[IDEMPOTENCY_REPLAY_HEADER] !== ''){
isIdempotencyReplayed = res.headers[IDEMPOTENCY_REPLAY_HEADER];
}
callBack(null, response, res.headers, isIdempotencyReplayed);
callBack(null, response);
}

@@ -481,3 +476,3 @@ });

setTimeout(function() {
callback(null, res.response, res.headers, isIdempotencyReplayed);
callback(null, res);
}, 0);

@@ -484,0 +479,0 @@ }, function(err) {

{
"name":"chargebee",
"version":"2.22.2",
"version":"2.22.3",
"description":"A library for integrating with ChargeBee.",

@@ -5,0 +5,0 @@ "keywords":[

@@ -50,3 +50,3 @@ # Chargebee Node Client Library - API V2

.request();
// access customer as result.response.customer;
// access customer as result.customer;
} catch (err) {

@@ -68,3 +68,3 @@ // handle error

// handle result
// access customer as result.response.customer;
// access customer as result.customer;
})

@@ -102,3 +102,3 @@ .catch((err) => {

const result = await chargebee.customer.create({ email: 'john@test.com' }).request();
console.log(result.response.customer);
console.log(result.customer);
```

@@ -118,3 +118,3 @@

// A list of Subscription objects
console.log(result.response.list.map((obj) => obj.subscription));
console.log(result.list.map((obj) => obj.subscription));
```

@@ -128,5 +128,5 @@

// ['list', 'next_offset']
console.log(Object.keys(result.response));
console.log(Object.keys(result));
// ['1', '2', '3'], e.g. `result.list` is an array with 3 entries
console.log(Object.keys(result.response.list));
console.log(Object.keys(result.list));
// ['activated_at', 'base_currency_code', ...]

@@ -136,3 +136,3 @@ // ['activated_at', 'base_currency_code', ...]

// Which means we've reached the bottom and should have all the information available from this request
console.log(result.response.list.map((obj) => obj.subscription));
console.log(result.list.map((obj) => obj.subscription));
```

@@ -153,4 +153,4 @@

return {
customers: result.response.list.map((obj) => obj.customer),
next_offset: result.response.next_offset,
customers: result.list.map((obj) => obj.customer),
next_offset: result.next_offset,
};

@@ -184,3 +184,3 @@ };

const customer = result.response.customer;
const customer = result.customer;
console.log(customer.cf_host_url);

@@ -198,9 +198,5 @@ ```

.request();
const customer = result.response.customer;
console.log(result.headers); // Retrieves response headers
console.log(result.isIdempotencyReplayed); // Retrieves idempotency replayed header
const customer = result.customer;
```
`isIdempotencyReplayed()` method can be accessed to differentiate between original and replayed requests.
### Processing Webhooks - API Version Check

@@ -207,0 +203,0 @@

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc