To offer Stripe as a valid gateway for paid subscriptions, you’ll need to complete four steps, assuming you already have a valid account:
- Create the subscription type (in Members 360 WP)
- Create the product and price
- Get access to the API
- Create the webhook
Completing all steps is straightforward, so let’s get started!
Create the subscription type
Begin by navigating to ‘WordPress > Members 360 WP > Subscription Types’ and clicking the ‘Add New Subscription Type’ button (or edit the existing subscription, if you just one to add PayPal as a payment option).
Enter the main details in the ‘Information’ tab and click ‘Save.’
Now go to the “Stripe” tab (chances are that you already did this step and found this page by the helper link). Enter the payment title (which will appear on your website’s payment button) and the desired price.
Do not close this browser tab, as we’ll be entering all keys provided by Stripe in the following steps.
Create the product and price
Open your Stripe dashboard and go to ‘Product Catalog.’ Click the ‘Create Product +’ button. In the new window, define the public product name, price, and recurring billing period. Click ‘Add Product’ to save.
Note that the billing period and price should match what you have settled in the plugin subscription information. Stripe will charge the amount you set on its panel; the prices shown in the plugin are informative only.
After creating the product, click on it to load the product info page. In the pricing section, click the ‘…’ button at the end of the row for the default price and select ‘Copy Price ID’.
Paste this copied identifier into the ‘[Live] Price ID’ field in the subscription configuration Stripe tab.
Get access to the API
Members 360 WP needs access to the Stripe API to initiate new subscription payments and verify the status of existing subscriptions.
Click the ‘Developers’ link in the top section and select ‘API Keys.’ In the ‘Restricted Keys’ table, click on ‘+ Create Restricted Key.’
When prompted by Stripe, choose ‘Providing this key to another website.’ On the next screen, enter the following information:
- Name: Members 360 WP
- URL: https://wpm360.idinbound.com
- (leave ‘customize permissions for this key’ unchecked)
After completing two-factor authentication, your new API key (beginning with ‘rk_live_’) will be displayed. Optionally, add a note indicating that this key is for use with the Members 360 WP plugin on your site. Before closing the dialog, copy the key and paste it into the ‘[Live] Publishable Key’ field in the subscription configuration.
We’ll also need the ‘Secret Key,’ which is found in the ‘Standard Keys’ section. Click ‘Reveal Live Key,’ complete the two-factor authentication again, and copy the value. Paste it into the ‘[Live] Secret Key’ field in the subscription configuration.
Create the Webhook
The final step is to configure Stripe to send updates about subscription events, such as creation, payment, or deletion, to your website.
On the Stripe dashboard go to “Developers > Webhooks”. Under ‘Hosted Endpoints,’ click the “+ Add endpoint” button.
- Endpoint URL: copy the value for the “Webhook URL” field presented in the plugin subscription configuration
- Listen to: Events on your account
- Version: leave the default value
- Select events to listen to: Customer (all), Checkout (all), Invoice (all)
Save. Now find the “Signing secret” section and click on “Reveal”. Copy the ‘wh_sec_’ value and paste it into the ‘[Live] Webhook Secret’ field in the ‘Subscription Type’ configuration on your website. Save.
Congratulations! You did it.
Test mode
If, for any reason, you’d like to try the integration between Stripe and the Members 360 WP plugin, you may configure Stripe to use a “Test mode”, so everything works but no real payment is done.
To do this, activate the ‘Test Mode’ switch beside the ‘Developers’ link in the Stripe dashboard’s header. Once enabled, you’ll need to repeat all three steps (create product, get API keys, create webhook) as no data is shared between Test and Live modes.
Make sure to enter the correct values in the plugin configuration under the ‘[Test]’ fields instead of the ‘[Live]’ ones.
Finally, to enable the test mode in the payment buttons in your website, find the “members-360-wp-subscribe” shortcode and add the “test” attribute. Example:
[members-360-wp-subscribe subscription="1" test]