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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
shiro seike
PRO
October 17, 2023
Programming
0
460
決済のその先へ、顧客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
歴史から学ぶ「Why PHP?」 PHPを書く理由を改めて理解する / Learning from History: “Why PHP?” Rediscovering the Reasons for Writing PHP
seike460
PRO
0
370
Team-First Serverless Platform Engineering Approach to PHP Applications with Laravel and Bref
seike460
PRO
0
61
なぜ適用するか、移行して理解するClean Architecture 〜構造を超えて設計を継承する〜 / Why Apply, Migrate and Understand Clean Architecture - Inherit Design Beyond Structure
seike460
PRO
3
1k
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
490
地方のPHPerもクラウドを使う理由 ~コストの最適化とチームに向き合う~ / Why even local PHPers use the cloud ~optimize costs and face the team
seike460
PRO
0
99
OpenTelemetryで始めるベンダーフリーなobservability / Vendor-free observability starting with OpenTelemetry
seike460
PRO
0
250
AIコーディングの本質は“コード“ではなく“構造“だった / The essence of AI coding is not “code” but "structure
seike460
PRO
2
1.4k
OpenTelemetryを活用したObservability入門 / Introduction to Observability with OpenTelemetry
seike460
PRO
2
1.1k
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
510
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
400
AI駆動開発の本音 〜Claude Code並列開発で見えたエンジニアの新しい役割〜
hisuzuya
4
500
How to stabilize UI tests using XCTest
akkeylab
0
110
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
130
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
2
550
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
370
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
4
720
15年目のiOSアプリを1から作り直す技術
teakun
1
620
Windows on Ryzen and I
seosoft
0
250
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
700
GC言語のWasm化とComponent Modelサポートの実践と課題 - Scalaの場合
tanishiking
0
100
AHC061解説
shun_pi
0
350
Featured
See All Featured
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
150
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
82
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
140
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
630
Are puppies a ranking factor?
jonoalderson
1
3.1k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
67
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.8k
Writing Fast Ruby
sferik
630
63k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
480
How to make the Groovebox
asonas
2
2k
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
77
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/