Skip to content

Commit d5d0407

Browse files
committed
allow specifing any Braintree options
Implements #37
1 parent f410b21 commit d5d0407

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

demo/demo-class.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class Demo extends React.PureComponent {
109109
Month:
110110
<HostedField type="expirationMonth" />
111111
Year:
112-
<HostedField type="expirationYear" />
112+
<HostedField type="expirationYear" options={{ maskInput: { character: 'X' } }} />
113113
CVV:
114114
<HostedField type="cvv" placeholder="CVV" ref={cvvField => { this.cvvField = cvvField; }} />
115115
Zip:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"scripts": {
1616
"test": "jest",
1717
"build": "./script/build",
18-
"demo": "$(npm bin)/webpack-dev-server",
18+
"demo": "$(npm bin)/webpack serve",
1919
"ci": "./script/cibuild",
2020
"preversion": "./script/preversion"
2121
},

src/api.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,9 @@ export default class BraintreeClientApi {
106106
select,
107107
type,
108108
prefill,
109-
id = `braintree-field-wrapper-${this.nextFieldId()}`,
110109
rejectUnsupportedCards,
110+
id = `braintree-field-wrapper-${this.nextFieldId()}`,
111+
options = {},
111112
...handlers
112113
}) {
113114
const onRenderComplete = () => {
@@ -120,6 +121,7 @@ export default class BraintreeClientApi {
120121
select,
121122
prefill,
122123
selector: `#${id}`,
124+
...options,
123125
}
124126
if (('number' === type) && rejectUnsupportedCards) {
125127
this.fields.number.rejectUnsupportedCards = true

0 commit comments

Comments
 (0)