Skip to main content

Payment Services

The Payment Services tab manages billing integrations for your platform. Connect payment gateways to enable your customers to purchase credits and pay for API usage.

Step 1: Access the Stripe dashboard​

  1. Sign up or log in to https://dashboard.stripe.com/

image.png

Step 2: Obtain the API credentials​

  1. Go to Stripe Dashboard → Developers → API keys

  2. Copy the secret key (Note: test mode starts withsk_test_, production mode starts withsk_live_)

image.png

Step 3: Create products​

Create products in Stripe:

  1. Go to Stripe Dashboard > Product Catalog

    image.png

  2. Create product:

    1. Enter your product name

    2. Select One-off

    3. Amount: xxx, choose your currency (USD)

    4. Add product

    image.png

  3. After creating, click your product and Unit price, save and copy the Product Price ID (starts with price_)

image.png

Step 4: Set up webhooks​

  1. In the left menu, go to Developers → Webhooks, and click + Add endpoint.

    image.png

  2. Enter the Endpoint URL:

  3. Select the events to listen to. Recommended minimum set:

    • checkout.session.completed

    • checkout.session.expired

    • charge.refunded

    image.png

  4. Choose destination type: Webhook Endpoint.

  5. Enter you destination name and Endpoint URL (https://YOUR-DOMAIN.com/api/webhooks/stripe)

    image.png

  6. On the endpoint detail page, click Reveal next to Signing secret (starts with whsec_). Copy it — it is required to verify webhook signatures.

image.png

Step 5: Configure the application​

  1. Navigate to Smart Studio Platform Settings → Payment Services → Stripe in your application (or edit environment variables / config):

    • API KEY = your secret key (Note: test mode starts withsk_test_, production mode starts withsk_live_)

    • WEBHOOK_SECRET = your webhook signing secret (starts with whsec_)

    • Product Price ID = your product price id (starts with price_)

    • Webhook URL = your webhook url

  2. Save the configuration.

image.png

Test cards​

To test Stripe integration, use Stripe's test mode and test credit cards:

  • 4242 4242 4242 4242 - Successful payment

  • 4000 0000 0000 3220 - Requires 3D Secure authentication

  • 4000 0000 0000 9995 - Insufficient funds failure

You can find more about Stripe test cards in the Stripe documentation.

Best practices​

  1. Protect API keys: Never expose your Stripe secret key in client-side code

  2. Validate webhook signatures: Always verify the signature of webhook events

  3. Handle errors gracefully: Provide user-friendly error messages when payments fail

  4. Test webhooks thoroughly: Ensure all webhook events are handled correctly

References​

Tips​

  • Payment service webhook URLs must be publicly reachable; use the test button to verify connectivity.
  • Always test payment flows in sandbox mode before enabling production keys.
  • You can enable multiple payment gateways simultaneously.

Next Step​

Continue with Payment Providers.