Skip to main content

はじめに

Microsoft Teams integration は Dodo Payments のイベントを Adaptive Cards として Teams チャネルに投稿するため、チームは支払い、サブスクリプションの変更、dispute を発生時に確認できます。Teams をビジネスチームの業務場所として利用している場合に使用してください。
このガイドでは、Microsoft Teams ワークスペースで webhook を作成するための管理者アクセス権があることを前提としています。

始め方

1

Open the Webhook Section

Dodo Payments ダッシュボードで、Developer → Webhooks に移動し、Add endpoint をクリックします。
Add endpoint dialog with Teams selected in the Integration dropdown
2

Select Microsoft Teams

Integration リストで Teams を選択します。
3

Create Teams Webhook

Microsoft は Teams の Office 365 Incoming Webhook connectors を廃止したため、Workflows app を使用して webhook を作成します。
  1. Teams で、通知を受信するチャネルを開きます。
  2. チャネル名の横にある ⋯ をクリックし、Workflows を選択します。
  3. Post to a channel when a webhook request is received テンプレートを選択します。
  4. team とチャネルを確認し、Add workflow をクリックします。
  5. Teams に表示される webhook URL をコピーします。
4

Paste Webhook URL

Teams webhook URL を Endpoint URL フィールドに貼り付けます。
5

Customize Transformation

Transformation code の下にあるコードを編集し、各イベントを Adaptive Card としてフォーマットします。以下の例を参考にしてください。
6

Test & Create

Test this code でサンプル payload に対して transformation を実行し、Create endpoint をクリックします。
7

Done

Teams チャネルで Dodo Payments のイベントを Adaptive Cards として受信できるようになります。

Transformation Code Examples

各例では、event payload を 1 つの Adaptive Card attachment を含む Teams message に置き換えます。

Basic Payment Card

この例では、支払いが成功した際に amount、customer email、payment ID を投稿します。
payment_card.js

Subscription Management

この例では、subscription が active になったときに 1 つの card を投稿し、cancelled になったときに別の card を投稿します。
subscription_card.js

Dispute Alerts

この例では、すべての dispute.* event に対して card を投稿します。dispute の結果が勝訴または敗訴になると、title と color が変わります。
dispute_card.js

Tips

  • リッチでインタラクティブなフォーマットには Adaptive Cards を使用します。
  • 意味に応じて色を選択します:Good(green)、Warning(yellow)、Attention(red)。
  • fact sets は短く、読みやすく保ちます。
  • endpoint を実際に使用する前に、その Testing タブを開き、Send example をクリックしてサンプル card をチャネルに投稿します。

Troubleshooting

  • webhook URL が正しく、workflow が有効になっていることを確認します。
  • transformation が有効な Adaptive Card JSON を返すことを確認します。
  • workflow にチャネルへの投稿権限があることを確認します。
  • Test this code で transformation を実行し、結果を Adaptive Card schema と照合します。
  • 必須フィールドがすべて存在することを確認します。
  • color values が有効であることを確認します。例:Default、Good、Warning、Attention。
最終更新日 2026年9月26日