1. Home
  2. Docs
  3. LearnDash Core
  4. Settings
  5. Stripe Connect

Stripe Connect

The Stripe Connect integration is one of the simplest ways to start selling your LearnDash courses. Stripe is also one of the easiest payment gateways to set up, and their processing fees are on par with most other gateways.

NOTE
If you don’t already have a Stripe account, you can set one up during the connection process. Stripe is not available in all countries. View available countries »

Who Should Use Stripe Connect?

You should consider using the Stripe Connect integration if:

✅ You want to easily start accepting secure credit card payments on your site for LearnDash content

✅ You don’t want to spend time creating an entire checkout experience for your users

Connect Your Stripe Account

  1. Navigate to LEARNDASH LMS > Settings
  2. Click on the Payments Tab
  3. Click the Stripe Connect link
  4. Click on Connect Stripe
  5. You will be redirected to Stripe’s page to sign in to your Stripe Account or create a new account.
  6. After you are returned back to your WP admin dashboard, you should see a box with further instructions on how to configure the webhook in the Stripe dashboard.

Stripe Settings

Even with Stripe Connect, there are still a few settings that you need to fill out in order for this integration to work correctly.

Test Mode / Live Mode

There are two ways you can set up the LearnDash Stripe integration: test mode or live mode.

  • Test mode should be used when you’re still testing your site internally. No money will actually change hands, but Stripe will record if the transaction succeeded or failed.
  • Live mode should be used when you’re ready to launch your course. All transactions in this mode are real transactions, and money will exchange hands. Once you’ve launched your site, you should stay in live mode indefinitely.

IMPORTANT
Stripe has announced and updated their Test Mode Subscription Data Retention policies and introduced their test clocks feature. Find out more about it below.

Stripe has recently introduced their test clocks feature for Stripe Billing, which offer powerful testing capabilities and dramatically reduce the need to keep test mode subscriptions indefinitely. Test clocks simulate what your subscriptions and billing integrations would look like as if time has advanced to a future date. This will cause Billing resources, such as Subscriptions, to change state and trigger webhook events for testing purposes. You can learn more about them here.

Stripe has also since updated their Data Retention policies for test mode data. Starting February 1, 2023, Stripe will:

  • Automatically cancel test mode subscriptions 90 days after creation
  • Automatically delete test mode subscriptions 30 days after cancellation
  • You can mark up to 50 test mode subscriptions as exempt in the Dashboard

Take note that this updated data retention policy only impacts test mode subscriptions. They have also updated their subscription testing guide to show you how you can continue to test throughout the entire subscription life cycle. You can check out their additional FAQs on the matter from their support site. If you have any concerns or issues pertaining to this or other Stripe-related concerns, feel free to reach out to them on: https://support.stripe.com.

Payment Methods

Currently, we offer 2 types of payment methods: Credit Card and Ideal

If the Credit Card option is not already selected, please make sure to enable that and save your changes.

Webhook URL

is an auto-generated URL. This URL needs to be pasted to your Stripe account’s webhook settings.

Add a Stripe Webhook

    1. Login to your Stripe account and navigate to https://dashboard.stripe.com/webhooks
    2. Click the Add endpoint button
    3. From your WordPress dashboard, navigate to LEARNDASH LMS > SETTINGS > PAYMENTS > STRIPE CONNECT and copy the auto-generated Webhook URL
    4. Back in Stripe, paste the Webhook URL you copied into the Endpoint URL field
    5. For Version, select the latest API version
    6. Under Events to send, enable ONLY the following events:customer.subscription.deleted
      invoice.payment_failed
      invoice.paid
      checkout.session.completed
      coupon.deleted

NOTE
If you’re having problems with duplicated users after a failed payment or cancelled transaction, you can also include the following events.charge.failed, payment_intent.payment_failed, payment_intent.canceled

  1. Click Add endpoint

https://www.learndash.com/support/wp-content/uploads/2019/09/adding-a-stripe-webhook.gif

Validate Webhook Setup

Once the endpoints and webhook URLs are added, click Validate Webhook Setup to test that your webhooks are set up correctly.
Validate Webhook Setup Stripe Connect

Return URL (optional)

If no return URL is provided, the user will remain on the course page after their transaction is processed.

But you can choose to send the user to a confirmation page instead. This can be a page you create on your site, with WordPress, a page builder, etc. Or even a page on a completely different domain. It’s entirely up to you.

Enter the full URL, beginning with https://.

Course Configuration

After you’ve configured your Stripe for LearnDash settings, the final thing you need to do is set up your course to accept payments.

  1. In the WordPress admin area, navigate to LEARNDASH LMS > COURSES
  2. Click on the course you’d like to sell with Stripe
  3. Click on Settings at the top
  4. Scroll down to Course Access Settings
  5. Set the “Access Mode” to one of two values:
  • Buy Now: Use “Buy Now” for one-time payments
  • Recurring: Use “Recurring” if you’d like to set up a recurring payment (aka: subscription)

And finally, enter your price in the Course Price field. Ex: 29.99

  • The currency symbol will be added automatically for you
  • If your price is an even dollar amount, you may omit the decimal point & cents (ex: 29)

For recurring payments, you need to include the “Billing Cycle” in days, weeks, months or years.

The User Experience

When users visit your course page, they will see a “Take This Course” button (this language can be customized using custom labels).

When a user clicks the purchase button, they will be taken to a secure checkout page (that is hosted on Stripe’s secure servers), where they can enter payment details and complete their purchase.

After payment is complete, a new user account is automatically created, and that user is enrolled into the course they just purchased.

NOTE
Existing website users must first be logged in before purchasing another course via Stripe to prevent duplicate customer account creation in Stripe, or failed transactions on the customer’s end.

FAQ

Can I use both PayPal AND Stripe?
Yes. You will need to configure the PayPal settings within LearnDash, but once you’ve added that information, along with all the Stripe information, users will be presented with two options when they click the “Take This Course” button. It will look like this:
(design may vary based on your theme)

Payment Button, PayPal or Stripe options

When will I receive my money?
This is determined by your settings in Stripe. Please reference Stripe’s documentation on payouts.

Can I set up recurring payments (aka: subscriptions)?
Yes. In the course settings, just set your “Access Mode” to “Recurring,” and choose a billing cycle.

Can I offer coupons or discounts?
Yes, you can use coupons with Stripe Connect, check out Stripe’s documentation on using coupons to learn more. Also, consider using one of our other ecommerce or membership add-ons for more flexibility on payments.

How do I issue refunds and/or cancel subscriptions for my customers?
Issuing refunds and canceling subscriptions is done from your Stripe account.

Are users automatically removed from a course if they are issued a refund?
No. You can remove the course access from their profile.

Is user access removed if their payment fails on a recurring subscription?

Yes, as long as either invoice.payment_failed or customer.subscription.deleted events happen in Stripe the user’s access will be removed. Both of these events happen in Stripe which they then send back to your website.

From the Stripe events documentation page – https://stripe.com/docs/api/events/types

invoice.payment_failed – Occurs whenever an invoice payment attempt fails, due either to a declined payment or to the lack of a stored payment method.

customer.subscription.deleted – Occurs whenever a customer’s subscription ends.

How do I provide more checkout options or more customization to the process?
Consider using a robust checkout plugin such as WooCommerce and pair it with our LearnDash WooCommerce addon ( LearnDash LMS > Addons ).

How do I migrate from Stripe Add-on to Stripe Connect?

  1. Deactivate the Stripe Add-on from your Plugins page or go to LEARNDASH LMS > Add ons, and deactivate the Stripe Add-on
  2. Connect through Stripe Connect following the instructions on the documentation.
  3. Make sure webhooks are setup per the instructions linked here.

Why is it showing two transactions on my records?

For LearnDash 4.5.0 or newer, there will be 2 transaction record per single transaction. This is normal and your user will not be charged twice for each transaction. See our explanation on this on our Payment Transaction Records documentation. 

Troubleshooting

My “Take this Course” button is missing.
The most likely cause for this is that you don’t have any active payment methods configured in LearnDash LMS > Settings > Payments

If you have one of the payment methods active and configured properly and you are still not seeing the “Take this Course” button, please submit a support ticket with us and our team will be happy to investigate further.

My transactions are not going through.
Please make sure your webhook settings are configured correctly. In order for the webhook to work it needs to have at least these events active in your Stripe account:

  • checkout.session.completed
  • invoice.paid
  • invoice.payment_failed
  • customer.subscription.deleted
  • coupon.deleted

I’m seeing a 500 HTTP and timeout error.
If you are seeing the above error when checking out, make sure that the webhook settings are configured to ONLY the following events (enabling all events will likely cause a timeout error).

  • checkout.session.completed
  • invoice.paid
  • invoice.payment_failed
  • customer.subscription.deleted
  • coupon.deleted

I’m getting duplicate customer accounts created after an initial failed or cancelled transaction.
If you see duplicate customer accounts being created after an initial failed or cancelled transaction, and a subsequent successful purchase, you must have the following events enabled on your webhook settings in addition to the events above:

  • charge.failed
  • payment_intent.payment_failed
  • payment_intent.canceled

In case your user is an existing user or customer, kindly ask them to first log in to their account prior to purchasing another course via Stripe to avoid account duplication.

Was this article helpful to you?

How can we help?