# Build Stripe Checkout for Caffeine AI

Adding card payments requires coordinated backend, frontend, and routing work. This skill provides a practical Stripe Checkout pattern for Caffeine AI applications.

## Install

```bash
npx skillstore add caffeinelabs/extension-stripe
```

## Metadata

- Status: approved
- Slug: caffeinelabs-extension-stripe
- Version: 0.1.6
- Author version: 0.1.6
- Skillstore revision: r2
- Version status: valid
- Tree hash: 552430447da3cedeef547fd7a1c60d10b826d38fbe0b1b9f4a7dfa6e9854778a
- Author: caffeinelabs
- GitHub username: caffeinelabs
- License: MIT
- Repository: https://github.com/caffeinelabs/skills/tree/main/skills/extension-stripe/
- Ref: a39a91716eadede5f4cdefd78178fed4e837a128
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: confirmation\_required
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, network, filesystem
- Quality score: 38
- Quality tier: warning
- Public page: https://skillstore.pages.dev/skills/caffeinelabs-extension-stripe
- Manifest: https://skillstore.pages.dev/api/skills/caffeinelabs-extension-stripe/manifest

## Capabilities

- Defines Stripe configuration and shopping item types for a Motoko backend.
- Shows admin-only Stripe configuration using the Caffeine AI authorization package.
- Creates Stripe Checkout sessions through backend HTTP outcalls.
- Checks Stripe session status from the backend.
- Implements a React Query hook that parses and validates checkout responses.
- Routes users to payment success and failure pages.

## Use Cases

- Add Checkout to a Store: Create backend sessions and frontend redirects for products sold through a Caffeine AI application.
- Configure Stripe Administration: Build an admin-only setup view for a Stripe secret key and allowed countries.
- Review a Payment Integration: Compare an existing Motoko and React payment flow with the documented integration pattern.

## Prompt Templates

### Plan a Basic Checkout

```
Plan a Stripe Checkout flow for my Caffeine AI app. My products are [product types] and my frontend uses [framework].
```

### Build the Backend

```
Implement the Motoko Stripe backend for [project]. Use backend product records, admin-only configuration, and fixed allowlisted redirect origins.
```

### Build the Frontend Flow

```
Create React checkout, success, and failure components for [project]. Validate session responses and show clear loading and error states.
```

### Audit the Complete Integration

```
Audit my Stripe integration for price tampering, redirect abuse, secret exposure, session verification, duplicate fulfillment, and authorization gaps. Propose specific fixes.
```

## Limitations

- The provided example does not validate product prices against backend records.
- The backend example does not restrict caller-provided success and cancellation URLs.
- The skill requires Caffeine AI authorization, HTTP outcall, and Stripe packages.
- The result page guidance does not define order fulfillment or entitlement delivery.

## Best Practices

- Load prices, names, and currencies from trusted backend product records.
- Allowlist return origins and verify Stripe session status before fulfillment.
- Keep Stripe configuration changes behind explicit administrator authorization.

## Anti Patterns

- Do not trust prices or currencies sent by the browser.
- Do not accept unrestricted success or cancellation URLs from callers.
- Do not grant products from a success page without server-side payment verification.

## Security Audit

- Audited at: 2026-07-23T12:07:22.983\+00:00
- Summary: All 25 static findings are false positives caused by Markdown syntax, ordinary imports, template literals, and an informational link. Semantic review found client-controlled pricing and redirect URLs in the recommended checkout design.

## Stats

- Views: 0
- Downloads: 4
- Favorites: 0
- Popularity score: 0
