Recurring Payments - Stripe Gateway Configuration
This document explains how Recurring Payments works with the Stripe payment gateway. General setup of the Stripe payment gateway is found here.
A webhook is a URL on your site that Stripe can access to accomplish certain tasks. Stripe uses it for:
- Recording renewal payments
- Processing merchant-side refunds
- Processing merchant-side cancellations
- Handling failed payment notifications
If webhooks are not configured properly or are blocked by a plugin or configuration of your site, the processes above will not function.
EDD creates a webhook for you, and you simply need to tell Stripe where it is.
Note: this step is the number one cause of failure in the recurring billing process. The following steps are very important.
To set up webhooks in Stripe go to http://stripe.com and log in. In the top right will be your username with a down arrow. Click that and then choose Account Settings.
This will open a new window with a bar at top, and you want to select Webhooks.
Once the webhooks window is open click the Add endpoint... button.
In the URL box you want to add
where example.com is your own URL. For Mode choose Live, and select the option Send me all events.
Then click Create Endpoint.
IMPORTANT: You must repeat the above process, creating a second endpoint, for Test Mode.
Note: your webhooks won't work in a local development environment like Vagrant, WAMP, MAMP, or Desktop Server. These are typically non-publicly accessible IP addresses and Stripe can't reach them.
When using Stripe, a cancellation may be initiated either from within EDD or from the Stripe Dashboard.
From The EDD Admin
To cancel a subscription from the EDD admin go to Downloads → Subscriptions and click View on the item you want to cancel.
Then in the bottom of the next screen click on Cancel Subscription.
When you set a subscription to cancelled it's cancelled immediately, but the customer will still have access to their purchased material for as much time as they've paid for.
Example: they've paid $10/mo, and you cancel halfway through the month. They still have access to their material for the rest of the month, but they won't be rebilled, and access will stop at the end of the month.
From The Stripe Dashboard
To cancel a subscription from the Stripe Dashboard, log into Stripe and find the search bar in the top right.
You may find customers by searching for:
- the charge ID
- the subscription profile ID
- the EDD customer ID number
- the customer email
Once you've found and selected your Customer in Stripe you'll see a list of subscriptions.
If you click Cancel you'll be given two options, to cancel Immediately or At Period End. For the purposes of EDD it doesn't matter which you choose, your customer won't experience any difference between the two.
It doesn't matter if you cancel a subscription in EDD or in Stripe, the effect is exactly the same and the customer won't notice a difference.
Multiple Domains and one Stripe Account
You can use a single Stripe account with multiple domains by setting up multiple endpoint URLs in your Stripe account under "Account Settings" > "Webhooks" and add multiple endpoints.
When using the Stripe payment gateway refunds are processed the same way as any other transaction. Read our full documentation on refunds here.