> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paymentoptions.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 3Dセキュア統合

> トランザクションセキュリティを強化するための3Dセキュア認証統合の包括的ガイド。

## **統合手順**

### **ステップ1: 3Dリクエストを送信**

3Dセキュア認証を開始するには、サーバーからサーバーへのリクエストを3Dセキュアエンドポイントに送信します。

***

### **ステップ2: リダイレクトURLを使用**

レスポンスから `redirect_url` を使用して、ブラウザで3Dセキュアページを開きます。

***

### **ステップ3: 3Dセキュア認証完了後**

カード保有者が認証を完了した後、発行者はリクエストを承認または拒否します。結果に基づいて、顧客は提供された `success_url` または `decline_url` にリダイレクトされます。

<CardGroup> <Card title="success_url" icon="shield-check"> 3DS認証が成功した場合、顧客を指定されたページにリダイレクトします。 </Card> <Card title="decline_url" icon="circle-xmark"> 認証が拒否されたり失敗した場合、顧客をリダイレクトします。</Card> </CardGroup>

***

### **ステップ4: Webhook通知**

リダイレクトレスポンスに加えて、ゲートウェイは取引のステータスを確認するために指定した `webhook_url` にWebhook通知を送信します。これにより、顧客が3DSプロセス後にウェブサイトに戻らなくても、取引結果が確実に伝達されます。

#### **Webhookサンプルレスポンス**

```json theme={null}
{
  "success": true,
  "status_code": 200,
  "is_live": false,
  "transaction_type": "CAPTURE",
  "gateway_response": {
    "version": "1",
    "type": "INFO",
    "message": "Payment Successful.",
    "code": "INFO0000"
  },
  "merchant_details": {
    "legal_name": "<merchant name>",
    "mid": "DASMID",
    "merchant_txn_ref": "<merchant_txn_ref>"
  },
  "payment_details": {
    "amount": <amount>,
    "response_code": 0,
    "auth_code": null,
    "currency": "<currency>",
    "payment_method": "",
    "scheme": "VISA",
    "card": {
      "name": "<cardholder’s name>",
      "number": "<card number>",
      "exp_month": "MM",
      "exp_year": "YY"
    },
    "additional_data": {
      "payment_data_source": {
        "type": "card"
      }
    }
  },
  "transaction_details": {
    "id": "<transaction ref Id>",
    "ref": <ref>,
    "timestamp": "YYYY-MM-DDTHH:MM:SS.000Z",
    "merchant_txn_ref": "<merchant_txn_ref>"
  },
  "risk-details": {}
}
```

***

### **ステップ5: 3Dセキュア取引ステータスの取得**

#### **リクエスト属性**

```curl theme={null}
curl --location '<base_URL>/api/v1/server-to-server-interface/transaction/status/<Transaction Ref ID>' \
--header 'Authorization: Basic <API Key>' \
--header 'x-api-key: <x-api-key>' \
--header 'Content-Type: application/json'
```

#### **レスポンス属性**

```json theme={null}
{
    "success": true,
    "status_code": 200,
    "is_live": false,
    "transaction_type": "CAPTURE",
    "gateway_response": {
        "version": "1",
        "type": "INFO",
        "message": "Payment Successful.",
        "code": "INFO0000"
    },
    "merchant_details": {
        "legal_name": "<merchant name>",
        "mid": "<DASMID>",
        "merchant_txn_ref": "<merchant_txn_ref>"
    },
    "payment_details": {
        "amount": <amount>,
        "response_code": 0,
        "responseDescription": "The transaction was completed successfully.",
        "auth_code": null,
        "currency": "<currency>",
        "payment_method": null,
        "scheme": "<scheme>",
        "card": {
            "name": "<cardholder name>",
            "number": "<card_number>",
            "exp_month": "MM",
            "exp_year": "YY"
        },
        "additional_data": {
            "payment_data_source": {
                "type": "card"
            }
        }
    },
    "transaction_details": {
        "id": "<Transaction Ref Id>",
        "ref": <ref>,
        "timestamp": "YYYY-MM-DDTHH:MM:SS.000Z",
        "billing_details": {
            "billing_address": {
                "country": "<country code>",
                "email": "<email>",
                "address1": "<address1>",
                "phone_number": "<phone_number>",
                "city": "<city>",
                "state": "<state>",
                "postal_code": "<postal_code>"
            },
            "shipping_address": {
                "country": "<country code>",
                "email": "<email>",
                "address1": "<address1>",
                "phone_number": "<phone_number>",
                "city": "<city>",
                "state": "<state>",
                "postal_code": "<postal_code>"
            }
        }
    },
    "risk_details": {
        "risk_score": null
    }
}
```

***

## リクエスト属性


## OpenAPI

````yaml api-reference/jp/open-api-config/server-to-server/purchase.json POST /api/v1/server-to-server-interface/paymentv2
openapi: 3.0.1
info:
  title: Payment Options API
  description: ホストされた支払いページ（HPP）リンクを生成し、支払いを処理するためのAPI。
  version: 1.0.0
servers:
  - url: https://api-dev.paymentoptions.com
security:
  - apiKeyAuth: []
    xApiKeyAuth: []
paths:
  /api/v1/server-to-server-interface/paymentv2:
    post:
      summary: 3Dセキュア支払いAPI
      description: 3Dセキュア支払いトランザクションを開始します。
      operationId: process3DSecurePayment
      requestBody:
        description: 3Dセキュア支払いトランザクションを処理するためのリクエストペイロード。
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: string
                  description: 取引の金額。
                  example: '1000'
                currency:
                  type: string
                  description: 商品の処理通貨の略称（例：JPY）。
                  example: JPY
                  maxLength: 3
                card:
                  type: object
                  additionalProperties: false
                  description: カードの詳細を含むJSONオブジェクト。
                  properties:
                    cvc:
                      type: string
                      description: カードのセキュリティコード（ほとんどは3桁、AMEXは4桁）。
                      example: '100'
                      maxLength: 4
                    expiry_month:
                      type: string
                      description: カードの有効期限の月（例：12月の場合は12）。
                      example: '12'
                      maxLength: 2
                    expiry_year:
                      type: string
                      description: カードの有効期限の年（例：29 または 2029 年）。
                      example: '29'
                      maxLength: 4
                    name:
                      type: string
                      description: カードに記載されたカード所有者の名前。
                      example: John Doe
                      maxLength: 255
                    number:
                      type: string
                      description: カード番号。
                      example: '4000002500003155'
                      maxLength: 16
                merchant_txn_ref:
                  type: string
                  description: 加盟店の取引参照ID。
                  example: qwe
                  maxLength: 45
                customer_ip:
                  type: string
                  description: カード所有者のIPアドレス。
                  example: 127.0.0.1
                  maxLength: 45
                merchant_id:
                  type: string
                  description: 加盟店ID（DASMID）。
                  example: < Merchant ID >
                  maxLength: 128
                return_url:
                  type: object
                  additionalProperties: false
                  description: 返却URLを含むJSONオブジェクト。（このフィールドは3DS取引で必須です。）
                  properties:
                    webhook_url:
                      type: string
                      description: WebhookのURLリンク。
                      example: < Webhook url >
                      maxLength: 255
                    success_url:
                      type: string
                      description: 支払い成功後のリダイレクトURL。
                      example: http://www.successurl.com/
                      maxLength: 255
                    decline_url:
                      type: string
                      description: 支払い失敗後のリダイレクトURL。
                      example: http://www.declineurl.com/
                      maxLength: 255
                billing_address:
                  type: object
                  additionalProperties: false
                  description: カード所有者の請求先住所を含むJSONオブジェクト。
                  properties:
                    country:
                      type: string
                      description: カード所有者の請求先国コード。
                      example: JP
                      maxLength: 2
                    email:
                      type: string
                      description: カード所有者の請求先メールアドレス。
                      example: billing@testemail.com
                      maxLength: 45
                    phone_number:
                      type: string
                      description: カード所有者の請求先電話番号。
                      example: '8112345678'
                      maxLength: 20
                    address1:
                      type: string
                      description: カード所有者の請求先住所。
                      example: 1-2-3 Shinjuku
                      maxLength: 199
                    city:
                      type: string
                      description: カード所有者の請求先市区町村。
                      example: Shinjuku-ku
                      maxLength: 65
                    state:
                      type: string
                      description: カード所有者の請求先都道府県。
                      example: Tokyo
                      maxLength: 65
                    postal_code:
                      type: string
                      description: カード所有者の請求先郵便番号。
                      example: '1600022'
                      maxLength: 45
                shipping_address:
                  type: object
                  additionalProperties: false
                  description: カード所有者の配送先住所を含むJSONオブジェクト（オプション）。
                  properties:
                    country:
                      type: string
                      description: カード所有者の配送先国コード。
                      example: JP
                      maxLength: 2
                    email:
                      type: string
                      description: カード所有者の配送先メールアドレス。
                      example: shipping@testemail.com
                      maxLength: 45
                    phone_number:
                      type: string
                      description: カード所有者の配送先電話番号。
                      example: '8112345678'
                      maxLength: 20
                    address1:
                      type: string
                      description: カード所有者の配送先住所。
                      example: 1-2-3 Shinjuku
                      maxLength: 199
                    city:
                      type: string
                      description: カード所有者の配送先市区町村。
                      example: Shinjuku-ku
                      maxLength: 65
                    state:
                      type: string
                      description: カード所有者の配送先都道府県。
                      example: Tokyo
                      maxLength: 65
                    postal_code:
                      type: string
                      description: カード所有者の配送先郵便番号。
                      example: '1600022'
                      maxLength: 45
                browser_info:
                  type: object
                  additionalProperties: false
                  description: カード所有者が使用するブラウザの詳細を含むJSONオブジェクト（オプション）。
                  properties:
                    acceptHeader:
                      type: string
                      description: ブラウザが送信するHTTP Acceptヘッダーの値。
                      example: text/html
                      maxLength: 200
                    screenColorDepth:
                      type: string
                      description: 画面のビット単位のカラーデプス。
                      example: '48'
                      maxLength: 2
                    javaEnabled:
                      type: boolean
                      description: ブラウザでJavaが有効かどうかを示します。
                      example: false
                    language:
                      type: string
                      description: ブラウザの言語（通常はブラウザ設定で指定された言語）。
                      example: en
                      maxLength: 10
                    screenHeight:
                      type: string
                      description: 画面の高さ（ピクセル単位）。
                      example: '1200'
                      maxLength: 5
                    screenWidth:
                      type: string
                      description: 画面の幅（ピクセル単位）。
                      example: '1600'
                      maxLength: 5
                    challengeWindow:
                      type: string
                      description: カード所有者のブラウザがサポートするチャレンジウィンドウのサイズ。
                      example: '4'
                      maxLength: 2
                    userAgent:
                      type: string
                      description: ブラウザのユーザーエージェント文字列。
                      example: Mozilla/4.0 (MSIE 6.0; Windows NT 5.0)
                      maxLength: 500
                time_zone:
                  type: string
                  description: 取引の国別タイムゾーン。
                  example: Asia/Kuala_Lumpur
                  maxLength: 128
              required:
                - amount
                - currency
                - card
                - merchant_txn_ref
                - customer_ip
                - merchant_id
                - billing_address
      responses:
        '200':
          description: 3Dセキュア取引が正常に開始されました
          content:
            application/json:
              schema:
                type: object
                properties:
                  url:
                    type: string
                    description: 3Dセキュア認証ページのURL。
                    example: >-
                      https://checkout-dev.paymentoptions.com/integration/3ds?_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmMmIwMWRhZi1lMWI2LTRlMTYtOGJlOC1hN2YwNTQ1NmQyNWEiLCJpYXQiOjE3Mzc5NTI0MTIsImlzcyI6IjYwMzc4ZjcxNGEwZTg5MTZlMDQ1YjQzOCIsIk9yZ1VuaXRJZCI6IjYwMzc4ZjcxZDk2ODQzM2UyMmIxZTY5NCIsImV4cCI6MTczNzk1NDIxMn0.ytizEgQCt_hQEPn3mdJMAaKjP0L68WiGYkOzD_nHeWI&_c=400000&_a=YXNpYWJpbGw=
                  statusCode:
                    type: integer
                    description: 応答ステータスコード。
                    example: 200
                  success:
                    type: boolean
                    description: 取引が成功したかどうかを示します。
                    example: true
                  redirect_url:
                    type: string
                    description: 3Dセキュア認証のリダイレクトURL。
                    example: >-
                      https://checkout-dev.paymentoptions.com/integration/3ds?_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmMmIwMWRhZi1lMWI2LTRlMTYtOGJlOC1hN2YwNTQ1NmQyNWEiLCJpYXQiOjE3Mzc5NTI0MTIsImlzcyI6IjYwMzc4ZjcxNGEwZTg5MTZlMDQ1YjQzOCIsIk9yZ1VuaXRJZCI6IjYwMzc4ZjcxZDk2ODQzM2UyMmIxZTY5NCIsImV4cCI6MTczNzk1NDIxMn0.ytizEgQCt_hQEPn3mdJMAaKjP0L68WiGYkOzD_nHeWI&_c=400000&_a=YXNpYWJpbGw=
components:
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      name: Authorization
      in: header
      description: 認証のためのAPIキー。形式：'Basic YOUR_API_KEY_HERE'
    xApiKeyAuth:
      type: apiKey
      name: x-api-key
      in: header
      description: x-api-key専用のAPIキー。

````