react-braintree-fields
Advanced tools
Comparing version 0.7.0 to 0.7.1
@@ -123,6 +123,3 @@ (function (global, factory) { | ||
} else { | ||
_this.clientInstance = clientInstance; | ||
if (_this.isAttachable) { | ||
_this.attach(); | ||
} | ||
_this.create(clientInstance); | ||
} | ||
@@ -149,18 +146,15 @@ }); | ||
}, { | ||
key: 'attach', | ||
value: function attach() { | ||
if (this.isAttachable) { | ||
this.create(); | ||
} | ||
} | ||
}, { | ||
key: 'create', | ||
value: function create() { | ||
value: function create(client) { | ||
var _this2 = this; | ||
return HostedFields.create({ | ||
client: this.clientInstance, | ||
HostedFields.create({ | ||
client: client, | ||
styles: this.styles, | ||
fields: this.fields | ||
}, function (err, hostedFields) { | ||
if (err) { | ||
_this2.onError(err); | ||
return; | ||
} | ||
_this2.hostedFields = hostedFields; | ||
@@ -185,5 +179,9 @@ ['blur', 'focus', 'empty', 'notEmpty', 'cardTypeChange', 'validityChange'].forEach(function (eventName) { | ||
value: function checkInField(_ref2) { | ||
var type = _ref2.type, | ||
var formatInput = _ref2.formatInput, | ||
maxlength = _ref2.maxlength, | ||
minlength = _ref2.minlength, | ||
placeholder = _ref2.placeholder, | ||
handlers = objectWithoutProperties(_ref2, ['type', 'placeholder']); | ||
select = _ref2.select, | ||
type = _ref2.type, | ||
handlers = objectWithoutProperties(_ref2, ['formatInput', 'maxlength', 'minlength', 'placeholder', 'select', 'type']); | ||
@@ -193,4 +191,8 @@ var id = 'field-wrapper-' + this.nextFieldId(); | ||
this.fields[type] = { | ||
selector: '#' + id, | ||
placeholder: placeholder | ||
formatInput: formatInput, | ||
maxlength: maxlength, | ||
minlength: minlength, | ||
placeholder: placeholder, | ||
select: select, | ||
selector: '#' + id | ||
}; | ||
@@ -260,3 +262,2 @@ return id; | ||
value: function componentDidMount() { | ||
this.api.isAttachable = true; | ||
this.api.setAuthorization(this.props.authorization); | ||
@@ -308,3 +309,3 @@ if (this.props.getTokenRef) { | ||
children: PropTypes.node.isRequired, | ||
authorization: PropTypes.string.isRequired, | ||
authorization: PropTypes.string, | ||
getTokenRef: PropTypes.func, | ||
@@ -311,0 +312,0 @@ onValidityChange: PropTypes.func, |
@@ -117,6 +117,3 @@ import React from 'react'; | ||
} else { | ||
_this.clientInstance = clientInstance; | ||
if (_this.isAttachable) { | ||
_this.attach(); | ||
} | ||
_this.create(clientInstance); | ||
} | ||
@@ -143,18 +140,15 @@ }); | ||
}, { | ||
key: 'attach', | ||
value: function attach() { | ||
if (this.isAttachable) { | ||
this.create(); | ||
} | ||
} | ||
}, { | ||
key: 'create', | ||
value: function create() { | ||
value: function create(client) { | ||
var _this2 = this; | ||
return HostedFields.create({ | ||
client: this.clientInstance, | ||
HostedFields.create({ | ||
client: client, | ||
styles: this.styles, | ||
fields: this.fields | ||
}, function (err, hostedFields) { | ||
if (err) { | ||
_this2.onError(err); | ||
return; | ||
} | ||
_this2.hostedFields = hostedFields; | ||
@@ -179,5 +173,9 @@ ['blur', 'focus', 'empty', 'notEmpty', 'cardTypeChange', 'validityChange'].forEach(function (eventName) { | ||
value: function checkInField(_ref2) { | ||
var type = _ref2.type, | ||
var formatInput = _ref2.formatInput, | ||
maxlength = _ref2.maxlength, | ||
minlength = _ref2.minlength, | ||
placeholder = _ref2.placeholder, | ||
handlers = objectWithoutProperties(_ref2, ['type', 'placeholder']); | ||
select = _ref2.select, | ||
type = _ref2.type, | ||
handlers = objectWithoutProperties(_ref2, ['formatInput', 'maxlength', 'minlength', 'placeholder', 'select', 'type']); | ||
@@ -187,4 +185,8 @@ var id = 'field-wrapper-' + this.nextFieldId(); | ||
this.fields[type] = { | ||
selector: '#' + id, | ||
placeholder: placeholder | ||
formatInput: formatInput, | ||
maxlength: maxlength, | ||
minlength: minlength, | ||
placeholder: placeholder, | ||
select: select, | ||
selector: '#' + id | ||
}; | ||
@@ -254,3 +256,2 @@ return id; | ||
value: function componentDidMount() { | ||
this.api.isAttachable = true; | ||
this.api.setAuthorization(this.props.authorization); | ||
@@ -302,3 +303,3 @@ if (this.props.getTokenRef) { | ||
children: PropTypes.node.isRequired, | ||
authorization: PropTypes.string.isRequired, | ||
authorization: PropTypes.string, | ||
getTokenRef: PropTypes.func, | ||
@@ -305,0 +306,0 @@ onValidityChange: PropTypes.func, |
{ | ||
"name": "react-braintree-fields", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "React component for braintree hosted fields", | ||
@@ -5,0 +5,0 @@ "main": "dist/build.full.js", |
@@ -5,6 +5,2 @@ import babel from 'rollup-plugin-babel'; | ||
const external = Object.keys(pkg.dependencies).concat( | ||
['react', 'prop-types', 'braintree-web/client', 'braintree-web/hosted-fields'], | ||
); | ||
export default { | ||
@@ -31,3 +27,3 @@ entry: 'src/index.js', | ||
}, | ||
external, | ||
external: ['react', 'prop-types', 'braintree-web/client', 'braintree-web/hosted-fields'], | ||
targets: [ | ||
@@ -34,0 +30,0 @@ { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2247868
30
25056