Skip to content

Commit

Permalink
Added complete action
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanvanderbyl committed Aug 22, 2017
1 parent 468c25b commit ad41d55
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion addon/components/stripe-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,13 @@ export default Component.extend({
stripeElement.on('blur', (event) => this.sendAction('blur', stripeElement, event));
stripeElement.on('focus', (event) => this.sendAction('focus', stripeElement, event));
stripeElement.on('change', (...args) => {
let { error } = args[0];
let { error, complete } = args[0];
set(this, 'error', error);
this.sendAction('change', stripeElement, ...args);

if (complete === true) {
this.sendAction('complete', stripeElement);
}
});
}
});

0 comments on commit ad41d55

Please sign in to comment.