
extension-stripe
Payment support based on Stripe, supporting credit cards and debit cards. Checkout and session status use HTTP outcalls. For inbound Stripe webhooks (POST to the canister), also load extension-http-endpoints.
- Installs
- 30.6K
- Last 24h
- +186
- Trending rank
- #1266
- Security
- Warn
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/caffeinelabs/skills --skill extension-stripe- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads extension-stripe automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
Security audits
Independent scans of the skill's instructions and bundled files.
SKILL.md
The instructions your agent reads when the skill is triggered.
Stripe Payment Integration
Stripe payment extension for Caffeine AI.
Overview
This skill adds Stripe payment support using HTTP outcalls. The MixinStripe mixin provides configuration, checkout session creation, payment status checks, and the HTTP outcall transform callback. The frontend handles checkout flow and payment result pages.
Inbound Stripe webhooks (an external POST to the canister) are not covered here — use extension-http-endpoints for the http_request / http_request_update handlers, then verify Stripe signatures in the update path.
Prerequisite: You must follow extension-authorization first, as this integration depends on it.
Backend
Module API
The prefabricated module mo:caffeineai-stripe/stripe.mo provides low-level Stripe HTTP helpers. Do not modify it.
import OutCall "mo:caffeineai-http-outcalls/outcall";
module {
public type StripeConfiguration = {
secretKey : Text;
allowedCountries : [Text];
};
public type StripeState = {
var configuration : ?StripeConfiguration;
};
public func initState() : StripeState;
public type ShoppingItem = {
currency : Text;
productName : Text;
productDescription : Text;
priceInCents : Nat;
quantity : Nat;
};
public func createCheckoutSession(configuration : StripeConfiguration, caller : Principal, items : [ShoppingItem], successUrl : Text, cancelUrl : Text, transform : OutCall.Transform) : async Text;
public type StripeSessionStatus = {
#failed : { error : Text };
#completed : { response : Text; userPrincipal : ?Text };
};
public func getSessionStatus(configuration : StripeConfiguration, sessionId : Text, transform : OutCall.Transform) : async StripeSessionStatus;
};
Setup in main.mo
include MixinStripe(accessControlState, stripeState) MUST be placed in main.mo, not in a custom mixin file. The mixin provides these public endpoints automatically:
isStripeConfigured()setStripeConfiguration(config)createCheckoutSession(items, successUrl, cancelUrl)getStripeSessionStatus(sessionId)transform(input)— required for HTTP outcall response transformation
Do NOT redeclare any of these functions. They are provided exclusively by MixinStripe.
import Stripe "mo:caffeineai-stripe/stripe";
import AccessControl "mo:caffeineai-authorization/access-control";
import MixinAuthorization "mo:caffeineai-authorization/MixinAuthorization";
import MixinStripe "mo:caffeineai-stripe/MixinStripe";
import Map "mo:core/Map";
import Iter "mo:core/Iter";
import Text "mo:core/Text";
import Runtime "mo:core/Runtime";
actor {
// Include authorization
let accessControlState : AccessControl.AccessControlState;
include MixinAuthorization(accessControlState, null);
let stripeState : Stripe.StripeState;
include MixinStripe(accessControlState, stripeState);
public type Product = {
id : Text;
// add custom fields
};
let products : Map.Map<Text, Product>;
public query func getProducts() : async [Product] {
products.values().toArray();
};
public shared ({ caller }) func addProduct(product : Product) : async () {
if (not (AccessControl.hasPermission(accessControlState, caller, #admin))) {
Runtime.trap("Unauthorized: Only admins can add products");
};
products.add(product.id, product);
};
public shared ({ caller }) func updateProduct(product : Product) : async () {
if (not (AccessControl.hasPermission(accessControlState, caller, #admin))) {
Runtime.trap("Unauthorized: Only admins can update products");
};
products.add(product.id, product);
};
public shared ({ caller }) func deleteProduct(productId : Text) : async () {
if (not (AccessControl.hasPermission(accessControlState, caller, #admin))) {
Runtime.trap("Unauthorized: Only admins can delete products");
};
products.remove(productId);
};
// Add more data and functions as needed
};
The migration chain head:
import Map "mo:core/Map";
import AccessControl "mo:caffeineai-authorization/access-control";
module {
type Product = {
id : Text;
};
type StripeConfiguration = {
secretKey : Text;
allowedCountries : [Text];
};
type StripeState = {
var configuration : ?StripeConfiguration;
};
type NewActor = {
accessControlState : AccessControl.AccessControlState;
products : Map.Map<Text, Product>;
stripeState : StripeState;
};
public func migration(_old : {}) : NewActor {
{
accessControlState = AccessControl.initState();
products = Map.empty<Text, Product>();
stripeState = { var configuration = null };
};
};
};
Frontend
For Stripe payment integration:
Usage:
-
Implement a PaymentSetup component with:
- Use
isStripeConfigured()andsetStripeConfiguration() - Checks whether Stripe payment is configured.
- If not, opens an admin panel and asks the user to initialze Stripe with
StripeConfiguration.- Stripe secret key
- List of allowed countries, notation ["US", "CA", "GB"] etc., see the Stripe documentation.
- Do not show the payment setup when it has already been configured!
- Use
-
Implement a checkout hook:
- Note that JSON parsing of backend
createCheckoutSessionresult is needed. - Validate that the parsed session includes a non-empty
url. If missing, throw an error and do not redirect.
import { useMutation } from '@tanstack/react-query'; import { useActor } from '@caffeineai/core-infrastructure'; import { ShoppingItem } from '../backend'; export type CheckoutSession = { id: string; url: string; }; export function useCreateCheckoutSession() { const { actor } = useActor(); return useMutation({ mutationFn: async (items: ShoppingItem[]): Promise<CheckoutSession> => { if (!actor) throw new Error('Actor not available'); const baseUrl = `${window.location.protocol}//${window.location.host}`; const successUrl = `${baseUrl}/payment-success`; const cancelUrl = `${baseUrl}/payment-failure`; const result = await actor.createCheckoutSession(items, successUrl, cancelUrl); // JSON parsing is important! const session = JSON.parse(result) as CheckoutSession; if (!session?.url) { throw new Error('Stripe session missing url'); } return session; } }); } - Note that JSON parsing of backend
-
Implement a Payment component with:
useCreateCheckoutSession()- Pass
ShoppingItem[]as input. - Anaylze the
CheckoutSessionresult. - Redirect webpage to url in
CheckoutSession: This allows the user to complete the payment. - Do NOT use router navigation for the Stripe URL. Use
window.location.href. - Never navigate to
/undefined; ifsession.urlis missing, show an error and stop.
const session = await createCheckoutSession.mutateAsync(shoppingItems); if (!session?.url) throw new Error('Stripe session missing url'); window.location.href = session.url; -
Implement a PaymentSuccess and PaymentFailure component to handle payment success or failure, respectively.
-
Route two specific paths to the payment status components:
- Path "/payment-success" to PaymentSuccess.
- Path "/payment-failure" to PaymentFailure. You need to use @tanstack router.
-
The admin view offers a menu to configure Stripe. If not yet configured, it asks the admin to configure Stripe on login.
Side note: Make sure that product images are properly rendered and resized inside the product canvas.
FAQ
What does the extension-stripe skill do?
Payment support based on Stripe, supporting credit cards and debit cards. Checkout and session status use HTTP outcalls. For inbound Stripe webhooks (POST to the canister), also load extension-http-endpoints.
How do I install extension-stripe?
Run npx skills add https://github.com/caffeinelabs/skills --skill extension-stripe in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/extension-stripe/ (personal) or .claude/skills/extension-stripe/ (project).
Which AI agents can use extension-stripe?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is extension-stripe safe to install?
Security partners have reviewed it: Gen Agent Trust Hub passed; Socket passed; Snyk flagged items to review; ZeroLeaks passed. As with any skill, read the SKILL.md and bundled scripts before installing.
Who maintains extension-stripe?
It is published by caffeinelabs in caffeinelabs/skills. It has 30,580 recorded installs.
More from caffeinelabs/skills
extension-email-calendar-events
caffeinelabs/skills
Support for organising events/meetings and sending invitations by email.
extension-email-marketing
caffeinelabs/skills
Send personalised marketing emails to subscribers with an unsubscribe link.
extension-authorization
caffeinelabs/skills
Authorization system with role-based access control. Must-have for all apps that manage personal or access-restricted data.
extension-email-verification
caffeinelabs/skills
Support for sending an email with a link the recipient can click to prove they own the email address.
Popular backend & apis skills
find-skills
vercel-labs/skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
entra-app-registration
microsoft/azure-skills
Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.
google-agents-cli-adk-code
google/agents-cli
This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).
embedded-captions
heygen-com/hyperframes
Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.
entra-agent-id
microsoft/azure-skills
Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).
neon
neondatabase/agent-skills
Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.