Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Stripe CLI Presentation

Stripe CLI Presentation

「StripeCLI のキホン」
@Stripe Deep Dive Session Vol.5
21.04.22

Kenta Labur

April 23, 2021
Tweet

Other Decks in Education

Transcript

  1. 4 Seller Stripe の基本導入例 支払い /charges Visa JCB Mastercard ...

    • /charges API を利用した決済実行フロー • 従来は決済の実行結果が success/fail の2択 ◦ Success:フルフィルメントを実行 ◦ Fail:エラーを表示
  2. 9 • Stripe が直接叩ける Webhook エンドポイント(公開URL)が必要 • Webhook エンドポイントと開発環境をつなげる作業が必要 ◦

    Tunneling ソフト(ngrok 等)が必要になる • テスト用に webhook イベントを送信したい • 全体的に Developer Experience が微妙 9 Webhooks 開発の難点
  3. 10 • 当初は webhook 開発のニーズに応えるために開発 • Webhook エンドポイント、tunneling は Stripe

    CLI に丸投げできる • Webhook 開発周りのことは大体できる ◦ Webhook event 送受信 ◦ Stripe 側の API リクエストを 監視 • Stripe API にリクエストを送る 10 Stripe CLI の誕生
  4. 12 • Webhook event の受信、転送 • テストWebhook event の送信 •

    log tail でリクエストを監視 • Stripe リソースコマンド (RPC-like) • Stripe API に対しリクエストを実行 (curl-like) 12 Stripe CLI機能一覧
  5. 13 • Homebrew (MacOS/Linux/WSL), Scoop (Windows) • .deb/.rpm、各種 OS 用バイナリ

    • Docker イメージ • Open Source 13 Stripe CLIのインストール
  6. 14 • Stripe アカウントの紐付けが必要 ◦ ブラウザ上でログイン、API キーを付与 ◦ Interactive:CLI 上で

    API キーやデバイス名を管理 ◦ Headless:CLI に渡すオプションや環境変数で API キーを定義 14 Stripe CLI Configuration