Skip to content

Commit

Permalink
Fix Stripe element options
Browse files Browse the repository at this point in the history
  • Loading branch information
lindyhopchris committed Aug 10, 2019
1 parent aab8c7b commit eb5d4d2
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions addon/components/stripe-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ export default Component.extend({
stripeError: null,
type: null, // Set in components that extend from `stripe-element`

init() {
this._super(...arguments);
set(this, 'options', {});
},

stripev3: service(),
elements: computed(function() {
return get(this, 'stripev3.elements')();
Expand All @@ -25,7 +20,7 @@ export default Component.extend({
this._super(...arguments);

// Fetch user options
let options = get(this, 'options');
let options = get(this, 'options') || {};

// Fetch `type` set by child component
let type = get(this, 'type');
Expand Down Expand Up @@ -58,7 +53,8 @@ export default Component.extend({

didUpdateAttrs() {
this._super(...arguments);
get(this, 'stripeElement').update(get(this, 'options'));
let options = get(this, 'options') || {};
get(this, 'stripeElement').update(options);
},

willDestroyElement() {
Expand Down

0 comments on commit eb5d4d2

Please sign in to comment.