-
Notifications
You must be signed in to change notification settings - Fork 160
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
Add source callback #119
base: master
Are you sure you want to change the base?
Add source callback #119
Conversation
I'm trying to test out your PR however its not working for me unless I pass both a source handler and a token handler. If I use only the token handler, it passes a token as expected to the back end.
If I pass both a token handler and a source handler it gives this error on form load:
But then calls the source handler with all of the correct details after the charge. Note that I am not the maintainer, but I am looking forward to this support. Thanks for your additions here. |
@methyl any ideas here? |
@fantapop I will be updating this PR this or the next week, I know the fix already and will make sure to fix it here as well |
@methyl have you had an time to look at this? |
@fantapop since I had some other issues with this lib, I just went with lazy approach and pulled it directly into my source repo. The problem is that StripeCheckout API is broken and won't allow you to pass the updateStripeHandler(prevSource) {
if (!this.stripeHandler || this.props.source !== prevSource) {
this.stripeHandler = StripeCheckout.configure({
source: this.props.source,
key: this.props.stripeKey,
})
}
}
onScriptLoaded = () => {
if (!this.stripeHandler) {
this.stripeHandler = StripeCheckout.configure({
key: this.props.stripeKey,
source: this.props.source,
})
if (this.hasPendingClick) {
this.showStripeDialog()
}
}
} |
Thanks. I’ll give it a try.
…On Fri, Oct 5, 2018 at 2:35 AM Lucjan Suski ***@***.***> wrote:
@fantapop <https://github.com/fantapop> since I had some other issues
with this lib, I just went with lazy approach and pulled it directly into
my source repo. The problem is that StripeCheckout API is broken and won't
allow you to pass the source callback to the open method as allows to do
with the token. The solution is to pass to StripeCheckout.configure(), if
you do that it will recognize the callback correctly and your error will be
gone.
updateStripeHandler(prevSource) {
if (!this.stripeHandler || this.props.source !== prevSource) {
this.stripeHandler = StripeCheckout.configure({
source: this.props.source,
key: this.props.stripeKey,
})
}
}
onScriptLoaded = () => {
if (!this.stripeHandler) {
this.stripeHandler = StripeCheckout.configure({
key: this.props.stripeKey,
source: this.props.source,
})
if (this.hasPendingClick) {
this.showStripeDialog()
}
}
}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#119 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGWbqFVp7Yo5by6CutOckqKBsq6OF_Blks5uhyfLgaJpZM4WlfVQ>
.
|
Any progress on this? |
Checkout.js now supports source callback: https://stripe.com/docs/checkout#required