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
SAEVと学ぶ開発ワークフローとStripeのキャッチアップ
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
MAGI
January 06, 2025
22
0
Share
SAEVと学ぶ開発ワークフローとStripeのキャッチアップ
MAGI
January 06, 2025
More Decks by MAGI
See All by MAGI
みゃ?
magisystem0408
0
49
Barth Of TimiNeko Story
magisystem0408
0
20
Connected CI Schema Driven Development
magisystem0408
0
67
【Amplify × IoT連携】電気自動車(EV)チャージングステーションシステムの紹介
magisystem0408
0
100
kargoの魅力について伝える
magisystem0408
0
510
Featured
See All Featured
The SEO identity crisis: Don't let AI make you average
varn
0
480
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.5k
Testing 201, or: Great Expectations
jmmastey
46
8.2k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
260
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
A Tale of Four Properties
chriscoyier
163
24k
30 Presentation Tips
portentint
PRO
1
310
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
410
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
190
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.9k
How to train your dragon (web standard)
notwaldorf
97
6.7k
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でできるか? 実装する時に必要な開発項⽬
終わり。