chargebee
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -0,1 +1,28 @@ | ||
### v1.2.2 (2015-06-12) | ||
* * * | ||
** APIs added**: | ||
New api endpoints to Add, Deduct & Set the account credit for a customer is added. See the APIs below - https://apidocs.chargebee.com/docs/api/customers#add_account_credits_to_a_customer | ||
https://apidocs.chargebee.com/docs/api/customers#deduct_account_credits_for_a_customer | ||
https://apidocs.chargebee.com/docs/api/customers#set_account_credits_for_a_customer | ||
** APIs updated**: | ||
Now, event "invoice_updated" can be fetched via API. See : https://apidocs.chargebee.com/docs/api/events#event_types. | ||
A new webkook status "skipped" is returned as part of "webhook_status" attribute of event resource. See : https://apidocs.chargebee.com/docs/api/events#event_attributes | ||
The resource attribute for "account_credits" is returned as part of Customer resource. See : https://apidocs.chargebee.com/docs/api/customers#customer_attributes | ||
A new discount type "account_credits" is returned as part of "discounts" sub-resource of Invoice resource. See : https://apidocs.chargebee.com/docs/api/events#event_attributes | ||
** APIs deprecated**: | ||
Support for "offer_quantity" in "discount_type" attribute deprecated for Create method of Coupon API. | ||
Support for "specified_items_total" & "each_unit_of_specified_items" in "apply_on" attribute deprecated for Create method of Coupon API. | ||
The attribute "discount_quantity" deprecated for Create method of Coupon API. | ||
### v1.2.1 (2015-05-02) | ||
@@ -2,0 +29,0 @@ * * * |
@@ -8,3 +8,3 @@ var ChargeBee = {}; | ||
timeout: 40000, | ||
clientVersion: 'v1.2.1', | ||
clientVersion: 'v1.2.2', | ||
port: 443 | ||
@@ -27,2 +27,3 @@ }; | ||
this.args = args; | ||
this.httpHeaders = {}; | ||
this.apiCall = apiCall; | ||
@@ -34,2 +35,7 @@ if (this.apiCall.hasIdInUrl) { | ||
RequestWrapper.prototype.headers = function(headers) { | ||
this.httpHeaders = headers; | ||
return this; | ||
}; | ||
RequestWrapper.prototype.request = function(callBack, envOptions) { | ||
@@ -46,3 +52,3 @@ var env = {}; | ||
} | ||
return ChargeBee._core.makeApiRequest(env, callBack, this.apiCall.httpMethod, this.apiCall.urlPrefix, this.apiCall.urlSuffix, urlIdParam, params); | ||
return ChargeBee._core.makeApiRequest(env, callBack, this.apiCall.httpMethod, this.apiCall.urlPrefix, this.apiCall.urlSuffix, urlIdParam, params, this.httpHeaders); | ||
}; | ||
@@ -103,3 +109,3 @@ | ||
coreRef.makeApiRequest = function(env, callBack, httpMethod, urlPrefix, urlSuffix, urlIdParam, params) { | ||
coreRef.makeApiRequest = function(env, callBack, httpMethod, urlPrefix, urlSuffix, urlIdParam, params, headers) { | ||
var path = getApiURL(env, urlPrefix, urlSuffix, urlIdParam); | ||
@@ -115,2 +121,10 @@ if (typeof params === 'undefined' || params === null) { | ||
var protocol = (env.protocol === 'http' ? http : https); | ||
ChargeBee._util.extend(true, headers, { | ||
'Authorization': 'Basic ' + new Buffer(env.api_key + ':').toString('base64'), | ||
'Accept': 'application/json', | ||
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', | ||
"Content-Length": data.length, | ||
'User-Agent': "Chargebee-NodeJs-Client " + env.clientVersion | ||
}); | ||
var req = protocol.request({ | ||
@@ -121,9 +135,3 @@ "hostname": getHost(env), | ||
"port": env.port, | ||
"headers": { | ||
'Authorization': 'Basic ' + new Buffer(env.api_key + ':').toString('base64'), | ||
'Accept': 'application/json', | ||
'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8', | ||
"Content-Length": data.length, | ||
'User-Agent': "Chargebee-NodeJs-Client " + env.clientVersion | ||
} | ||
"headers": headers | ||
}); | ||
@@ -308,7 +316,7 @@ req.setTimeout(env.timeout, coreRef.timeoutHandler(req, callBack)); | ||
var metaArr = apiCalls[apiIdx]; | ||
var apiCall = {"methodName":metaArr[0], | ||
"httpMethod":metaArr[1], | ||
"urlPrefix" :metaArr[2], | ||
"urlSuffix" :metaArr[3], | ||
"hasIdInUrl":metaArr[4]}; | ||
var apiCall = {"methodName": metaArr[0], | ||
"httpMethod": metaArr[1], | ||
"urlPrefix": metaArr[2], | ||
"urlSuffix": metaArr[3], | ||
"hasIdInUrl": metaArr[4]}; | ||
module.exports[res][apiCall.methodName] = createApiFunc(apiCall); | ||
@@ -315,0 +323,0 @@ } |
@@ -144,2 +144,23 @@ var _endpoints = { | ||
true | ||
], | ||
[ | ||
"add_account_credits", | ||
"POST", | ||
"/customers", | ||
"/add_account_credits", | ||
true | ||
], | ||
[ | ||
"deduct_account_credits", | ||
"POST", | ||
"/customers", | ||
"/deduct_account_credits", | ||
true | ||
], | ||
[ | ||
"set_account_credits", | ||
"POST", | ||
"/customers", | ||
"/set_account_credits", | ||
true | ||
] | ||
@@ -146,0 +167,0 @@ ], |
{ | ||
"name" : "chargebee", | ||
"version" : "1.2.1", | ||
"version" : "1.2.2", | ||
"description" : "A library for integrating with ChargeBee.", | ||
@@ -5,0 +5,0 @@ "keywords" : ["payments","billing","subscription","chargebee"], |
34178
929