You can create a Stripe Buy Now button to sell your memberships using the Simple Membership Plugin.
In this tutorial we will cover how you can create a Stripe Buy Now Button to collect membership payments from your customers.
Table of Contents
- What is SCA Compliance?
- How Can I Create a Stripe ‘Buy Now’ Button?
- Using Stripe Restricted API Keys
- Customizing the Button Text
- Custom Style for the Stripe Button
- Customizing the Payment Method Types
- What Happens After the Payment?
- Configuring a Thank You Page
- Auto Redirect to the Paid Registration Page After Payment
- SSL Certificate Requirement
- Stripe Coupon, Discount or Promotion Codes
- Stripe Buy Now Button Flow of Events (From Customers Point of View)
- How Can I Test My Stripe Buy Now Button?
What is SCA Compliance?
SCA for short also known as Strong Customer Authentication is a requirement of the EU Revised Directive on payment service providers (such as Stripe) within the European Economic Area. The requirement ensures that all electronically received payments are performed with multi-factor authentication, to increase the security of sensitive information.
How Can I Create a Stripe ‘Buy Now’ Button?
Step 1) Select Stripe SCA Buy Now Button
Go to Payments -> Create New Button interface from the admin dashboard of this plugin. Then select the Stripe SCA Buy Now option (see image below):

Step 2) Configure the Payment Button Details
Enter the payment details and select your membership level for the button. See example below:

Step 3) Configure the Stripe API Key Details
Enter your Stripe API Key details in the payment button configuration.
You can get your Stripe API key details from your Stripe merchant account.
The screenshot below provides an example of where to locate your Stripe API keys within your Stripe account.
Please note: Stripe may update their interface without notice, so the actual screen might differ.

To use Restricted API keys, refer to the Using Stripe Restricted API Keys section on this page below.
Step 4) Save the Payment Button
Save the payment button after you have entered all the necessary details. This will create the payment button.
Step 5) Put the Payment Button on a Page
You can now put this newly created button on your membership join us page using a shortcode. The following screenshot shows where to get the shortcode.

The visitors can pay for membership using this button.
Using Stripe Restricted API Keys
To enhance security, you can use Restricted API Keys from your Stripe account when configuring the Stripe button. Restricted keys limit the permissions available to the plugin, reducing the risk of unauthorized access to sensitive data or actions.
Steps to Create and Use Restricted API Keys:
- Log in to your Stripe Dashboard at https://dashboard.stripe.com.
- Go to Developers → API Keys.
- Click Create Restricted Key.
- Set the following permissions for the key:
- Customers → Write – Required to create and manage customer details.
- Payment Intents → Write – Required to process payments.
- Setup Intents → Write – Required for setting up payment methods.
- Products → Read – Required to read product details (if applicable).
- Events → Read – Required to monitor and process webhook events.
- Subscriptions → Write – Required for subscriptions/recurring payments.
- Once the key is created, copy the key.
- Paste the Restricted API Key into the appropriate Secret API Key field in the plugin settings.
Customizing the Button Text
You can customize the button text by specifying the value in the shortcode using the “button_text” parameter. Below is an example shortcode that uses “Pay Now” as the payment button text:
[swpm_payment_button id=75 button_text="Pay Now"]
Custom Style for the Stripe Button
You can specify a custom CSS class for the button using the “class” parameter in the shortcode. Then you can define your own custom CSS for that class.
For example, The following shortcode will use the standard theme’s button style:
[swpm_payment_button id=75 button_text="Pay Now" class=""]
The following shortcode will add the “my-stripe-button” class to the button so you can target that class and customize the CSS.
[swpm_payment_button id=75 button_text="Pay Now" class="my-stripe-button"]
Customizing the Payment Method Types
By default, the plugin configures the button to allow Stripe to automatically select payment methods according to your Stripe Dashboard settings. You have the option to log into your Stripe account and tailor the payment methods you wish to activate or deactivate.
It’s important to note that enabling a payment method which does not immediately settle funds could lead to challenges or discrepancies with the membership registration process. This is because our plugin necessitates instant payment verification (such as with credit card transactions) for the standard paid registration process.
The following shortcode supports the “payment_method_types” parameter, allowing you to specify the payment methods you want to accept.
[swpm_payment_button id=75 button_text="Pay Now" payment_method_types="card"]
What Happens After the Payment?
Payment by New Member
If this is a payment made by a NEW member then the user will receive an email that contains a “special” link to complete the registration. Read the Registration Process Overview documentation to learn more.
If you are using the Thank You page shortcode, the user can access the special paid membership registration link directly from the Thank You page and complete the registration there.
Payment by Existing Member
If the payment is made by an EXISTING member then the membership level (associated with this payment button) is applied to the existing member’s profile. No need to register for an account again.
Note: The member must be logged into their account when making the payment for the plugin to recognize them and treat them as an existing member.
Configuring a Thank You Page
This step is optional but I recommend that you configure a Thank You page as explained in this documentation. You can then use this page in the button’s configuration.
If you specify a Return URL (Thank You Page) in the button, when your customers complete the transaction, they will be redirected to that thank you page. The Thank You page will have a link for them to register for the membership they just purchased.
Auto Redirect to the Paid Registration Page After Payment
If you want to simplify the registration process even further, you can now automatically redirect users to the unique paid registration page immediately after payment.
To learn more about this feature and how to enable it, see this documentation.
SSL Certificate Requirement
Stripe payment gateway requires you to have SSL certification on your checkout page (the page where you put your payment button). So the URL of that page should have HTTPS (example: https://yourdomain.com/join-us-page).
If you are not already using an SSL certificate on your site then you should contact your hosting provider and request them to install it for you. This plugin is useful to force your payment page (where you have the Stripe payment button) to be loaded using HTTPS.
Stripe Coupon, Discount or Promotion Codes
For guidance on using discount codes with Stripe buttons, refer to this documentation.
Stripe Buy Now Button Flow of Events (From Customers Point of View)
When customers click on a Simple Membership ‘Buy Now’ payment button, they will be automatically sent to Stripe’s website (Stripe Hosted Checkout) to complete the payment. While your customer will not know any different, this allows the payment process to entirely comply with new SCA regulations. The payment details required are:
- The customer’s email address
- The customer’s card information
- The customer’s country or region
After the customers click the ‘Pay’ button, if the transaction is successful they will be directed back to your website or to the after payment redirection URL.

How Can I Test My Stripe Buy Now Button?
Prior to testing a transaction, it is recommended that you go through this payment testing checklist.
If you have entered both your test and live Stripe keys into the Stripe Payment button configuration fields, completing a test transaction is simple. Enabling the debug log feature is advised prior to testing to ensure if any steps fail, you can view what went wrong.
- Go to the WP Membership Settings -> Payment Settings menu. Check the Enable Sandbox Testing checkbox. Save the Changes.
- Ensure within the Manage Payment Button section, you have entered both your test and live API credentials for the payment button you wish to test. If you have not entered the correct API details, you can find your details within your Stripe account under the Developers section.
- Open the page/post where the button is present.
- Click the Buy Now button.
- Enter an email address (one that does not already appear in the users menu of your WordPress website). This is where the registration link will be sent to so ensure you use an email account that you have access to.
- A test Visa card number is: “4242 4242 4242 4242“. The month and year will need to be any date in the future and the CVC can be “123“.
- Click the Pay button to proceed with the test transaction. You will not be charged anything as this is only a test card that you are using.
- If everything has worked successfully, you will receive an email to your address to complete the next stage of registration.
- Ensure you can sign up as a member and view member related content for that level.