Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
SAEVと学ぶ開発ワークフローとStripeのキャッチアップ
Search
MAGI
January 06, 2025
30
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SAEVと学ぶ開発ワークフローとStripeのキャッチアップ
MAGI
January 06, 2025
More Decks by MAGI
See All by MAGI
みゃ?
magisystem0408
0
58
Barth Of TimiNeko Story
magisystem0408
0
49
Connected CI Schema Driven Development
magisystem0408
0
80
【Amplify × IoT連携】電気自動車(EV)チャージングステーションシステムの紹介
magisystem0408
0
120
kargoの魅力について伝える
magisystem0408
0
530
Featured
See All Featured
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
6
1.2k
Six Lessons from altMBA
skipperchong
29
4.5k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
2
320
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
610
Claude Code どこまでも/ Claude Code Everywhere
nwiizo
68
58k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
3
4.3k
Practical Orchestrator
shlominoach
192
12k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
550
A Modern Web Designer's Workflow
chriscoyier
699
190k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
620
Rebuilding a faster, lazier Slack
samanthasiow
85
9.7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Transcript
SAEVと学ぶ開発ワークフローとStripeのキャッチアップ Masato Matsudo
マツド マサト ( ヒト )
SAEV(spark-x)とは何か? 駐⾞場にEV充電を従量課⾦でできるようにするシステム
SAEV(spark-x)とは何か? ・ユーザーが、ある場所の充電スタンドを起動して充電を開始する。 ・充電終了時、利⽤した電気料を計算して⾃動的に決済が⾛る。 →決済開始と実際に引き落とせるタイミングが違う。
サーキットブレーカー →これをAPIから制御を⾏う。
None
開発ワークフローで気おつけてる点
・サービスの⽣命線の明⽂化 ・コードを⾒なくても全体の処理がわかるような図
サービスの⽣命線の明⽂化 課題: git cloneしてきた時にサービスをどこまで動かせば良いかわからない。 解決策: ユーザーがサービスを使⽤して使⽤が終わるまでの明⽂化を⼊れる。
サービスの⽣命線の明⽂化 ⻑くなりすぎず、簡潔にまとめる。 saev-charge/E2E.md
コードを⾒なくても全体の処理がわかるような図 いきなりコードを書かずにまずは解答の⽅針だてをする。
コードを⾒なくても全体の処理がわかるような図 → ゴニョゴニョ ちょっとずつ図式化する。
✅ いきなりコードではなく図か何かでflow chartを書く
3つのLambdaで学ぶStripe
Stripeについて Stripeの最低決済料⾦は JPYだと50円から バックエンド⽤のStripeとフロントエンド⽤のStripe clientがある。 実装で困ったらstripe-nodeのtypesを⾒れば良い。 https://github.com/stripe/stripe-node/tree/master/types
サービスを⽀える三種の神器 ・api-start-ev-charge-resolver 充電を開始するためにStripeにオーダーをするlambda イメージ 決済などのEventが⾛ったらそれをTriggerとして起動するLambda 実際の充電時間量を計算して、引き落としをするLambda ・api-end-ev-charge-resolver ・api-stripe-webhook-trigger-resolver
None
実装する時に CheckOutで終わるか? Intentまで必要か? → Checkoutの⽅が簡単。Intentはなんでもできる。
Stripe Checkout バックエンドでSessionを発⾏ SessionのIDからstripeのマネージドの決済に⾶ぶ api-start-ev-charge-resolver
⚠ StripeのIDとCognitoUserのIDを紐付ける EmailからStripeIDを作る PostConfirmationTriggerで承認が取れたユーザーのみ cognito Custom UserAttributeに⼊れる。
なんでもできる。Intent。 どれだけの時間充電してたのかを計算して登録したカードから決済する。 ・api-end-ev-charge-resolver
決済が成功なり失敗なりするとwebhookが⾶ぶ stripe webhook SecretでTriggerを検証する
Checkoutで終わるのか? Intentで終わるのか?
応⽤問題 ・subscriptionは、Checkoutでできるか?Intentでできるか? 実装する時に必要な開発項⽬
終わり。