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
MAGI
January 06, 2025
0
8
SAEVと学ぶ開発ワークフローとStripeのキャッチアップ
MAGI
January 06, 2025
Tweet
Share
More Decks by MAGI
See All by MAGI
みゃ?
magisystem0408
0
17
Barth Of TimiNeko Story
magisystem0408
0
7
Connected CI Schema Driven Development
magisystem0408
0
37
【Amplify × IoT連携】電気自動車(EV)チャージングステーションシステムの紹介
magisystem0408
0
55
kargoの魅力について伝える
magisystem0408
0
390
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
47
14k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Scaling GitHub
holman
459
140k
Raft: Consensus for Rubyists
vanstee
140
7k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
16
940
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
5
210
The Cult of Friendly URLs
andyhume
79
6.5k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Measuring & Analyzing Core Web Vitals
bluesmoon
7
490
Making the Leap to Tech Lead
cromwellryan
134
9.3k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
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でできるか? 実装する時に必要な開発項⽬
終わり。