The Stripe payment gateway built into Restrict Content Pro allows you to use your account with Restrict Content Pro to accept credit cards directly on your website.

Configuring Stripe is simple and only takes a few moments.

First, go to  Restrict > Settings > Payments and enable Stripe:

Next, under  Stripe Settings, click the "Connect with Stripe" button to connect Restrict Content Pro to your Stripe account.

You'll be taken to where you'll be prompted to either create a new Stripe account or login to your existing one.

Once you complete the form you'll be taken back to your website.

Payment Flow

With Stripe, customers will be shown a credit / debit card form directly on your registration form:

After filling in the credit / debit card details, the customer will be presented with a processing indicator. If the card is successfully charged, the customer will be redirected to the success page. If the card fails, the customer will be shown an error message.


Stripe Webhooks are how Restrict Content Pro communicates with Stripe and is the system RCP uses to detect when a subscription has been updated (payment made, account cancelled, etc).

The URL that Stripe sends webhooks to must be configured manually from your Account Webhooks settings page (on the left, under Developers > Webhooks).

Click Add Endpoint:

Enter "" for the URL and select All Events. Replace with the actual domain to your site.

You need to add webhooks separately in both "test" and "live" modes in Stripe.

Note: If your webhook becomes unresponsive or starts redirecting to another page, payments may be delayed, so it's important that your URL be entered correctly and remain active. You can check to see if webhooks are being successfully processed by visiting the "Webhooks" section in your Stripe dashboard.

Testing Stripe Payment Gateway

Due to's phenomenal testing environment, you can fully test all aspects of Restrict Content Pro before deploying to a live environment.

To test Restrict Content Pro with Stripe, follow these steps: 

  1. Enable Test Mode in Settings.
  2. Connect your account.
  3. Switch your account to Test.
  4. Visit your website's registration page while logged out.
  5. Enter the user information. This can be anything, though a real email address that you have access to is advised.
  6. Choose a paid subscription level.
  7. Choose to auto renew (or not) the subscription.
  8. Choose "Credit Card" as the payment method.
  9. Enter "4242424242424242" for card number. (Other test card numbers are available here.)
  10. Enter 12 / 2020 for the expiration. Any date in the future will work.
  11. Enter 55320 for the zip code. Any U.S.-based zip code will work. (If you'd like to use a zip code from a different country then you will need to use an international test card number as well.)
  12. Click "Register".
  13. You should now be redirect to the success page and logged-in as your new user.
  14. Check your account history, you will see the test transaction.
  15. Your new user now has a fully activated account. 

Stripe API version

Restrict Content Pro has been tested up to Stripe API version  2019-05-16.


If using auto renew with Stripe, membership levels cannot have a duration greater than 1 year. For example, you cannot configure a 2 year membership that auto renews.

Customizing the card form

The Stripe gateway uses the Stripe Elements API for securely passing card details to Stripe's servers. Here are a few different ways the card form can be customized:

Removing the zip / postal code element

Stripe automatically chooses whether or not to show / hide this field based on the country the billing card is associated with. If you want to hide this field for all users, you can add this custom PHP code:

 * Hide the zip / postal code field.
add_filter( 'rcp_stripe_scripts', function ( $stripe_args ) {
	$stripe_args['elementsConfig']['hidePostalCode'] = true;

	return $stripe_args;
} );

You can see the Stripe.js documentation for other arguments that can be passed in.

Styling the card form

The card form is inserted via an iframe from Stripe's servers. Therefore, it cannot be styled with normal CSS. Instead, it's styled via JavaScript. The same rcp_stripe_scripts filter above can be used to add CSS properties and values. For a full tutorial and examples, see our article on Customizing the Stripe Elements card form.