Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

0.4.2

  • Loading branch information...
commit 89776ea474cae27b3ee1240c164a05b4ba3d2c7f 1 parent 463ab05
Braintree Open Source braintreeps authored
4 Rakefile
View
@@ -3,6 +3,6 @@ task :default => :spec
desc "run the specs"
task :spec do
local_vows = "./node_modules/.bin/vows"
- vows = File.exist?(local_vows) ? local_vows : "vows"
- sh "#{vows} " + Dir.glob("spec/**/*_spec.js").join(" ")
+ sh "npm install" unless File.exist?(local_vows)
+ sh "#{local_vows} " + Dir.glob("spec/**/*_spec.js").join(" ")
end
2  lib/braintree.coffee
View
@@ -8,6 +8,6 @@ connect = (config) ->
new BraintreeGateway(new Config(config))
exports.connect = connect
-exports.version = '0.4.1'
+exports.version = '0.4.2'
exports.Environment = Environment
exports.errorTypes = errorTypes
2  lib/braintree/http.coffee
View
@@ -53,7 +53,7 @@ class Http
if body
requestBody = JSON.stringify(Util.convertObjectKeysToUnderscores(body))
- options.headers['Content-Length'] = requestBody.length.toString()
+ options.headers['Content-Length'] = Buffer.byteLength(requestBody).toString()
theRequest = client.request(options, (response) =>
body = ''
2  package.json
View
@@ -1,6 +1,6 @@
{
"name" : "braintree",
- "version" : "0.4.1",
+ "version" : "0.4.2",
"description" : "A library for integrating with Braintree.",
"keywords" : ["payments"],
"homepage" : "http://github.com/braintree/braintree_node",
7 spec/braintree/braintree_spec.js
View
@@ -3,13 +3,6 @@ require('../spec_helper');
var braintree = specHelper.braintree;
vows.describe('Braintree').addBatch({
- 'version': {
- topic: braintree.version,
- 'is 0.4.1': function (version) {
- assert.equal(version, '0.4.1');
- }
- },
-
'AuthenticationError': {
'for invalid credentials': {
topic: function () {
15 spec/braintree/customer_gateway_spec.js
View
@@ -20,6 +20,21 @@ vows.describe('CustomerGateway').addBatch({
}
},
+ 'for a minimal case with two-byte characters': {
+ topic: function () {
+ specHelper.defaultGateway.customer.create({
+ firstName: 'Jöhn',
+ lastName: 'Smith'
+ }, this.callback);
+ },
+ 'does not have an error': function (err, response) { assert.isNull(err); },
+ 'is succesful': function (err, response) { assert.equal(response.success, true); },
+ 'has customer attributes': function (err, response) {
+ assert.equal(response.customer.firstName, 'Jöhn');
+ assert.equal(response.customer.lastName, 'Smith');
+ }
+ },
+
'a blank customer': {
topic: function () {
specHelper.defaultGateway.customer.create({}, this.callback);
Please sign in to comment.
Something went wrong with that request. Please try again.