Setup Paypalのロゴ

Setup Paypal

コミュニティ
afu-it
setup-paypal

Set up, build, debug, review, and explain PayPal payment integrations for Malaysian merchants using official PayPal developer docs, REST API OAuth 2.0, Orders v2 create/capture/authorize, Payments v2 refunds/voids/reauthorization, JavaScript SDK v6 and v5 buttons, webhooks with CRC32 plus SHA256withRSA signature verification or verify-webhook-signature postback, Subscriptions and Catalog Products, Transaction Search, Payouts, disputes, sandbox accounts, test cards, negative testing, MYR rules, and go-live. Use when working with PayPal Checkout, PayPal buttons, PayPal REST APIs, MYR payments, cross-border sales from Malaysia, PayPal webhooks, PayPal recurring billing, refunds, reconciliation, or production readiness.

概要

公開者afu-it
リポジトリmalaysia-payment-gateway
スキル名setup-paypal
スター
74
フォーク
11
同梱ファイル
10
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 10個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    afu-itがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルSetup PaypalをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/afu-it/malaysia-payment-gateway/tree/main/setup-paypal
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/afu-it/malaysia-payment-gateway.git /tmp/malaysia-payment-gateway
mkdir -p .claude/skills
cp -r /tmp/malaysia-payment-gateway/setup-paypal .claude/skills/setup-paypal
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでSetup Paypalを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にSetup Paypalを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Setup Paypalは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

PayPal Payment Gateway (Malaysia)

Use this skill for PayPal integration work for a Malaysia-registered PayPal Business account.

Source

Read references/paypal-api.md first. It has the Malaysia scope summary, environments, auth, headers, amount rules, the default checkout flow, statuses, and the full endpoint catalogue.

Then load only what the task needs:

  • references/paypal-orders.md: Orders v2 and Payments v2 field tables, capture checks, PATCH, refunds.
  • references/paypal-webhooks.md: signature verification, headers, events, Webhooks Management API.
  • references/paypal-checkout-js.md: JavaScript SDK v6 and v5, callbacks, server routes.
  • references/paypal-subscriptions.md: products, plans, subscriptions, failure retry.
  • references/paypal-errors-testing.md: error codes, sandbox, test cards, negative testing.
  • references/paypal-reporting-payouts.md: Transaction Search, Payouts (MYR rules), disputes.
  • references/account-setup.md: registration, credentials, env vars, dashboard settings, Malaysian account notes, pricing link.
  • references/source-map.md: which official page backs each fact, coverage, and known gaps.

Core Workflow

  1. Identify environment (sandbox or live) and use matching credentials, host, client ID and Webhook ID.
  2. Identify surface: JS SDK buttons (v6 for new work), server redirect to the approval link, Subscriptions, Payment Links, or Payouts.
  3. Create a local pending payment with amount, MYR (or the chosen currency) and your reference.
  4. Server: get an OAuth token (cache it), then POST /v2/checkout/orders with intent: CAPTURE, custom_id/invoice_id, and a PayPal-Request-Id.
  5. Browser: buyer approves through the SDK or the approve / payer-action link.
  6. Server: POST /v2/checkout/orders/{id}/capture with a PayPal-Request-Id.
  7. Settle only when purchase_units[].payments.captures[].status is COMPLETED and amount, currency and reference match.
  8. Verify every webhook signature over the raw body, deduplicate by event id, re-fetch the order or capture, then settle idempotently.
  9. Handle PENDING captures, INSTRUMENT_DECLINED, reversals, refunds and disputes.

Core Facts

  • REST base: sandbox https://api-m.sandbox.paypal.com, live https://api-m.paypal.com.
  • Token: POST /v1/oauth2/token, Basic auth client_id:secret, body grant_type=client_credentials; use Authorization: Bearer <token> until expires_in.
  • Orders: POST /v2/checkout/orders, GET /v2/checkout/orders/{id}, POST /v2/checkout/orders/{id}/capture, /authorize, PATCH /v2/checkout/orders/{id}.
  • Payments: POST /v2/payments/captures/{id}/refund, GET /v2/payments/captures/{id}, authorization capture, void, reauthorize.
  • Amounts are decimal strings in {"currency_code","value"}; not sen.
  • MYR is supported as payment and balance currency for in-country (Malaysian) PayPal accounts only.
  • Order COMPLETED can still hold a declined payment; check the capture status.
  • Webhook self-verify string: transmission_id|transmission_time|webhook_id|crc32(raw body, decimal), verified with the cert at paypal-cert-url (SHA256withRSA). Postback: POST /v1/notifications/verify-webhook-signature must return verification_status: SUCCESS.
  • Webhook retries: up to 25 times over 3 days for non-2xx. Up to 10 webhook URLs per app.
  • JS SDK v6: https://www.paypal.com/web-sdk/v6/core (sandbox https://www.sandbox.paypal.com/web-sdk/v6/core). v5: https://www.paypal.com/sdk/js?client-id=...&currency=MYR.
  • Authorization: 29-day validity, 3-day honor period. Refund within 180 days of capture.
  • No published rate limit; 429 RATE_LIMIT_REACHED on abuse. Use webhooks, not polling.
  • Not available to Malaysian merchants per the docs: FPX, DuitNow, local e-wallets, Expanded Checkout card fields, card vaulting, Pay Later, PayPal Credit, Venmo. GrabPay via PayPal is Singapore only.

Critical Rules

  • Keep the client secret server-side. Only the client ID goes to the browser.
  • Create and price orders on the server; never trust amounts sent by the browser.
  • Never fulfil from onApprove, a redirect to return_url, or a browser-sent status.
  • Verify webhooks over the raw body bytes with the Webhook ID of the same environment; never re-serialize JSON before CRC32 or postback.
  • Use PayPal-Request-Id on create, capture, authorize and refund; reuse the same ID when retrying a timeout or 5xx.
  • Treat ORDER_ALREADY_CAPTURED as "fetch and settle", not as failure.
  • Keep invoice_id unique per order; duplicates are rejected by default.
  • Match SDK currency and intent to the API order.
  • Set Payment Receiving Preferences so MYR or foreign-currency payments do not sit pending for manual acceptance.
  • Do not use the API for personal payments in Malaysia (PayPal policy).
  • Do not claim local Malaysian methods or Expanded Checkout features for a Malaysian account.

Completion Criteria

A PayPal integration is done only when:

  1. Orders are created and captured server-side with cached OAuth tokens and PayPal-Request-Id.
  2. The browser only returns the order ID; the server decides paid state from the capture response or a verified webhook.
  3. Webhooks are subscribed per environment and verified (self or postback) over the raw body.
  4. Settlement checks order ID, capture ID, capture status, amount, currency, custom_id/invoice_id and environment.
  5. Duplicate webhooks, capture retries, pending captures, reversals and refunds are idempotent.
  6. Tests cover bad signature, replayed event, INSTRUMENT_DECLINED, pending capture, duplicate invoice ID, partial and over refund.
  7. Deployment docs list PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET, PAYPAL_WEBHOOK_ID, API base, webhook URL and sandbox/live separation.

Loophole Review Loop

When asked whether a PayPal strategy is "100% confident", run this loop until no factual gaps remain:

  1. List trust boundaries: browser SDK, return/cancel URLs, server order creator, OAuth token cache, PayPal API, webhook receiver, raw-body parser, cert download, database, fulfilment, refund job, dashboard settings.
  2. Check bypasses: fake onApprove, client-sent amount, forged webhook, re-serialized body, wrong environment Webhook ID, sandbox/live mix, COMPLETED order with declined capture, pending capture fulfilled, duplicate webhook, capture retry without idempotency key, MYR pending manual acceptance, reversal after fulfilment, duplicate refund, cert URL from a non-PayPal host.
  3. Add fixes: server-side pricing, local pending record, capture-status checks, raw-body verification, event ID dedupe, PayPal-Request-Id, environment-scoped config, re-fetch before settle, reversal and dispute handlers.
  4. Re-read the relevant reference file for any gap.
  5. State remaining uncertainty that depends on account eligibility, receiving preferences, fees, PayPal-wallet vaulting for Malaysia, or undocumented fields listed in references/source-map.md.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Setup Paypal」では何ができますか?

Set up, build, debug, review, and explain PayPal payment integrations for Malaysian merchants using official PayPal developer docs, REST API OAuth 2.0, Orders v2 create/capture/authorize, Payments v2 refunds/voids/reauthorization, JavaScript SDK v6 and v5 buttons, webhooks with CRC32 plus SHA256withRSA signature verification or verify-webhook-signature postback, Subscriptions and Catalog Products, Transaction Search, Payouts, disputes, sandbox accounts, test cards, negative testing, MYR rules, and go-live. Use when working with PayPal Checkout, PayPal buttons, PayPal REST APIs, MYR payments...

TypingMindでSetup Paypalを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Setup Paypalはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにSetup Paypalをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/afu-it/malaysia-payment-gateway/tree/main/setup-paypalを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Setup Paypalを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Setup Paypalは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもSetup Paypalを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Setup Paypal」は無料ですか?

afu-itがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇