Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Stripe CLI Presentation
Search
Kenta Labur
April 23, 2021
Education
0
79
Stripe CLI Presentation
「StripeCLI のキホン」
@Stripe Deep Dive Session Vol.5
21.04.22
Kenta Labur
April 23, 2021
Tweet
Share
Other Decks in Education
See All in Education
Use Cases and Course Review - Lecture 8 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
1.4k
HCI Research Methods - Lecture 7 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
1.3k
HTML5 and the Open Web Platform - Lecture 3 - Web Technologies (1019888BNR)
signer
PRO
2
3.2k
いわゆる「ふつう」のキャリアを歩んだ人の割合(若者向け)
hysmrk
0
310
XML and Related Technologies - Lecture 7 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
AIで日本はどう進化する? 〜キミが生きる2035年の地図〜
behomazn
0
110
滑空スポーツ講習会2025(実技講習)EMFT学科講習資料/JSA EMFT 2025
jsaseminar
0
220
The World That Saved Me: A Story of Community and Gratitude
_hashimo2
3
510
あなたの言葉に力を与える、演繹的なアプローチ
logica0419
1
270
【洋書和訳:さよならを待つふたりのために】第2章 ガン特典と実存的フリースロー
yaginumatti
0
220
Activité_5_-_Les_indicateurs_du_climat_global.pdf
bernhardsvt
0
140
AWS re_Invent に全力で参加したくて筋トレを頑張っている話
amarelo_n24
2
120
Featured
See All Featured
Building Flexible Design Systems
yeseniaperezcruz
330
40k
The World Runs on Bad Software
bkeepers
PRO
72
12k
How STYLIGHT went responsive
nonsquared
100
6k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
21k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
170
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
63
Crafting Experiences
bethany
1
46
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.8k
Color Theory Basics | Prateek | Gurzu
gurzu
0
190
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
Transcript
Stripe CLI のキホン
2 Software Engineer, Stripe ラボール健太
Agenda Stripe CLI 開発の背景 基本機能 Live Demo 3 1 2
3
4 Seller Stripe の基本導入例 支払い /charges Visa JCB Mastercard ...
• /charges API を利用した決済実行フロー • 従来は決済の実行結果が success/fail の2択 ◦ Success:フルフィルメントを実行 ◦ Fail:エラーを表示
決済の複雑化 5 テクノロジー 3D セキュア VISA セキュア 決済文化 モバイル決済 地域特有の決済方法
規制 PSD2/SCA(本人認証) GDPR(EU データ保護規則)
6 6 事例:3D セキュア
7 • 決済フローに本人確認ステップ、他サイトへのリダイレクトが入る • 時差が生じるため同期処理のみでは対応しにくい 7 決済に非同期処理が発生する
• Stripe 側が決済のイベントを通知 • サービス側で受信、イベントデータを 処理して決済の状況を追う ◦ succeeded:フルフィルメン ト ◦
payment_failed:エラー 8 Webhooks
9 • Stripe が直接叩ける Webhook エンドポイント(公開URL)が必要 • Webhook エンドポイントと開発環境をつなげる作業が必要 ◦
Tunneling ソフト(ngrok 等)が必要になる • テスト用に webhook イベントを送信したい • 全体的に Developer Experience が微妙 9 Webhooks 開発の難点
10 • 当初は webhook 開発のニーズに応えるために開発 • Webhook エンドポイント、tunneling は Stripe
CLI に丸投げできる • Webhook 開発周りのことは大体できる ◦ Webhook event 送受信 ◦ Stripe 側の API リクエストを 監視 • Stripe API にリクエストを送る 10 Stripe CLI の誕生
Agenda Stripe CLI 開発の背景 基本機能 Live Demo 11 1 3
2
12 • Webhook event の受信、転送 • テストWebhook event の送信 •
log tail でリクエストを監視 • Stripe リソースコマンド (RPC-like) • Stripe API に対しリクエストを実行 (curl-like) 12 Stripe CLI機能一覧
13 • Homebrew (MacOS/Linux/WSL), Scoop (Windows) • .deb/.rpm、各種 OS 用バイナリ
• Docker イメージ • Open Source 13 Stripe CLIのインストール
14 • Stripe アカウントの紐付けが必要 ◦ ブラウザ上でログイン、API キーを付与 ◦ Interactive:CLI 上で
API キーやデバイス名を管理 ◦ Headless:CLI に渡すオプションや環境変数で API キーを定義 14 Stripe CLI Configuration
Agenda Stripe CLI 開発の背景 基本機能 Live Demo 15 3 2
1
Thank you!