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, Stripe as a customer DB
Search
shiro seike
PRO
October 17, 2023
Programming
0
280
決済のその先へ、顧客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
Cloudflare Workers x AWS Lambdaの組み合わせユースケース / Cloudflare Workers x AWS Lambda Combination Use Case
seike460
PRO
2
310
技術力を高め合う “開けた”企業間コミュニティの形成 / Formation of an "open" inter-company community to enhance technological capabilities
seike460
PRO
1
66
有効な使い方を正しく理解して実装する PHP8.3の最新機能の「ウラ側」 / Understanding and Implementing Effective Usage Correctly The "Uraside" of PHP 8.3's Latest Features
seike460
PRO
1
74
有効な使い方を正しく理解して実装する PHP8.3の最新機能 / Proper understanding and implementation of effective usage Latest features in PHP 8.3
seike460
PRO
2
280
事例から見るサーバーレスの効果 / Serverless Effectiveness as Seen in Case Studies
seike460
PRO
1
91
Secure Serverless Architecture
seike460
PRO
2
560
地方こそサーバーレス、その意義に迫るサーバーレスPHP / Serverless PHP: The Rural Areas, and Why Serverless PHP Matters
seike460
PRO
2
180
サーバーレスらしさを意識した AWSにおける開発手法 / Development methodologies in AWS that are serverless-like
seike460
PRO
1
75
OpenAPIを中心に考えるAPI開発入門 / Introduction to API Development with a Focus on OpenAPI
seike460
PRO
3
470
Other Decks in Programming
See All in Programming
iOSアプリでクリップボードにコピーしたことをユーザーに伝えるちょうど良いフィードバックを探す
ski
0
100
CSC307 Lecture 11
javiergs
PRO
0
240
AWSでゲームサーバーを運用! Amazon GameLiftのお話
iriikeita
0
200
20240706_CDKConf
takuyay0ne
0
1.2k
APIのない大学ログインWebサービスをWKWebViewとJavaScriptでアプリ化した話
akidon0000
1
330
3 Effective Rules for Success with Signals in Angular
manfredsteyer
PRO
0
120
유연한 Composable 설계
l2hyunwoo
0
380
Trial
cairolibrary720
1
130
Product Management LT会_クアンド新家
shinshin
0
250
The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform | droidcon Berlin
prof18
0
110
Findy - エンジニア向け会社紹介 / Findy Letter for Engineers
findyinc
2
81k
開発部に不満を持っていたCSがエンジニアにジョブチェンしてわかった「勝手に諦めない」ことの大切さ
sakuraikotone
28
16k
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
16
1.6k
Designing Experiences People Love
moore
136
23k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
24
1.8k
What’s in a name? Adding method to the madness
productmarketing
PRO
21
2.9k
Infographics Made Easy
chrislema
238
18k
Faster Mobile Websites
deanohume
303
30k
Web Components: a chance to create the future
zenorocha
307
41k
Producing Creativity
orderedlist
PRO
340
39k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
29
2.5k
A Philosophy of Restraint
colly
200
16k
Mobile First: as difficult as doing things right
swwweet
219
8.8k
Bash Introduction
62gerente
607
210k
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/