Events Made Easy › Forums › How do I … › Embed Stripe Payment Checkout
- This topic has 19 replies, 2 voices, and was last updated 3 years, 1 month ago by Anonymous.
-
AuthorPosts
-
Thu 4 Nov 2021 at 18:46 #63376AnonymousInactive
My site HERE is a class reunion website and Im using this plugin in conjunction with my registered Stripe account using the keys/api keys accordingly. Is it possible using your plugin to redirect the user to an embedded checkout screen on my page WITHOUT just providing a link/button so they can not only RSVP but pay for the ticket to the reunion right on my page instead of having to RSVP only then having to click a link to get a ticket?
Apologize in advance if this was asked already, just doing a preliminary search I didn’t notice if the same request was asked already and will delete this new topic if it has already been resolved. Thanks.
Thu 4 Nov 2021 at 19:55 #63377FrankyKeymasterSorry, it is a form submit because of the possibility to have several gateways. However, see the EME FAQ page on this website, look for “How to redirect automatically to paypal after successful booking”.
I’ll see in the future if I can do this automatically if only 1 gateway exists.Thu 4 Nov 2021 at 22:01 #63379AnonymousInactiveThanks
Thu 4 Nov 2021 at 22:21 #63383AnonymousInactiveI understand. I’m not using any special or third-party gateway but having Stripe, like Paypal, as the online processor for this event as I did back in 2017.
Thu 4 Nov 2021 at 22:26 #63387AnonymousInactiveI would be very interested if you were to implement that feature, as I think having an embedded option would be complimentary to the RSVP UI.
Thu 4 Nov 2021 at 22:28 #63389AnonymousInactiveCurrently, my RSVP page HERE, is setup correctly and after the user enters their name and other information as well as the reCaptcha, and click the “SEND YOUR BOOOKING” button, I set the redirect for 4 seconds as it says “Your booking has been recorded You will be redirected to the payment page in a few seconds, or click here to go there immediately”. All that works perfectly.
Thu 4 Nov 2021 at 22:29 #63390AnonymousInactiveBut then it redirects to nothing more than the Stripe button the user then has to click on to get to the checkout page HERE.
That redirect seems redundant only to have a button then you have to click to get to the checkout page as a second leg to get to the purchase. It would seem much more intuitive to have the site admin/webmaster who’s able to set the url to where or what the redirect goes to as is the option to set the href link to the button if it doesn’t redirect like it should as a fallback.
While I understand the limitations to embed a gateway to the RSVP, I’d have to think if most are like me, don’t need and are not using other features like reoccuring payment, subscriptions, or other customizations but simply using Stripe, or even Paypal as a complete solution that combines the functionality of a merchant account and a gateway in one.
Thu 4 Nov 2021 at 22:29 #63391AnonymousInactiveSince you cannot use existing merchant accounts or gateways with Stripe, as it functions as both already, and if the user selects Stripe, it would only make sense to have an option to embed or the very minimum have the option to provide our own redirect to what merchant/checkout we want within whatever preselected processor we choose. Paypal, for example, I know offers a little more in the way of options but works similar.
In the meantime Ill make sure to check out the FAQ you mentioned while I await your reply about setting the Stripe checkout url as my redirect. Thanks!
Thu 4 Nov 2021 at 22:51 #63392AnonymousInactiveStupid question, the FAQ found HERE, as you referenced, highlights code to use as seen below
<script type="text/javascript"> jQuery(document).ready( function($) { $( "#paypal_form" ).submit(); }); </script>
” you can redirect to another gateway too, just replace “#paypal_form” by e.g. “#mollie_form” (for redirecting to Mollie), see the generated html to find the correct form name of the relevant gateway.” I can’t find the generated html for Stripe. What would that code be?
Thu 4 Nov 2021 at 23:03 #63394FrankyKeymasterreplace #paypal_form by #eme_stripe_form, that should do it (for paypal it is also #eme_paypal_form, I’ve corrected the faq)
Thu 4 Nov 2021 at 23:17 #63397AnonymousInactiveThanks, like I said stupid question. I just didn’t pay attention and look close enough. I apprecaite it.
Thu 4 Nov 2021 at 23:19 #63398AnonymousInactiveSo I added the below code as instructed to the RSVP Payment form header format, and after I cleared out server and browser cache, I entered the information on the RSVP form and entered the correct reCaptcha data, it still redirected me to the same url HERE that has the button PAY VIA STRIPE.
<code><script type="text/javascript"> jQuery(document).ready( function($) { $( "#eme_stripe_form" ).submit(); }); </script></code>
Thu 4 Nov 2021 at 23:25 #63399FrankyKeymasterRemove “code” and also the br-tags you added. Both are not allowed in your javascript …
Thu 4 Nov 2021 at 23:48 #63401AnonymousInactiveHere is a screenshot. I just took the raw code and still not working after clearing the cache. I apologize for not being well-versed enough in coding to having this work right. I didn’t notice any br tags. Ive greatly appreciated and continue to very much appreciate your help.
Fri 5 Nov 2021 at 00:00 #63402FrankyKeymasterI was testing it here too, and due to some previous change the br-tags are being added which shouldn’t be for javascript of course. I’ll correct that.
Fri 5 Nov 2021 at 00:05 #63403FrankyKeymasterThis fixes it:
https://plugins.trac.wordpress.org/changeset/2624861/But for an easy fix: put all your javascript on 1 line and it will work fine too:
<script type="text/javascript">jQuery(document).ready( function($) {$( "#eme_stripe_form" ).submit();});</script>
Fri 5 Nov 2021 at 00:47 #63404AnonymousInactivePerfect! There’s a little lag and the screen with the PAY VIA STRIPE is there for a second then it goes to the Stripe checkout screen. I can live with that. Thanks for everything!
Fri 5 Nov 2021 at 10:51 #63405FrankyKeymasterThe fact that there is a delay is because first EME makes a Stripe payment (that is the first part of the form submit) and then the user gets redirected to confirm that payment (second step).
If there’s only 1 payment, I could try to shortcut that step a bit, but it will take quite some coding because not all payment gateways behave the same way.Fri 5 Nov 2021 at 13:48 #63406FrankyKeymasterThe next version will have an option for immediate redirect to the payment gateway. This is the explanation for that new setting:
By default, people get a list of payment gateways to choose from before being redirected to the payment gateway of choice. Select yes to immediately redirect to the payment gateway if there is only one payment gateway to chose from. This redirect takes also the setting “Redirect wait period” into account. The text above the payment button of the relevant payment gateway will then also be shown.
Fri 5 Nov 2021 at 14:06 #63407AnonymousInactiveExcellent! I look forward to it and thanks again!
-
AuthorPosts
- The forum ‘How do I …’ is closed to new topics and replies.