How to Customize Stripe Service Fee Snippets in Paid Memberships Pro (WordPress Tutorial)
If your business runs a membership website on WordPress using Paid Memberships Pro you’re likely using Stripe’s Payment methods and Link for processing cards. This makes checkout simple — but there’s no built-in way to add a credit card processing fee.
At Web Equipped, we built a free, lightweight way to do it — complete with a popup confirmation message disclosing the 3% service fee (or whatever $ amount desired) before checkout. Improving transparency and helping you comply with legal requirements around notifying customers about surcharges.
⚖️ A Note on Surcharge Legality and Customer Notification
Before adding surcharges to your online payments, it’s essential to understand the legal framework.
Many states allow credit card surcharges, but card networks and consumer protection laws require that customers are clearly notified before being charged extra.
According to LawPay’s guide on Credit Card Surcharge Rules:
“It’s a legal requirement to make clients aware of your intention to surcharge. The explanation cannot be buried in a lengthy contract or disguised by the fine print.”
Failing to disclose the surcharge properly can result in:
Chargeback disputesFines or processing penaltiesEven revocation of your merchant privileges
- Chargeback disputes
- Fines or processing penalties
- Even revocation of your merchant privileges
To avoid these issues, businesses are advised to clearly show the surcharge:
On invoices and checkout pagesIn physical signage (for in-person payments)Or through an on-screen disclosure like a popup
- On invoices and checkout pages
- In physical signage (for in-person payments)
- Or through an on-screen disclosure like a popup
Our popup solution for Paid Memberships Pro directly serves this purpose — it notifies users upfront about the 3% service fee, satisfying the disclosure requirements described by LawPay and major credit card companies.
🧭 The Problem
When you use Stripe / Link as your payment gateway in Paid Membership Pro, all checkout logic happens on Stripe’s end. That means:
The customer doesn’t see an extra fee unless you bake it into the Stripe link.
Our goal was to make this process clear and automated:
- Detect which membership level the user is purchasing.
- Display a popup notice explaining the 3% service fee.
- Redirect them to a Stripe Payment Link that already includes that fee.
Below is our free and simple solution that allows service fees in paid membership pro — without extra plugins.
⚙️ Setting Up Products and Payment Links in Stripe
Before editing WordPress, you’ll need to create your products and links inside Stripe.
Create a Service-Fee Product
Log in to your Stripe Dashboard. Go to Products → + Add product. This is where you set the name, for example “Processing Fee”. Choose Standard pricing and enter your desired fee amount and save the product.
Note: This should be based on a percentage like how typical credit card fees are applied. We use 3% in this example. Make sure your product / memberships price and the percentage fee you choose are aligned. The pop up text (in the code snippet) will have to be adjusted to match what you choose here.
2️⃣ Create Membership Products
If you already have your products set, skip to step 3
Add each membership level as a separate Stripe product (e.g., “Gold,” “Premium,” etc.). Set the correct base price for each.
- Add each membership level as a separate Stripe product (e.g., “Bronze” “Silver,” etc.).
- Set the correct base price for each.
3️⃣ Build Combined Payment Links

- Go to Payment Links in your Stripe Dashboard.
- Click + New
- Add your membership product and your service fee product.
- Click Create link.
Stripe will generate a checkout URL such as:
<https://buy.stripe.com/5kQbJ4647hd83bf44dddv553>
Each link represents a secure checkout page that includes both the membership and the processing fee.
4️⃣ Copy the Link
Copy this Stripe Payment Link — you’ll paste it into your WordPress php snippet for that membership level.
Optionally:
You could use this link for any button, on any theme; taking the user directly to the correct checkout page to include the service fee.
Not recommended given the integration into paid membership pros plug-in.
💻 Add the Processing-Fee Popup Script in WordPress
The level is the same as your ID, which can be found in the PM Pro settings in WordPress*.***
With your Stripe link ready, it’s time to add the free script that shows service fee popup and redirects the user to the correct Stripe checkout.
Here’s an example snippet for one membership level:
/**
* Service Fee popup before redirecting to Stripe Link checkout in PMPro.
* Example: Bronze (Level 1)
*/
function stripe_link_fee_notice_bronze_member() {
if ( strpos( $_SERVER['REQUEST_URI'], '/membership-checkout/' ) === false ) return;
if ( strpos( $_SERVER['QUERY_STRING'], 'level=1' ) === false ) return;
?>
<script>
document.addEventListener('DOMContentLoaded', function() {
const feePercent = 3; // Processing fee %
const feeLink = '<https://buy.stripe.com/your/payment/link>'; // Stripe link / fee
const checkoutForm = document.querySelector('form.pmpro_form');
if (!checkoutForm) return;
checkoutForm.addEventListener('submit', function(e) {
e.preventDefault();
const confirmFee = confirm(`Credit/debit card payments include a ${feePercent}% processing fee. Continue?`);
if (confirmFee) {
window.location.href = feeLink;
} else {
alert("You can avoid this fee by paying via ACH or check.");
}
});
});
</script>
<?php
}
add_action('wp_footer', 'stripe_link_fee_notice_bronze_member');
What this does:
Checks if you’re on the correct checkout page (by membership level).Displays a popup confirmation message notifying users about the 3% fee — fulfilling the legal requirement to disclose surcharges.If confirmed, redirects them to your prebuilt Stripe Payment Link.If they cancel, they stay on your site and see an alternative payment message.
- Checks if you’re on the correct checkout page (by membership level).
- Displays a popup confirmation message notifying users about the 3% fee — fulfilling the legal requirement to disclose surcharges.
- If confirmed, redirects them to your prebuilt Stripe Payment Link.
- If they cancel, they stay on your site and see an alternative payment message.
This is a free solution that doesn’t require any paid plugins, API keys, or third-party services — just simple PHP and JavaScript.
⚙️ How to Add the Code Using the Code Snippets Plugin
If you’re not comfortable editing your theme’s functions.php file, you can safely add this snippet using the Code Snippets plugin.
It’s a free, beginner-friendly way to manage custom PHP safely in WordPress.
Installing the Code
- Install the Code Snippets plugin from your dashboard:
Plugins → Add New → search “Code Snippets” - Activate it, then go to Snippets → Add New.
- Give your snippet a name (e.g., “Stripe Fee Notice – Life Member”).
- Paste your PHP code into the editor.
- Select Run snippet everywhere.
- Save and activate the snippet.
- Clear your site cache (if applicable).
That’s it — no theme editing and no risk of breaking your site during updates.
Your popup will now appear on the correct Paid Memberships Pro checkout page.
Why It Works
- Transparent: Displays a clear 3% service fee notice before payment.
- Compliant: Fulfills the customer notification rules for surcharges (LawPay guide).
- Secure: Stripe handles all payment processing.
- Free: No paid plugins or third-party integrations required.
- Scalable: Easily repeat the process for multiple membership levels.
🚀 Free, Transparent, and Easy
This method gives you a professional checkout experience using only PMPro and Stripe — no extra extensions or costs.
Members see exactly what they’re paying, and you recover your card processing fees transparently — all while following the correct legal disclosure process.
📞 Need Help or Want It Done for You?
At Web Equipped, we help with WordPress & Stripe automation, Custom checkout flows for PMPro and WooCommerce, Web design, SEO, and digital marketing.
If you’d like us to configure this for your site — or troubleshoot your current Stripe integration — Contact Us for a quick consultation.
We can craft the script for your application. Shoot us an email with your stripe payment link, membership levels / ids.
