---
title: "PayPal 決済を組み込む（エージェント用スキル） | Orchestor"
description: "エクスプレスチェックアウト、サブスクリプション、返金管理に対応する PayPal 決済を組み込みます。PayPal 決済の実装、オンライン取引の処理、EC サイトの購入手続きの構築に使用します。wshobson/agents が公開している「PayPal 決済を組み込む」の使い方を確認できます。"
canonical_url: "https://www.orchestor.io/ja/skills/wshobson/agents/paypal-integration"
markdown_url: "https://www.orchestor.io/ja/skills/wshobson/agents/paypal-integration.md"
---

[c96b5f6](https://github.com/wshobson/agents/commit/c96b5f6552dba32e4492307493ee613581430715)[原文を開く](https://github.com/wshobson/agents/blob/c96b5f6552dba32e4492307493ee613581430715/plugins/payment-processing/skills/paypal-integration/SKILL.md)

wshobson2026/11/24

原文 (選択中)

未翻訳

プレビュー (選択中)

156 行（空行を除く 120 行） · 3.92 KB原文

```yaml
name: paypal-integration
description: Integrate PayPal payment processing with support for express checkout, subscriptions, and refund management. Use when implementing PayPal payments, processing online transactions, or building e-commerce checkout flows.
```

# PayPal Integration

Master PayPal payment integration including Express Checkout, IPN handling, recurring billing, and refund workflows.

## When to Use This Skill

* Integrating PayPal as a payment option
* Implementing express checkout flows
* Setting up recurring billing with PayPal
* Processing refunds and payment disputes
* Handling PayPal webhooks (IPN)
* Supporting international payments
* Implementing PayPal subscriptions

## Core Concepts

### 1\. Payment Products

**PayPal Checkout**

* One-time payments
* Express checkout experience
* Guest and PayPal account payments

**PayPal Subscriptions**

* Recurring billing
* Subscription plans
* Automatic renewals

**PayPal Payouts**

* Send money to multiple recipients
* Marketplace and platform payments

### 2\. Integration Methods

**Client-Side (JavaScript SDK)**

* Smart Payment Buttons
* Hosted payment flow
* Minimal backend code

**Server-Side (REST API)**

* Full control over payment flow
* Custom checkout UI
* Advanced features

### 3\. IPN (Instant Payment Notification)

* Webhook-like payment notifications
* Asynchronous payment updates
* Verification required

## Quick Start

```javascript
// Frontend - PayPal Smart Buttons
<div id="paypal-button-container"></div>
​
<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&currency=USD"></script>
<script>
  paypal.Buttons({
    createOrder: function(data, actions) {
      return actions.order.create({
        purchase_units: [{
          amount: {
            value: '25.00'
          }
        }]
      });
    },
    onApprove: function(data, actions) {
      return actions.order.capture().then(function(details) {
        // Payment successful
        console.log('Transaction completed by ' + details.payer.name.given_name);
​
        // Send to backend for verification
        fetch('/api/paypal/capture', {
          method: 'POST',
          headers: {'Content-Type': 'application/json'},
          body: JSON.stringify({orderID: data.orderID})
        });
      });
    }
  }).render('#paypal-button-container');
</script>
```

```python
# Backend - Verify and capture order
from paypalrestsdk import Payment
import paypalrestsdk
​
paypalrestsdk.configure({
    "mode": "sandbox",  # or "live"
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET"
})
​
def capture_paypal_order(order_id):
    """Capture a PayPal order."""
    payment = Payment.find(order_id)
​
    if payment.execute({"payer_id": payment.payer.payer_info.payer_id}):
        # Payment successful
        return {
            'status': 'success',
            'transaction_id': payment.id,
            'amount': payment.transactions[0].amount.total
        }
    else:
        # Payment failed
        return {
            'status': 'failed',
            'error': payment.error
        }
```

## Detailed patterns and worked examples

Detailed pattern documentation lives in details.md. Read that file when the navigation tier above is insufficient.

## Testing

```python
# Use sandbox credentials
SANDBOX_CLIENT_ID = "..."
SANDBOX_SECRET = "..."
​
# Test accounts
# Create test buyer and seller accounts at developer.paypal.com
​
def test_payment_flow():
    """Test complete payment flow."""
    client = PayPalClient(SANDBOX_CLIENT_ID, SANDBOX_SECRET, mode='sandbox')
​
    # Create order
    order = client.create_order(10.00)
    assert 'id' in order
​
    # Get approval URL
    approval_url = next((link['href'] for link in order['links'] if link['rel'] == 'approve'), None)
    assert approval_url is not None
​
    # After approval (manual step with test account)
    # Capture order
    # captured = client.capture_order(order['id'])
    # assert captured['status'] == 'COMPLETED'
```

## Structured data

```json
[
  [
    {
      "@context": "https://schema.org",
      "@type": "Organization",
      "name": "Orchestor",
      "url": "https://www.orchestor.io",
      "sameAs": [
        "https://orchestor.io",
        "https://www.orchestor.io",
        "https://docs.orchestor.io"
      ],
      "@id": "https://www.orchestor.io/#organization",
      "alternateName": [
        "オーケスター"
      ],
      "logo": "https://www.orchestor.io/images/common/ogp/orchestor-ogp.png",
      "parentOrganization": {
        "@type": "Organization",
        "name": "ドットメディア株式会社",
        "url": "https://www.dotmedia.co.jp"
      }
    },
    {
      "@context": "https://schema.org",
      "@type": "WebSite",
      "url": "https://www.orchestor.io",
      "name": "Orchestor",
      "description": "Orchestor で画像・動画・音声を作り、参照素材を Remix できます。",
      "@id": "https://www.orchestor.io/#website",
      "alternateName": [
        "オーケスター"
      ],
      "inLanguage": "ja",
      "publisher": {
        "@id": "https://www.orchestor.io/#organization"
      }
    }
  ],
  {
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    "@id": "https://www.orchestor.io/skills/wshobson/agents/paypal-integration#breadcrumb",
    "itemListElement": [
      {
        "@type": "ListItem",
        "position": 1,
        "name": "Orchestor",
        "item": "https://www.orchestor.io/"
      },
      {
        "@type": "ListItem",
        "position": 2,
        "name": "スキル",
        "item": "https://www.orchestor.io/skills"
      },
      {
        "@type": "ListItem",
        "position": 3,
        "name": "PayPal 決済を組み込む",
        "item": "https://www.orchestor.io/skills/wshobson/agents/paypal-integration"
      }
    ]
  }
]
```

---

[Documentation index](https://www.orchestor.io/llms.txt)
