Skip to content
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

same as #23 but i don't understand what should i do #34

Open
frederic117 opened this issue Mar 31, 2018 · 3 comments
Open

same as #23 but i don't understand what should i do #34

frederic117 opened this issue Mar 31, 2018 · 3 comments

Comments

@frederic117
Copy link

frederic117 commented Mar 31, 2018

please help :)
i use NUXT

TypeError: document.querySelector(...).parentElement.submit is not a function
at VueComponent. (StripeCheckout.vue:165)
at Array. (vue.js:661)
at nextTickHandler (vue.js:608)
at
handleError @ vue.js:529
(anonymous) @ vue.js:663
nextTickHandler @ vue.js:608

My template:

 <div class="message-body contentAdd">
                    <form action="/process-payment" method="POST">
                        <div class="field loggiin">
                            <b-radio v-model="productId" native-value=1>
                                 <strong>5 €</strong>
                            </b-radio>
                            <br><br>
                            <b-radio v-model="productId" native-value=2>
                              <strong>10 €</strong>
                            </b-radio><br>
                            <br>
                            <b-radio v-model="productId" native-value=3>
                               <strong>15 €</strong>
                            </b-radio>
                        </div><br>
                        <div class="loggiin3">
                            <stripe-checkout
                                :buttonClass="buttonClass"
                                :button="button"
                                stripe-key="µµµ************µµµ"
                                :products="products"
                                :product-id="productId"
                                :options="options"
                                formId="vue-stripe"	
                                >
                            </stripe-checkout>
                        </div>
                    </form>
                </div>
@i-m-Shahbaj
Copy link

I'm also facing the same issue and still dont know what to do.

@JonasMunck
Copy link

I also use nuxt and this solution worked for me:

One way of avoiding the TypeError: document.querySelector(...).parentElement.submit is not a function-problem is to configure vue-stripe to use the on-success="broadcast" option to handle the submission yourself (with the good side-effect that you avoid the document.querySelector('#'+this.formId).parentElement.submit() call to be executed)

The code that explains why it works: https://github.com/matfish2/vue-stripe/blob/master/src/StripeCheckout.vue#L168-L176

@raul93611
Copy link

I also was having the same issue and this issue is really easy to solve.
parentElement is looking for the immediate parent of stripe-checkout in your case you have a div, that's why the error is displayed, because submit function cannot work with a div so the easy way to solve that is deleting that div or setting your stripe-checkout inside the form immediately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants