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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
46
Connected CI Schema Driven Development
magisystem0408
0
78
【Amplify × IoT連携】電気自動車(EV)チャージングステーションシステムの紹介
magisystem0408
0
110
kargoの魅力について伝える
magisystem0408
0
530
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
41
2.7k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
What does AI have to do with Human Rights?
axbom
PRO
1
2.4k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
YesSQL, Process and Tooling at Scale
rocio
174
15k
KATA
mclloyd
PRO
35
15k
Building the Perfect Custom Keyboard
takai
2
870
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
Building AI with AI
inesmontani
PRO
1
1.2k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
500
Site-Speed That Sticks
csswizardry
13
1.5k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
550
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でできるか? 実装する時に必要な開発項⽬
終わり。