ManagerV LogoManagerV Docs

Stripe Integration Guide

Complete guide to integrate Stripe payment system with your store

Stripe Payment Integration

Complete guide to integrate Stripe Checkout for processing payments in your store system.

Stripe is a leading payment processor supporting credit cards, digital wallets, and local payment methods in 135+ currencies.


Prerequisites

Before you begin, ensure you have:

  • ✅ A Stripe account (Sign up here)
  • ✅ Admin access to your dashboard
  • ✅ Backend server running
  • ✅ SSL certificate (HTTPS required for production)

Overview

The Stripe integration uses Checkout Sessions:

  • Products are managed in your database
  • Checkout sessions created via Stripe API
  • Payments processed by Stripe
  • Webhooks notify your system of completed payments

Architecture

[Admin Panel] → [Your Database] → [Stripe Checkout] → [Stripe Webhooks] → [Your Backend]

Important: Unlike Tebex, Stripe products are managed directly in your admin panel, not in Stripe Dashboard!


Step 1: Get Stripe Credentials

Create Stripe Account

  1. Go to Stripe Dashboard
  2. Click "Sign Up"
  3. Complete registration
  4. Verify your email

Complete Business Profile

  1. Dashboard → Settings
  2. Fill in business details
  3. Add bank account (for production)
  4. Complete verification

Get API Keys (Test Mode)

  1. Ensure "Test mode" is ON (toggle at top)
  2. Navigate to DevelopersAPI Keys
  3. You'll see two keys:

Publishable Key

pk_test_51xxxxxxxxxxxxxxxxxxxxx
  • Safe to use client-side
  • Used for Stripe UI components
  • Can be public

Secret Key

sk_test_51xxxxxxxxxxxxxxxxxxxxx
  • NEVER expose client-side!
  • Used for backend operations
  • Keep secure

Security Warning: Never commit secret keys to public repositories!


Step 2: Configure Webhook

Webhooks are essential for payment notifications.

Create Webhook Endpoint

  1. Dashboard → DevelopersWebhooks
  2. Click "Add endpoint"
  3. Enter details:

Endpoint URL

https://yourdomain.com/api/store/webhook/{providerId}

You'll get the providerId after creating the Stripe provider in your admin panel.

Select Events

Choose ONLY these events:

Required Events:

checkout.session.completed              ← PRIMARY EVENT
checkout.session.expired
checkout.session.async_payment_succeeded
checkout.session.async_payment_failed
charge.refunded
charge.dispute.created
charge.dispute.updated
charge.dispute.closed

DO NOT SELECT (Creates duplicates):

payment_intent.succeeded       ← Duplicate of checkout.session
payment_intent.payment_failed  ← Duplicate
payment_intent.canceled        ← Duplicate
charge.succeeded              ← Duplicate
charge.failed                 ← Duplicate

Important: Each payment triggers multiple events. We only process checkout.session.* to avoid duplicate transactions!

Get Webhook Secret

  1. Click on the created webhook
  2. Find "Signing secret" section
  3. Click "Reveal"
  4. Copy the secret (format: whsec_xxxxxxxxxxxxx)

Step 3: Configure Provider in Admin Panel

Add Stripe Provider

  1. Login to your Admin Panel
  2. Navigate to Store → Settings
  3. Click "Add Provider"
  4. Select "Stripe" as provider type

Enter Credentials

Fill in the form:

FieldValueExample
NameProvider nameStripe Checkout
Public KeyPublishable keypk_test_51xxxxx
Secret KeySecret keysk_test_51xxxxx
Webhook SecretFrom Step 2whsec_xxxxxx
CurrencyDefault currencyUSD, EUR, TRY, etc.
ActiveEnable provider✅ Checked

Currency: This sets the default currency for all products. You can change it per product later.

Save and Get Provider ID

  1. Click "Save"
  2. Copy the Provider ID from the list
  3. It looks like: 07baa137-3833-4534-832c-0c920961f82f

Update Webhook URL

  1. Go back to Stripe Dashboard → Webhooks
  2. Edit your webhook
  3. Update URL with actual Provider ID:
    https://yourdomain.com/api/store/webhook/07baa137-3833-4534-832c-0c920961f82f
  4. Save changes

Step 4: Create Products

Unlike Tebex, Stripe products are managed in your admin panel.

  1. Admin Panel → Store → Packages
  2. Click "New Package"

Fill Product Details

Basic Information

  • Name: Product name (e.g., "VIP Rank")
  • Description: Use rich text editor for detailed description
  • Price: Product price (e.g., 9.99)
  • Currency: Select currency (defaults to provider currency)

Product Image

  1. Click "Upload Image" in the sidebar
  2. Select image (max 5MB)
  3. Image is uploaded to your CDN
  4. Preview appears automatically

Images are stored in your system using the upload service, not in Stripe.

Stock Management

  • Leave empty for unlimited stock
  • Enter number for limited stock (e.g., 100)

Status

  • Active: Visible in shop
  • Inactive: Hidden from customers

Actions (Work in Progress)

Optional JSON for future automation:

{
  "commands": ["give {player} diamond 64"],
  "permissions": ["vip.access"],
  "discord_roles": ["role-id-123"]
}

Actions feature is in development. You can add them now for future use.

Save Product

Click "Save" to create the product.


Step 5: Test the Integration

Test in Shop

  1. Navigate to your shop page
  2. Verify products are visible
  3. Check prices and images display correctly

Test Checkout Flow

  1. Add a product to basket
  2. Click "Checkout"
  3. Should redirect to Stripe Checkout

Complete Test Payment

Use Stripe test cards:

Successful Payment

Card: 4242 4242 4242 4242
Date: 12/25 (any future date)
CVC: 123 (any 3 digits)

Failed Payment

Card: 4000 0000 0000 0002
(Card will be declined)

3D Secure

Card: 4000 0027 6000 3184
(Requires authentication)

Verify Webhook Delivery

  1. Complete test payment

  2. Check backend logs:

    📨 [Stripe] Webhook işleniyor: checkout.session.completed
    ✅ [Stripe] Transaction oluşturuldu: cs_test_xxxxx
    💾 Transaction veritabanına kaydediliyor...
    ✅ Transaction kaydedildi
  3. Check Stripe Dashboard → Webhooks → Logs

  4. All webhooks should show ✅

Verify Transaction

  1. Admin Panel → Store → Transactions
  2. Your test payment should appear
  3. Status should be "Completed"
  4. Amount should be correct

Production Setup

Switch to Live Mode

  1. Stripe Dashboard → Toggle "Test mode" OFF
  2. Now you're in Live mode

Get Live API Keys

  1. Developers → API Keys (in live mode)
  2. Copy live keys:
    • Publishable: pk_live_xxxxx
    • Secret: sk_live_xxxxx

Create Live Webhook

  1. Developers → Webhooks → Add endpoint
  2. Same URL: https://yourdomain.com/api/store/webhook/{providerId}
  3. Select same events as before
  4. Get live webhook secret: whsec_xxxxx

Create Production Provider

  1. Admin Panel → Store → Settings
  2. Deactivate test provider
  3. Create new provider with live keys:
    • Public Key: pk_live_xxxxx
    • Secret Key: sk_live_xxxxx
    • Webhook Secret: whsec_xxxxx (live)
    • Currency: Your currency
    • Active: ✅

Update Webhook URL

Update Stripe webhook with new production provider ID.

Test with Real Payment

  1. Make a small real purchase ($0.50-$1.00)
  2. Verify everything works
  3. Refund the test transaction

HTTPS Required: Production webhooks require SSL/HTTPS. Ensure your domain has a valid certificate!


Webhook Signature Verification

Your backend automatically verifies webhooks using Stripe SDK.

How It Works

// Backend verifies each webhook
const stripe = new Stripe(secretKey);
const event = stripe.webhooks.constructEvent(
  rawBody,
  signature,
  webhookSecret
);

if (!event) {
  return 403; // Invalid signature
}

Security Features

Signature verification using Stripe SDK ✅ Timestamp validation (prevents replay attacks) ✅ HTTPS enforcement in production ✅ Raw body preservation for verification


Troubleshooting

Products Not Showing

Problem: Shop page is empty

Solutions:

  1. Check products are Active in admin panel
  2. Verify Stripe provider is Active
  3. Check backend logs for errors
  4. Ensure products have valid prices

Invalid Signature Error

Problem: Webhooks return "Invalid signature"

Solutions:

  1. Verify webhook secret in admin panel matches Stripe
  2. Check you're using the correct environment (test vs live)
  3. Ensure raw body is preserved (don't parse before verification)
  4. Verify webhook URL has correct provider ID

Webhook Not Received

Problem: Payment successful but no transaction recorded

Solutions:

  1. Check webhook URL is correct
  2. Verify webhook events are selected in Stripe
  3. Check backend logs: /api/store/webhook/{providerId}
  4. Test webhook in Stripe Dashboard → Send test webhook

Session ID Not Found

Problem: Success page shows "Payment processing"

Solutions:

  1. Wait a few seconds (webhook might be delayed)
  2. Refresh the page
  3. Check backend received the webhook
  4. Verify transaction was created with session ID

Currency Mismatch

Problem: Prices showing wrong currency

Solutions:

  1. Update provider currency setting
  2. Edit existing products to use new currency
  3. Create new products (they'll use provider currency)

Production Checklist

Before going live:

  • Live API keys configured
  • Live webhook created and tested
  • All products configured with correct prices
  • Test purchase with real payment completed
  • HTTPS/SSL certificate active
  • Webhook signature verification working
  • Transaction appears in admin panel
  • Success page displays correctly
  • Email notifications working (if configured)
  • Stripe Dashboard notifications enabled

Supported Payment Methods

Stripe supports 40+ payment methods:

Cards

  • ✅ Visa
  • ✅ Mastercard
  • ✅ American Express
  • ✅ Discover

Digital Wallets

  • ✅ Apple Pay
  • ✅ Google Pay
  • ✅ Link

Local Methods (Region-specific)

  • 🇪🇺 SEPA Direct Debit
  • 🇳🇱 iDEAL
  • 🇵🇱 Przelewy24
  • 🇹🇷 Turkish Local Cards
  • And many more...

Payment methods are automatically shown based on customer location and currency.


Supported Currencies

Stripe supports 135+ currencies including:

CurrencyCodeSymbol
US DollarUSD$
EuroEUR
British PoundGBP£
Turkish LiraTRY
Japanese YenJPY¥
Canadian DollarCAD$
Australian DollarAUD$
Swiss FrancCHFFr
Chinese YuanCNY¥
Indian RupeeINR

Full currency list


API Reference

Checkout Session Creation

// Your backend creates sessions
const session = await stripe.checkout.sessions.create({
  mode: 'payment',
  line_items: [{
    price_data: {
      currency: 'usd',
      product_data: {
        name: 'VIP Rank',
      },
      unit_amount: 999, // $9.99 in cents
    },
    quantity: 1,
  }],
  success_url: 'https://yourdomain.com/shop/success?session_id={CHECKOUT_SESSION_ID}',
  cancel_url: 'https://yourdomain.com/shop',
  metadata: {
    userId: 'user-123',
    basketId: 'basket-456',
  },
});

Webhook Event Structure

{
  "id": "evt_xxxxxx",
  "type": "checkout.session.completed",
  "data": {
    "object": {
      "id": "cs_test_xxxxxx",
      "amount_total": 999,
      "currency": "usd",
      "customer_details": {
        "email": "[email protected]",
        "name": "John Doe"
      },
      "payment_intent": "pi_xxxxxx",
      "payment_status": "paid",
      "metadata": {
        "userId": "user-123",
        "basketId": "basket-456"
      }
    }
  }
}

Environment Variables

Backend .env configuration:

# Required
BETTER_AUTH_URL=https://yourdomain.com
NODE_ENV=production

# Optional (for development)
SKIP_WEBHOOK_IP_CHECK=true  # If using Cloudflare

Best Practices

Product Management

Do:

  • Use clear, descriptive product names
  • Add detailed descriptions with rich text
  • Upload high-quality images (512x512px recommended)
  • Set appropriate prices for your market
  • Organize products logically
  • Use stock limits for limited items

Don't:

  • Use confusing abbreviations
  • Leave descriptions empty
  • Skip product images
  • Set incorrect prices
  • Mix unrelated products

Security

Do:

  • Always verify webhook signatures
  • Use HTTPS in production
  • Keep secret keys secure
  • Rotate keys periodically
  • Monitor failed webhooks
  • Enable Stripe Radar (fraud detection)

Don't:

  • Commit secrets to git
  • Use HTTP in production
  • Skip signature verification
  • Share secret keys
  • Ignore webhook failures

Testing

Do:

  • Test thoroughly in test mode
  • Try different payment methods
  • Test failed payments
  • Verify webhook delivery
  • Check all transaction states
  • Test success/cancel flows

Don't:

  • Skip test mode
  • Test with real money initially
  • Ignore webhook tests
  • Deploy without testing

Customer Experience

Do:

  • Use clear product descriptions
  • Show prices in customer's currency
  • Provide email receipts
  • Display order confirmation
  • Handle errors gracefully

Don't:

  • Hide pricing
  • Use confusing checkout flow
  • Skip confirmation pages
  • Ignore payment failures

Monitoring & Analytics

Stripe Dashboard

Monitor your store performance:

  1. Home: Overview of recent activity
  2. Payments: All payment transactions
  3. Customers: Customer database
  4. Analytics: Revenue reports

Your Admin Panel

Track transactions:

  1. Store → Overview: Sales statistics
  2. Store → Transactions: Detailed transaction list
  3. Store → Packages: Product performance

Key Metrics

Monitor these important metrics:

  • 📊 Conversion Rate: Checkout starts vs completions
  • 💰 Revenue: Daily/weekly/monthly sales
  • 🔄 Refund Rate: Percentage of refunded transactions
  • ⚠️ Dispute Rate: Chargebacks and disputes
  • Success Rate: Successful vs failed payments

Advanced Features

Customer Portal (Future)

Allow customers to:

  • View purchase history
  • Download receipts
  • Request refunds
  • Manage subscriptions

Recurring Payments (Future)

Enable subscription products:

  • Monthly/yearly billing
  • Automatic renewals
  • Trial periods
  • Tiered pricing

Actions Automation (Work in Progress)

When actions feature is complete:

  • Automatic command execution
  • Role assignments
  • Discord integrations
  • Email notifications

Migration Guide

From Tebex to Stripe

  1. Export Data:

    • Export product list from Tebex
    • Save product images
    • Note product configurations
  2. Recreate Products:

    • Create each product in admin panel
    • Upload images
    • Set same prices
    • Configure actions
  3. Test:

    • Run parallel for 1 week
    • Compare transaction volumes
    • Verify all features work
  4. Switch:

    • Disable Tebex provider
    • Enable Stripe provider
    • Announce to customers

From Other Providers

Similar process:

  1. Document current setup
  2. Recreate in admin panel
  3. Test thoroughly
  4. Gradual migration

Support Resources


FAQ

Why aren't products in Stripe Dashboard?

Our integration manages products in your database, not Stripe. This gives you more flexibility and faster updates.

Can I use both Tebex and Stripe?

Yes! You can have multiple providers active. Customers choose at checkout.

What about taxes?

Stripe Tax is available in select regions. Configure in Stripe Dashboard → Settings → Tax.

Are subscriptions supported?

Coming soon! The actions field will support recurring payments.

How do refunds work?

Refunds are processed through Stripe Dashboard. Webhooks will update your system automatically.


Next Steps

After successful integration:

  1. ✅ Configure email notifications
  2. ✅ Set up product categories
  3. ✅ Create promotional campaigns
  4. ✅ Monitor analytics regularly
  5. ✅ Optimize product offerings

Congratulations! Your Stripe integration is complete. You can now accept payments globally with 135+ currencies! 🎉


Need help? Check our Troubleshooting Guide or Contact Support.

On this page

Stripe Payment IntegrationPrerequisitesOverviewArchitectureStep 1: Get Stripe CredentialsCreate Stripe AccountComplete Business ProfileGet API Keys (Test Mode)Publishable KeySecret KeyStep 2: Configure WebhookCreate Webhook EndpointEndpoint URLSelect EventsGet Webhook SecretStep 3: Configure Provider in Admin PanelAdd Stripe ProviderEnter CredentialsSave and Get Provider IDUpdate Webhook URLStep 4: Create ProductsNavigate to PackagesFill Product DetailsBasic InformationProduct ImageStock ManagementStatusActions (Work in Progress)Save ProductStep 5: Test the IntegrationTest in ShopTest Checkout FlowComplete Test PaymentSuccessful PaymentFailed Payment3D SecureVerify Webhook DeliveryVerify TransactionProduction SetupSwitch to Live ModeGet Live API KeysCreate Live WebhookCreate Production ProviderUpdate Webhook URLTest with Real PaymentWebhook Signature VerificationHow It WorksSecurity FeaturesTroubleshootingProducts Not ShowingInvalid Signature ErrorWebhook Not ReceivedSession ID Not FoundCurrency MismatchProduction ChecklistSupported Payment MethodsCardsDigital WalletsLocal Methods (Region-specific)Supported CurrenciesAPI ReferenceCheckout Session CreationWebhook Event StructureEnvironment VariablesBest PracticesProduct ManagementSecurityTestingCustomer ExperienceMonitoring & AnalyticsStripe DashboardYour Admin PanelKey MetricsAdvanced FeaturesCustomer Portal (Future)Recurring Payments (Future)Actions Automation (Work in Progress)Migration GuideFrom Tebex to StripeFrom Other ProvidersSupport ResourcesFAQWhy aren't products in Stripe Dashboard?Can I use both Tebex and Stripe?What about taxes?Are subscriptions supported?How do refunds work?Next Steps