This guide walks you through setting up Stripe payments in JoomInvoice so your customers can pay invoices online with credit/debit cards.
Prerequisites
Before you begin, ensure you have:
- Stripe Account: Create a free account at stripe.com if you don't have one
- JoomInvoice Component: Installed and working on your Joomla site
- SSL Certificate: Your site must use HTTPS (required by Stripe)
- Stripe Payment Plugin: The "JoomInvoice - Payment - Stripe" plugin must be installed
Step 1: Get Your Stripe API Keys
- Log in to your Stripe Dashboard
- Navigate to Developers → API Keys
-
You'll see two sets of keys:
- Test keys (prefixed with
pk_test_andsk_test_) - Use these for testing - Live keys (prefixed with
pk_live_andsk_live_) - Use these for real payments
- Test keys (prefixed with
-
Copy the following keys (you'll need them for plugin configuration):
- Publishable key (
pk_test_...orpk_live_...) - Secret key (
sk_test_...orsk_live_...)
- Publishable key (
Security Note: Never share your Secret key publicly. Keep it confidential.
Step 2: Enable the Stripe Plugin
- In Joomla Administrator, go to Extensions → Plugins
- Search for "stripe" or "JoomInvoice - Payment - Stripe"
- Click on the plugin name to open its settings
- Set Status to Enabled
Step 3: Configure Plugin Settings
In the plugin configuration, set the following options:
Mode
- Test: Use for development and testing (recommended to start)
- Live: Use for real payments in production
API Keys
For Test Mode:
- Test Secret key: Enter your
sk_test_...key - Test Publishable key: Enter your
pk_test_...key
For Live Mode:
- Secret key: Enter your
sk_live_...key - Publishable key: Enter your
pk_live_...key
Webhooks (Optional but Recommended)
- Enable Webhooks: Set to "Yes" for more reliable payment tracking
- Webhook secret: Enter the signing secret from Stripe (see Step 4)
Additional Options
- Description text: The message shown above the payment button (default: "Click on the button to pay with Stripe")
- Require billing address: Set to "Yes" to collect customer billing address during checkout
Click Save & Close when done.
Step 4: Set Up Webhooks (Recommended)
Webhooks provide reliable payment confirmation, especially if a customer closes their browser after payment.
Create the Webhook in Stripe
- Go to Stripe Dashboard → Developers → Workbench (or press W on your keyboard to open Workbench directly) → Webhooks
- Click Add endpoint
- Enter your Endpoint URL:
https://www.yourwebsite.com/index.php?option=com_joominvoice&task=process_payment&ptype=payment_stripe&paction=webhook
Important: Replace
www.yourwebsite.comwith your actual domain.
-
Under Events to send, select:
checkout.session.completed
-
Click Add endpoint
Get the Webhook Signing Secret
- After creating the endpoint, click on it to view details
- Under Signing secret, click Reveal to see the secret (starts with
whsec_) - Copy this secret and paste it into the Webhook secret field in the plugin settings
Webhook URL Requirements
To avoid 303 redirect errors:
- Use HTTPS (required by Stripe)
- Ensure www vs non-www matches your site's canonical URL
- Do not add trailing slashes or extra parameters
- The URL must be publicly accessible
Step 5: Test Your Setup
Use Test Mode First
- Ensure the plugin is set to Test mode
- Create a test invoice in JoomInvoice
- View the invoice in the frontend and click the Stripe payment button
- Use Stripe's test card numbers:
| Card Number | Description |
|---|---|
4242 4242 4242 4242 |
Successful payment |
4000 0000 0000 0002 |
Card declined |
4000 0000 0000 9995 |
Insufficient funds |
Use any future expiry date, any 3-digit CVC, and any postal code.
Verify the Payment Flow
- Complete a test payment with
4242 4242 4242 4242 - Check that the invoice status updates to "Paid" in JoomInvoice
- Verify the payment appears in your Stripe Dashboard under Payments
Step 6: Go Live
Once testing is complete:
- In the plugin settings, change Mode from "Test" to "Live"
- Enter your Live Secret key and Live Publishable key
- If using webhooks, create a new webhook endpoint for live mode:
- Stripe requires separate webhooks for test and live modes
- Use the same endpoint URL
- Copy the new webhook signing secret to the plugin
- Save the plugin settings
- Test with a small real transaction to confirm everything works
Troubleshooting
Payment Not Marked as Paid
Without Webhooks:
- The payment is processed when the customer returns to your site
- If they close the browser before returning, the payment won't be recorded
- Solution: Enable webhooks for reliable payment tracking
With Webhooks:
- Check that the webhook URL is correct and accessible
- Verify the webhook secret matches in both Stripe and the plugin
- Check the Stripe Dashboard → Developers → Workbench → Webhooks for delivery errors
303 Redirect Errors
Common causes:
- URL mismatch between www and non-www versions
- Missing HTTPS
- Extra parameters or trailing slashes in the webhook URL
Solution:
- Check your site's canonical URL in Joomla Global Configuration
- Use the exact same format in your webhook URL
- Ensure your SSL certificate is valid
Invalid Signature Errors in Webhooks
- The webhook signing secret may be incorrect
- Copy the secret again from Stripe Dashboard (Workbench → Webhooks) and update the plugin
- Make sure there are no extra spaces when pasting
"Invalid Session" Warning
- The payment session has expired or was already used
- Ask the customer to initiate the payment again from the invoice page
Security Best Practices
- Always use HTTPS - Stripe requires secure connections
- Keep keys secret - Never expose your Secret key in frontend code or public repositories
- Use webhooks - They provide reliable payment confirmation
- Test thoroughly - Always test in Test mode before going live
- Monitor payments - Regularly check your Stripe Dashboard for suspicious activity