Stripe Elements
ProEvents Manager Pro - StripeRequires Events Manager Pro. Compare plans
Stripe Elements puts Stripe's payment form inside your booking form. The customer fills in the booking, enters their card (or picks another method your Stripe account offers) and pays without leaving the page.
If you would like Stripe to host the payment page and show an itemized order, use Stripe Checkout. The Stripe page compares the two.
- Events Manager Pro 3.2.7 or later and the Events Manager Pro - Stripe plugin, both activated. This page describes Stripe add-on 2.6.0.
- A Stripe account, and access to its API keys and webhooks.
- Your site served over HTTPS. Without it the gateway is not offered on booking forms.
Set up Stripe Elements
Stripe Elements has its own keys and its own webhook, separate from Stripe Checkout, even when both use the same Stripe account. Set it up in test mode first.
-
Go to Events then Payment Gateways and click Stripe Elements. A new gateway starts in test mode.
-
In your Stripe Dashboard, in test mode, copy your publishable key and secret key. Stripe documents where they are in API keys.
-
In WordPress, open the [Test] API Keys/Notifications tab, paste them into Secret API Key and Publishable API Key, and click Save Changes.
Stripe Elements keeps its own keys and its own webhook address.
-
Create the webhook, described below.
-
Go back to Events then Payment Gateways and click Activate under Stripe Elements.
-
Book a priced event and pay with one of Stripe's test cards. The booking form should show the thank you message, and the booking should be Approved with a Completed transaction.
-
To go live, repeat steps 2 to 4 on the [Live] API Keys/Notifications tab with your live keys and a live webhook, then click Enable Live Mode in the banner above the tabs.
A test key pasted into the Live tab is not used: the gateway treats itself as being in test mode and reads the Test tab.
Create the webhook
The customer's browser confirms the payment with Stripe, and the webhook is what tells your site about it reliably, along with later refunds and disputes. Events Manager doesn't create the webhook for you.
-
On the API tab you are setting up, under Payment Notifications, copy the address after Your Webhooks Endpoint url is:
https://example.com/wp-json/events-manager/v1/gateways/stripe_elements/notify_testThe live address ends in
/notify. -
In Stripe, add a webhook endpoint with that address, in the matching mode. Stripe's guide is Receive Stripe events in your webhook endpoint.
-
Select these four events:
Event What Events Manager does with it payment_intent.succeededRecords the payment and approves the booking. charge.refundedRecords each refund against the booking. charge.refund.updatedNotices a refund that later fails or is canceled. charge.dispute.createdRecords a dispute against the booking. -
Reveal the endpoint's signing secret in Stripe, paste it into Webhook Signing Secret on the same tab, and click Save Changes.
The first event is the one that differs from Stripe Checkout's list, which uses checkout.session.completed. If you run both gateways, create one endpoint for each.
Settings
The General Options tab has Gateway Title (default Pay with Stripe Elements), Booking Form Information, Return URL, Thank You Message, Unpaid Bookings Expiry, Expired Booking Action and Manually approve completed transactions?. They work as described for Stripe Checkout. Elements has no quick pay button and no cancel settings, because the customer never leaves your page.
On the Gateway Options tab, Send E-mail Receipt? (default Yes) asks Stripe to email a receipt for every payment. Include Taxes In Itemized Prices is shown here too but has no effect on this gateway, which charges the booking total as one amount.
What the customer sees
When the customer chooses this payment method, Stripe's Payment Element appears in the booking form. It offers cards and whichever other methods are enabled in your Stripe account, such as wallets. When they submit the form, the booking is saved and the payment is confirmed in the same step. If their bank asks for 3D Secure, Stripe shows the challenge and continues afterwards. Methods that send the customer to their bank's site bring them back to your page when they finish.
The Stripe script is loaded on every front-end page while a Stripe gateway is active.
Declined cards and unpaid bookings
- The card is declined. Stripe's error message is shown in the form, the booking that was being made is discarded, and the customer can correct the card and submit again. In Multiple Bookings Mode their cart is kept.
- The payment is still processing or waiting for 3D Secure. The booking stays at Awaiting Online Payment until Stripe reports the result.
- The customer leaves partway. When the Unpaid Bookings Expiry runs out, Events Manager asks Stripe whether the payment went through. A paid booking is approved. An unpaid one has its payment canceled at Stripe and the Expired Booking Action applied.
Stripe Elements adds no button to My Bookings for unpaid bookings. Switch on the payment page to give customers a Pay now link.
Refunds and disputes
These work exactly as they do for Stripe Checkout: refund from your Stripe Dashboard, a full refund cancels the booking, a partial refund sets it to Pending, and a dispute is recorded as a Disputed transaction. See Refunds and Disputes.
Troubleshooting
The card form does not appear
Check that the page is loaded over https://, that the gateway is Active, and that the Publishable API Key for the current mode is saved. A key from the other mode leaves the form empty.
On the payment page the customer sees "The card form could not be loaded, please reload the page and try again."
The payment could not be prepared with Stripe for that booking. Check the Secret API Key for the mode the booking was made in, then ask the customer to reload the page.
Payments succeed in Stripe but bookings stay at Awaiting Online Payment
Check the webhook: the address must be the Stripe Elements one, payment_intent.succeeded must be selected, and the Webhook Signing Secret must belong to that endpoint.