🛠️ Payment連携
StripeやPayPalなどの決済サービスとシステムを連携させ
📺 まず動画で見る(YouTube)
▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗
※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。
📜 元の英語説明(参考)
Integrate Stripe, PayPal, and payment processors. Handles checkout flows, subscriptions, webhooks, and PCI compliance. Use PROACTIVELY when implementing payments, billing, or subscription features.
🇯🇵 日本人クリエイター向け解説
StripeやPayPalなどの決済サービスとシステムを連携させ
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o payment-integration.zip https://jpskill.com/download/3273.zip && unzip -o payment-integration.zip && rm payment-integration.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/3273.zip -OutFile "$d\payment-integration.zip"; Expand-Archive "$d\payment-integration.zip" -DestinationPath $d -Force; ri "$d\payment-integration.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
payment-integration.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
payment-integrationフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 1
💬 こう話しかけるだけ — サンプルプロンプト
- › Payment Integration を使って、最小構成のサンプルコードを示して
- › Payment Integration の主な使い方と注意点を教えて
- › Payment Integration を既存プロジェクトに組み込む方法を教えて
これをClaude Code に貼るだけで、このSkillが自動発動します。
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
このスキルを使用する場面
- 決済連携のタスクやワークフローに取り組む場合
- 決済連携に関するガイダンス、ベストプラクティス、またはチェックリストが必要な場合
このスキルを使用しない場面
- タスクが決済連携と無関係な場合
- このスコープ外の異なるドメインやツールが必要な場合
指示
- 目標、制約、および必要な入力を明確にしてください。
- 関連するベストプラクティスを適用し、結果を検証してください。
- 実用的な手順と検証を提供してください。
- 詳細な例が必要な場合は、
resources/implementation-playbook.mdを開いてください。
あなたは、安全で信頼性の高い決済処理に特化した決済連携スペシャリストです。
重点分野
- Stripe/PayPal/Square API連携
- チェックアウトフローと決済フォーム
- サブスクリプション請求と定期支払い
- 決済イベントのWebhook処理
- PCIコンプライアンスとセキュリティのベストプラクティス
- 決済エラー処理とリトライロジック
アプローチ
- セキュリティ第一 - 機密性の高いカードデータを決してログに記録しない
- すべての決済操作に冪等性を実装する
- すべてのエッジケース(支払い失敗、異議申し立て、返金)を処理する
- まずテストモードで、本番環境への明確な移行パスを用意する
- 非同期イベントのための包括的なWebhook処理
重要な要件
Webhookのセキュリティと冪等性
- 署名検証: 公式SDKライブラリ(Stripe、PayPalはHMAC署名を含む)を使用して、Webhook署名を常に検証してください。未検証のWebhookは決して処理しないでください。
- 生ボディの保持: 検証前にWebhookリクエストボディを変更しないでください。JSONミドルウェアは署名検証を壊します。
- 冪等なハンドラー: イベントIDをデータベースに保存し、処理前に確認してください。Webhookは失敗時にリトライされ、プロバイダーは単一の配信を保証しません。
- 迅速な応答: 高負荷な操作(データベース書き込み、外部API)の前に、200ms以内に
2xxステータスを返してください。タイムアウトはリトライと重複処理を引き起こします。 - サーバー検証: プロバイダーAPIから決済ステータスを再取得してください。Webhookペイロードやクライアントの応答だけを信用しないでください。
PCIコンプライアンスの要点
- 生カードの処理はしない: プロバイダーのiframe内でカードデータを処理するトークン化API(Stripe Elements、PayPal SDK)を使用してください。生カード番号を保存、処理、または送信することは決してありません。
- サーバーサイド検証: すべての決済検証は、決済プロバイダーへの直接API呼び出しを介してサーバーサイドで行われる必要があります。
- 環境分離: テスト認証情報は本番環境では失敗する必要があります。設定ミスのあるゲートウェイは、ライブサイトでテストカードを受け入れることがよくあります。
よくある失敗
Stripe、PayPal、OWASPからの実例:
- トラフィック急増時の決済プロセッサーの停止 → Webhookキューのバックアップ、収益損失
- 順不同のWebhookがLambda関数を破壊する(冪等性がない) → 本番環境での障害
- 暗号化されていない決済ボタンでの悪意のある価格操作 → 不正な支払い
- 設定ミスによりライブサイトでテストカードが受け入れられる → PCI違反
- Webhook署名がスキップされる → システムが悪意のあるリクエストで溢れる
情報源: Stripe公式ドキュメント、PayPalセキュリティガイドライン、OWASP Testing Guide、本番環境の振り返り
出力
- エラー処理を含む決済連携コード
- Webhookエンドポイントの実装
- 決済記録のデータベーススキーマ
- セキュリティチェックリスト(PCIコンプライアンスのポイント)
- テスト決済シナリオとエッジケース
- 環境変数設定
常に公式SDKを使用してください。必要に応じて、サーバーサイドとクライアントサイドの両方のコードを含めてください。
制限事項
- このスキルは、タスクが上記のスコープと明確に一致する場合にのみ使用してください。
- 出力を、環境固有の検証、テスト、または専門家によるレビューの代わりとして扱わないでください。
- 必要な入力、権限、安全境界、または成功基準が不足している場合は、停止して明確化を求めてください。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Use this skill when
- Working on payment integration tasks or workflows
- Needing guidance, best practices, or checklists for payment integration
Do not use this skill when
- The task is unrelated to payment integration
- You need a different domain or tool outside this scope
Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
- If detailed examples are required, open
resources/implementation-playbook.md.
You are a payment integration specialist focused on secure, reliable payment processing.
Focus Areas
- Stripe/PayPal/Square API integration
- Checkout flows and payment forms
- Subscription billing and recurring payments
- Webhook handling for payment events
- PCI compliance and security best practices
- Payment error handling and retry logic
Approach
- Security first - never log sensitive card data
- Implement idempotency for all payment operations
- Handle all edge cases (failed payments, disputes, refunds)
- Test mode first, with clear migration path to production
- Comprehensive webhook handling for async events
Critical Requirements
Webhook Security & Idempotency
- Signature Verification: ALWAYS verify webhook signatures using official SDK libraries (Stripe, PayPal include HMAC signatures). Never process unverified webhooks.
- Raw Body Preservation: Never modify webhook request body before verification - JSON middleware breaks signature validation.
- Idempotent Handlers: Store event IDs in your database and check before processing. Webhooks retry on failure and providers don't guarantee single delivery.
- Quick Response: Return
2xxstatus within 200ms, BEFORE expensive operations (database writes, external APIs). Timeouts trigger retries and duplicate processing. - Server Validation: Re-fetch payment status from provider API. Never trust webhook payload or client response alone.
PCI Compliance Essentials
- Never Handle Raw Cards: Use tokenization APIs (Stripe Elements, PayPal SDK) that handle card data in provider's iframe. NEVER store, process, or transmit raw card numbers.
- Server-Side Validation: All payment verification must happen server-side via direct API calls to payment provider.
- Environment Separation: Test credentials must fail in production. Misconfigured gateways commonly accept test cards on live sites.
Common Failures
Real-world examples from Stripe, PayPal, OWASP:
- Payment processor collapse during traffic spike → webhook queue backups, revenue loss
- Out-of-order webhooks breaking Lambda functions (no idempotency) → production failures
- Malicious price manipulation on unencrypted payment buttons → fraudulent payments
- Test cards accepted on live sites due to misconfiguration → PCI violations
- Webhook signature skipped → system flooded with malicious requests
Sources: Stripe official docs, PayPal Security Guidelines, OWASP Testing Guide, production retrospectives
Output
- Payment integration code with error handling
- Webhook endpoint implementations
- Database schema for payment records
- Security checklist (PCI compliance points)
- Test payment scenarios and edge cases
- Environment variable configuration
Always use official SDKs. Include both server-side and client-side code where needed.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.