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
81
【Amplify × IoT連携】電気自動車(EV)チャージングステーションシステムの紹介
magisystem0408
0
120
kargoの魅力について伝える
magisystem0408
0
530
Featured
See All Featured
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
540
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
280
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Site-Speed That Sticks
csswizardry
13
1.6k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
WENDY [Excerpt]
tessaabrams
14
40k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
540
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
630
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Agile that works and the tools we love
rasmusluckow
331
22k
4 Signs Your Business is Dying
shpigford
187
23k
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でできるか? 実装する時に必要な開発項⽬
終わり。