Modules/Gateways
Stripe
Complete step-by-step guide to set up Stripe payments.
Stripe Gateway Setup - Complete Guide
This comprehensive guide will walk you through setting up Stripe payments for your application, including obtaining API keys and configuring webhooks.
Prerequisites
- Stripe Account
- Access to Stripe Dashboard
- Your application ready for integration
Step 1: Get API Keys
-
Navigate to Stripe Dashboard
- Go to https://dashboard.stripe.com
- Log in to your Stripe account
-
Access API Keys
- In the left sidebar, click on "Developers"
- Click on "API keys" to view your keys
- Copy both your Publishable key and Secret key

Step 2: Access Webhook Workbench
-
Navigate to Webhooks
- In the left sidebar, click on "Developers"
- Click on "Webhooks" to access the webhook configuration
-
Add Webhook Endpoint
- Click "Add destination" to create a new webhook
- This will open the webhook workbench

Step 3: Select Events
- Choose Events to Listen For
- Select "All events" to monitor all Stripe events
- This ensures comprehensive payment monitoring
- Click "Continue" to proceed

Step 4: Configure Webhook Endpoint
- Set Up Endpoint URL
- Click on "Webhook endpoint" section
- This is where you'll configure where to send events
- Click "Continue" to proceed to the next step

Step 5: Configure Destination
-
Set Destination Name
- Enter a descriptive name for your webhook (e.g., "My Store Webhook")
-
Set Endpoint URL
- Important: The endpoint URL must end with
/api/stripe/webhook/callback - Example:
https://yourdomain.com/api/stripe/webhook/callback - This exact path is required for proper webhook handling
- Important: The endpoint URL must end with
-
Complete Setup
- Review your configuration
- Click "Continue" to create the webhook

Step 6: Webhook Created Successfully
- Webhook Details
- After creating the webhook, you'll see the webhook details
- Copy the webhook endpoint URL for your application
Step 7: Adding it to Spartan
- Now to enable Stripe in Spartan
- Login and head over to admin overview
- Click on Modules inside the sidebar, and head over to gateway tab. and find Stripe module.
- Over here, do as the image say then press Save Settings.

Troubleshooting
Common Issues
-
Invalid Credentials
- Verify Publishable Key and Secret Key are correct
- Ensure you're using the right environment (test/live)
-
Webhook Not Receiving Events
- Check webhook URL is accessible
- Verify webhook endpoint URL ends with
/api/stripe/webhook/callback - Verify webhook is enabled and configured correctly
- Check your server logs for errors
-
Payment Failures
- Verify your Stripe account is in good standing
- Check if the payment amount is within limits
- Ensure all required fields are provided
Support Resources
Your Stripe gateway is now configured and ready for payment processing!
