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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
shiro seike
PRO
October 17, 2023
Programming
480
0
Share
決済のその先へ、顧客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
More Decks by shiro seike
See All by shiro seike
Why Continue AWS Community Builders
seike460
PRO
0
61
AWSコミュニティ活動は顧客のクラウド推進に効くのか / Do AWS community activities help customers adopt the cloud?
seike460
PRO
0
170
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
250
AI-DLC 入門 〜AIコーディングの本質は「コード」ではなく「構造」〜 / Introduction to AI-DLC: The Essence of AI Coding Is Not “Code” but “Structure”
seike460
PRO
0
890
今さら聞けないサーバーレスのいいところ 〜運用から解放される世界を目指して〜 / The Benefits of Serverless You Might Be Too Embarrassed to Ask About Now — Aiming for a World Free from Operational Burdens
seike460
PRO
0
95
AWS Lambda Durable Functions のユースケースを探る / Exploring Use Cases for AWS Lambda Durable Functions
seike460
PRO
0
85
歴史から学ぶ「Why PHP?」 PHPを書く理由を改めて理解する / Learning from History: “Why PHP?” Rediscovering the Reasons for Writing PHP
seike460
PRO
0
470
Team-First Serverless Platform Engineering Approach to PHP Applications with Laravel and Bref
seike460
PRO
1
150
地方だからできる!コミュニティ参加と登壇を続ける意義 / “It’s Possible Because We’re in a Regional Area!” The Significance of Continuing to Participate in and Speak at Community Events
seike460
PRO
0
24
Other Decks in Programming
See All in Programming
Programming with a DJ Controller — not vibe coding
m_seki
3
850
SkillsをS3 Filesに置く時のあれこれ
watany
3
1.6k
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
3
930
GoogleCloudとterraform完全に理解した
terisuke
1
200
Firefoxにコントリビューションして得られた学び
ken7253
2
160
AlarmKitで明後日起きれるアラームアプリを作る
trickart
0
140
20260514 - build with ai 2026 - build LINE Bot with Gemini CLI
line_developers_tw
PRO
0
440
Road to RubyKaigi: Play Hard(ware)
makicamel
1
570
Sans tests, vos agents ne sont pas fiables
nabondance
0
110
AI Agent と正しく分析するための環境作り
yoshyum
2
480
From Formal Specification to Property Based Test
ohbarye
0
2.6k
AIを導入する前にやるべきこと
negima
2
360
Featured
See All Featured
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
190
Ethics towards AI in product and experience design
skipperchong
2
270
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
We Have a Design System, Now What?
morganepeng
55
8.1k
Building Adaptive Systems
keathley
44
3k
How to make the Groovebox
asonas
2
2.2k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
280
Music & Morning Musume
bryan
47
7.2k
We Are The Robots
honzajavorek
0
230
Utilizing Notion as your number one productivity tool
mfonobong
4
300
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
130
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
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/