Installing Stripe Integration
Learn how to install and configure the Stripe integration in your workflow environment.
Prerequisites
Before you begin, ensure you have:
- A Stripe account (test or production)
- API keys from your Stripe Dashboard
- Webhook endpoint configuration capability
- SSL enabled for your endpoints
Installation Steps
1. Get API Keys
- Log in to your Stripe Dashboard
- Navigate to Developers → API keys
- Copy your publishable and secret keys
- Store them securely in your environment
# Example environment variables
STRIPE_PUBLISHABLE_KEY=pk_test_...
STRIPE_SECRET_KEY=sk_test_...
- Go to Developers → Webhooks in your Stripe Dashboard
- Add an endpoint URL
- Select events to monitor
- Save your webhook signing secret
{
"webhook_endpoint": {
"url": "https://your-domain.com/stripe/webhook",
"secret": "whsec_..."
}
}
3. Install Dependencies
Add the required dependencies to your project:
{
"dependencies": {
"@stripe/stripe-js": "^1.54.0",
"@stripe/stripe-node": "^12.0.0"
}
}
4. Initialize Configuration
Set up your configuration file:
{
"stripe": {
"apiVersion": "2023-10-16",
"publishableKey": "pk_test_...",
"secretKey": "sk_test_...",
"webhookSecret": "whsec_...",
"environment": "test"
}
}
Environment Setup
Development Environment
{
"stripe": {
"environment": "test",
"apiKey": "sk_test_..."
}
}
Production Environment
{
"stripe": {
"environment": "production",
"apiKey": "sk_live_..."
}
}
Security Best Practices
- Never expose secret keys in client-side code
- Use environment variables for sensitive data
- Implement proper key rotation
- Use webhook signatures for verification
- Follow PCI compliance guidelines
Testing the Installation
- Make a test API call:
{
"test": {
"type": "stripe.createPaymentIntent",
"params": {
"amount": 1000,
"currency": "usd"
}
}
}
- Verify webhook reception:
{
"test": {
"type": "stripe.webhook",
"event": "payment_intent.succeeded"
}
}
Troubleshooting
Common issues and solutions:
- API key errors: Verify key permissions
- Webhook failures: Check endpoint URL and signature
- Authentication errors: Confirm API version
- Network issues: Check SSL configuration
Responses are generated using AI and may contain mistakes.