ワンクリックで
stripe
Stripe 決済の導入・テスト・運用ガイド。新規プロジェクトへの Stripe 導入、本番/テストモード切替、決済テスト、返金処理などを行う。「Stripe を導入したい」「決済機能を追加」「返金したい」「Stripe のテスト」などのリクエストで使用する。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Stripe 決済の導入・テスト・運用ガイド。新規プロジェクトへの Stripe 導入、本番/テストモード切替、決済テスト、返金処理などを行う。「Stripe を導入したい」「決済機能を追加」「返金したい」「Stripe のテスト」などのリクエストで使用する。
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
写真に写っている人物の顔を検出してぼかし、匿名化した画像を作成する。YuNet による 2 パス顔検出、ガウスぼかし、拡大クロップでの目視検証、取りこぼしの手動追いぼかしまでのワークフロー。「顔をぼかして」「顔にモザイク」「写真の顔を隠して」「人物を匿名化して」などのリクエストで使用する。
Analyze X creator subscription accounts through X's authenticated internal Web API. Use when asked to collect subscriber counts, subscription-only post counts, monthly prices, estimated gross monthly revenue, rankings, or summary statistics for X Subscriptions, including the user's managed set of subscribed creators.
X(Twitter)上の公開情報を検索し、投稿、アカウント、スレッド、最近の話題、評判、反応を根拠となる x.com URL 付きで調査する。「X で検索して」「X でこの投稿やアカウントを探して」「X で最近何が話題?」「X 上の反応や評判を調べて」などで使用する。投稿、返信、引用、いいね、フォロー、ブロック、ミュート、報告、削除などの書き込み操作や、指定された X URL またはログイン済み X 画面そのものを開いて閲覧・確認する依頼には使用しない。
chrome-devtools MCP でログイン済み Chrome を使い、X (Twitter) の内部 Web API (api.x.com / i/api) を fetch で呼んで一括操作する。ブロック解除、ブロック、ミュート、フォロー解除などをまとめて処理したいときに使う。X のレートリミット (短い窓あたり約 10 件) の回避方法を含む。「X で全員ブロック解除して」「まとめてミュート」「一括でフォロー解除」などのリクエストで使用する。
Check Luma event guests against X profile, follow, mutual-follow, affiliation, and recent-account-activity requirements. Use when Codex needs to review a Luma event guest table, extract pending guests and X profile links, identify missing/invalid/deleted/protected X accounts, use X relationship lookup to verify whether guests follow the logged-in organizer account, check whether candidates have posted from their own X account within the last month excluding repost-only activity using read-only internal APIs, prioritize mutual follows before followed-by-only candidates, check whether a specific X handle registered and what current Luma status it has, manage X rate limits without causing 429s, and report decline or approval-support candidates without ever performing approve, decline, or other guest write actions.
Archive only the current Codex App thread when the user invokes /archive or $archive to finish the current thread. Use the Codex App thread archive tool without passing a thread id so no other thread is archived.
| name | stripe |
| description | Stripe 決済の導入・テスト・運用ガイド。新規プロジェクトへの Stripe 導入、本番/テストモード切替、決済テスト、返金処理などを行う。「Stripe を導入したい」「決済機能を追加」「返金したい」「Stripe のテスト」などのリクエストで使用する。 |
Stripe 決済の導入から運用までをカバーする。
| キー | 形式 | 用途 |
|---|---|---|
| Publishable Key | pk_test_* / pk_live_* | クライアント側(公開可) |
| Secret Key | sk_test_* / sk_live_* | サーバー側(秘匿必須) |
| Webhook Secret | whsec_* | Webhook 署名検証用 |
プロジェクトごとに API キーを分離する:
op item create --category="API Credential" --title="Stripe Live API Keys (プロジェクト名)" --vault="Private" \
"Publishable key=pk_live_xxx" \
"Secret key=sk_live_xxx" \
"Webhook secret=whsec_xxx"
公開キーは wrangler.toml の [vars] に、秘匿キーは secret に設定:
[vars]
STRIPE_PUBLISHABLE_KEY = "pk_live_xxx"
echo "sk_live_xxx" | npx wrangler secret put STRIPE_SECRET_KEY
echo "whsec_xxx" | npx wrangler secret put STRIPE_WEBHOOK_SECRET
https://example.com/api/webhookcheckout.session.completed を選択whsec_*)をコピーして保存import Stripe from "stripe";
webhookRoutes.post("/", async (c) => {
const stripe = new Stripe(c.env.STRIPE_SECRET_KEY, {
httpClient: Stripe.createFetchHttpClient(),
});
const signature = c.req.header("stripe-signature");
if (!signature) {
return c.json({ error: "Missing signature" }, 400);
}
const body = await c.req.text();
let event: Stripe.Event;
try {
event = await stripe.webhooks.constructEventAsync(
body,
signature,
c.env.STRIPE_WEBHOOK_SECRET,
undefined,
Stripe.createSubtleCryptoProvider(),
);
} catch {
return c.json({ error: "Invalid signature" }, 400);
}
if (event.type === "checkout.session.completed") {
const session = event.data.object as Stripe.Checkout.Session;
// 注文処理
}
return c.json({ received: true });
});
const stripe = new Stripe(c.env.STRIPE_SECRET_KEY, {
httpClient: Stripe.createFetchHttpClient(),
});
const session = await stripe.checkout.sessions.create({
mode: "payment",
line_items: [
{
price_data: {
currency: "jpy",
product_data: { name: "商品名" },
unit_amount: 1000,
},
quantity: 1,
},
],
success_url: `${c.env.SITE_URL}/success?session_id={CHECKOUT_SESSION_ID}`,
cancel_url: `${c.env.SITE_URL}/cancel`,
metadata: {
userId: "xxx",
// カスタムデータ
},
});
return c.json({ url: session.url });
| 通貨 | 最低額 |
|---|---|
| JPY | 50円 |
| USD | $0.50 |
テスト用商品は最低額で作成する。
| カード番号 | 結果 |
|---|---|
| 4242 4242 4242 4242 | 成功 |
| 4000 0000 0000 0002 | 拒否 |
| 4000 0000 0000 3220 | 3D セキュア必須 |
有効期限: 将来の任意の日付、CVC: 任意の 3 桁
# 1. Stripe セッション ID から payment_intent を取得
curl -s -u "sk_live_xxx:" "https://api.stripe.com/v1/checkout/sessions/cs_live_xxx" | jq -r '.payment_intent'
# 2. 返金実行
curl -s -X POST "https://api.stripe.com/v1/refunds" \
-H "Authorization: Bearer sk_live_xxx" \
-d "payment_intent=pi_xxx" | jq '{id, status, amount}'
curl -s -X POST "https://api.stripe.com/v1/refunds" \
-H "Authorization: Bearer sk_live_xxx" \
-d "payment_intent=pi_xxx" \
-d "amount=500" | jq '{id, status, amount}'
pk_test_* / sk_test_* → テストモードpk_live_* / sk_live_* → 本番モードwrangler.toml の STRIPE_PUBLISHABLE_KEY を更新wrangler secret put で秘匿キーを更新# 本番用シークレットに切替
echo "sk_live_xxx" | npx wrangler secret put STRIPE_SECRET_KEY
echo "whsec_xxx" | npx wrangler secret put STRIPE_WEBHOOK_SECRET
npm run build && npx wrangler deploy
Stripe SDK は Node.js の util モジュールを使用するため、wrangler.toml に以下が必要:
compatibility_flags = ["nodejs_compat"]
Webhook 署名検証には Stripe.createSubtleCryptoProvider() を使用する(Workers 環境では Node.js の crypto が使えないため)。
compatibility_flags = ["nodejs_compat"] を追加してビルドし直す。
STRIPE_WEBHOOK_SECRET が正しいか確認c.req.text() で body を取得しているか確認(c.req.json() は NG)Webhook エンドポイントが正しく設定されているか確認:
npx wrangler tail --format=pretty