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
決済のその先へ、顧客DBとして考えるStripe / Beyond payments, Str...
Search
shiro seike
PRO
October 17, 2023
Programming
0
350
決済のその先へ、顧客DBとして考えるStripe / Beyond payments, Stripe as a customer DB
JP_Stripes 大阪 Vol.7 - 新サービス開発・収益化を加速するStripe活用法
https://jpstripes.connpass.com/event/294284/
shiro seike
PRO
October 17, 2023
Tweet
Share
More Decks by shiro seike
See All by shiro seike
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
61
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
510
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
1.1k
実践サーバーレスパフォーマンスチューニング ~その実力に迫る~ / Practical Serverless Performance Tuning ~A Close Look at its Power~
seike460
PRO
2
350
PHPを書く理由、PHPを書いていて良い理由 / Reasons to write PHP and why it is good to write PHP
seike460
PRO
5
590
AWS CDKを用いたセキュアなCI/CDパイプラインの構築 / Build a secure CI/CD pipeline using AWS CDK
seike460
PRO
3
750
いまあるチームにフィットさせる Serverless そして Platform Engineeringへの挑戦 / Serverless Fits the Team You Have and Platform Engineering
seike460
PRO
2
2.1k
いまあるチームにフィットさせる Serverless / Serverless fits in with the team you have now.
seike460
PRO
2
180
地方こそサーバーレス! チームにフィットさせるサーバーレス / Rural areas are serverless! Serverless to Fit Your Team
seike460
PRO
1
120
Other Decks in Programming
See All in Programming
Symfony Mapper Component
soyuka
2
730
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.3k
menu基盤チームによるGoogle Cloudの活用事例~Application Integration, Cloud Tasks編~
yoshifumi_ishikura
0
110
testcontainers のススメ
sgash708
1
120
Итераторы в Go 1.23: зачем они нужны, как использовать, и насколько они быстрые?
lamodatech
0
620
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
ソフトウェアの振る舞いに着目し 複雑な要件の開発に立ち向かう
rickyban
0
890
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
fs2-io を試してたらバグを見つけて直した話
chencmd
0
220
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
103 Early Hints
sugi_0000
1
220
Haze - Real time background blurring
chrisbanes
1
500
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Speed Design
sergeychernyshev
25
670
Docker and Python
trallard
41
3.1k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
5
440
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
Unsuck your backbone
ammeep
669
57k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Transcript
DB Stripe JP_Stripes 大 Vol. 7 ・ Stripe 用 2
0 23 . 10 . 17 @seike 4 60 1
自己 @seike 46 0 - - @seike 46 0 -
AWS Community Builder Serverless - Fusic - / 門 - / - - PHP Japan - JAWS Days AWS Dev Day - Serverless Days Tokyo - - JP_Stripes - PHP 2023 行 長 - JAWS Festa 行 - Cloudflare Meet-up Fukuoka Serverless Meetup Fukuoka Fukuoka.php Fukuoka.go 2
Agenda 1 . 2 . 3 . 4 . DB
Stripe 3
01
https://fusic.co.jp/works/ 4 7 用 自 自 手 行 行 自
行 x SaaS 5
PHP Web 用
02
- Windows 人 手 自 行 - 用 行 Linux
- - - 用 用 - Stripe 用 入 8
入力 Email 入力 Stripe Payment Links 築 9
10
03
12 入力 行 Amazon S 3 Stripe Payment Links Stripe
行 Web hook 用 築
Web Amazon S 3 13 入力 OrderID 自 UUID 生
- API OrderID 生 - OrderID - OrderID JSON - OrderID.kaiseki OrderID.json OrderID Key 築 Amazon S 3 … Cloudfront … CDN AWS Lambda … FaaS
Event( ) -> Amazon S 3 14 行 JSON OrderID.json
-> OrderID OrderID -> OrderID.kaiseki 入 力 用 行 AWS Fargate … Amazon EventBridge …
http 15 Amazon S 3 入力 Email Stripe Payment Links
Payment Link 入 OrderID -> client_reference_id Email -> prefilled_email Email 人 OrderID Amazon SES … Email
Payment Links 16 Stripe 行 Payment Links 築 client_reference_id =
OrderID prefilled_email = Email 行 Webhook 築
築 築 17 Web hook 用 築 Payload OrderID Email
入 OrderID 築 生
Stripe 用 Webhook Webhook 言 SDK 非 18 <?php \Stripe\Stripe::setApiKey(
‘ sk_test_hoge … hoge'); $endpoint_secret = ‘ whsec_hoge … hoge ; $payload = @file_get_contents('php://input'); $sig_header = $_SERVER['HTTP_STRIPE_SIGNATURE']; $event = null; try { $event = \Stripe\Webhook::constructEvent( $payload, $sig_header, $endpoint_secret ); } catch(\UnexpectedValueException $e) { // Invalid payload http_response_code( 400 ); exit(); } catch(\Stripe\Exception\SignatureVerificationException $e) { // Invalid signature http_response_code( 400 ); exit(); }
04 DB
DB Stripe DB API AWS 高 DB 20 Stripe 用
21 Stripe Email OrderID Email OrderID OrderID 文 Stripe 築
Email 面
Stripe 22 AWS Amplify 用 Stripe DB 用 - Payment
Links 文 - Email AWS Amplify …
PaymentLink -> CheckOut 23 Email PaymentLink CheckOut 示
Stripe 用 24
Email 25
Email 用 26
customer 用 27
Checkout Session clientReferenceId = OrderID 28
URL 用 行 29
面 30 Email = Email 面 AWS Amplify
二 31
AWS Amplify Cognito 32 Next.js Email AWS Amplify 用 Amazon
Cognito 用 面 Amazon Cognito …
API Stripe 33 Amazon Cognito Email Stripe sessions 文 ->
OrderId
Stripe Stripe Session -> OrderId 34 Stripe ID Session OrderID
文
35 Next API NEXT_PUBLIC env Stripe AWS Lambda build
API Lambda
Stripe 用 DB DB SaaS 非 用 SaaS 手 36
Thank You We are Hiring ! https://recruit.fusic.co.jp/