-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added stripe element and event to actions #8
Added stripe element and event to actions #8
Conversation
addon/components/stripe-element.js
Outdated
|
||
if (complete === true) { | ||
this.sendAction('complete', stripeElement); | ||
}else if(error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} else if (error) {
Also, is it really complete || error
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah maybe it should just be the default action
? Also, do you have an aversion to prefixing event based actions with on-
?
@ivanvanderbyl thanks for this PR! Overall this solves some of the design issues with the blocked usage. A few things I would love to see here:
Although not relevant to the PR specifically, I also noticed we should probably have:
|
I started in #7 getting coverage working, so it might be nice to wrap that up first if we can discuss some testing ideas (being that the |
Cool, yep I'll update the readme and address those other points once I get this feature shipped in our app. With the block usage, the main hurdle design wise is lacking any way to specify where the Stripe Element is placed. Maybe we could yield a sub-component which just renders the placeholder div where it's needed, but then maybe that isn't a design concern for this addon. Wouldn't want to complicate it unnecessarily. |
Testing the iframe could be tricky, but i have seen something which did this before, I think it was outside of the ember landscape though. |
@ivanvanderbyl awesome to hear! Are you in the Ember slack? Or you could join ours http://slack.codecorps.org |
Hey @ivanvanderbyl just wanted to check in on this with you. |
Hi @ivanvanderbyl I would still love to see about this getting in. Have you had any time to spend on this? |
Ping. |
e707814
to
aa9d88b
Compare
c261ece
to
77c21a4
Compare
- Schedule running Elements setup after insert to avoid rerender loop - Add yarn.lock - Include Stripe Element and event in actions - Add complete action and send error - Add eslint - Fix eslint errors and remove phantomjs - Update travis.yml - Update ember-try - Add testem args for chrome
36bdfd1
to
5e9478b
Compare
Opened #17 as a follow-up to this since I'd like to get this merged. Thanks again for the PR @ivanvanderbyl! 🙌 |
This PR adds support for sending the
stripeElement
and event object as arguments to the event handlers, as well as adding new actions:error
which fires only when the change event fires and the card is invalid. This can be used in a similar way tocomplete
for more complex error state handling, like disabling a form submit or show error messages outside the block.complete
which only fires once the card input is complete. This allows for sending the stripeElement up to another form object or controller to handle complex nested payment forms. For example: