Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
JP_Stripes 福岡 Vol.4 - 新入社員がカード決済に取り組んだ話
shimomo
September 12, 2018
Technology
0
38
JP_Stripes 福岡 Vol.4 - 新入社員がカード決済に取り組んだ話
shimomo
September 12, 2018
Tweet
Share
More Decks by shimomo
See All by shimomo
JP_Stripes Connect 2019 - 新卒エンジニアの苦悩
shimomo
0
780
Other Decks in Technology
See All in Technology
Steps toward self-service operations in eureka
fukubaka0825
0
490
Babylon.jsで3DViewerを作ってみた!!!
iwaken71
1
930
街じゅうを"駅前化"する電動マイクロモビリティのシェアサービス「LUUP」のIoTとSRE
0gm
1
560
目と耳を持った自然言語処理 - スタートアップにおける価値創出のために
yag_ays
PRO
0
530
AWSの基礎を学ぼうで学んだ9種類のDBを勝手にふりかえる
98lerr
2
720
srenext2022-skaru
mixi_engineers
0
460
キャッチアップ Android 13 / Catch up Android 13
yanzm
2
1.1k
ISUCON で使えるツールを作った
shotakitazawa
0
350
Adopting Kafka for the #1 job site in the world
ymyzk
1
330
testing journey / Increase sensitivity to minor changes
aki_moon
1
100
SRENEXT2022 組織にSREを実装していくまでの道のり
marnie0301
1
290
jaws-ug-asa-datasync-20220510
hiashisan
0
470
Featured
See All Featured
Art Directing for the Web. Five minutes with CSS Template Areas
malarkey
196
9.4k
What the flash - Photography Introduction
edds
61
9.9k
What’s in a name? Adding method to the madness
productmarketing
11
1.5k
Documentation Writing (for coders)
carmenhchung
48
2.5k
How GitHub Uses GitHub to Build GitHub
holman
465
280k
Designing the Hi-DPI Web
ddemaree
272
32k
Build The Right Thing And Hit Your Dates
maggiecrowley
19
1.1k
Product Roadmaps are Hard
iamctodd
34
6.1k
A Modern Web Designer's Workflow
chriscoyier
689
180k
Building Applications with DynamoDB
mza
83
4.6k
Large-scale JavaScript Application Architecture
addyosmani
499
110k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
37
3.2k
Transcript
৽ೖࣾһ͕Χʔυܾࡁʹ औΓΜͩ JP_Stripes Ԭ Vol.4
ࣗݾհ • ࢤໟɹ༐Ұɹʢ͠ɹΏ͏͍ͪʣ • גࣜձࣾίϜɾΞϯυɾίϜ • ৽ଔೖࣾɹ1 • Stripeྺɹ1͔݄
৽ೖࣾһͰStripeΛ͑ Χʔυܾࡁ͘Β͍؆୯ʹ Ͱ͖ͪΌ͏ͬͯ
ͱStripeͷೃΕॳΊ
20187݄
͕ࣾൃͨ͠ݴ༿
ΧʔυܾࡁʹରԠ͠Ζʂ
ଞਓࣄ
͔͠͠
গਫ਼Ӷ
ͳΜ͔Μ͋ͬͯ ͕Δ͜ͱʹ
৽ೖࣾһʹ ܾࡁγεςϜΛߏஙͤ͞Δ ΠΧͨ͠ΠΧΕͨձࣾ
ఏࣔ͞Εͨ։ൃ݅
Stripe
ͦΕ͚ͩ
ͭ·Γ
ࣗ༝
͔͠͠
͔Βͳ͍͜ͱ͕ ͍ͬͺ͍
αʔϏεͷ ՝ۚϞσϧʁ
StripeͬͯԿʁ
ௐͨ
ֹ݄՝ۚΒ͍͠
ֹۚ = ୯Ձ × ར༻ऀ
ͱΓ͋͑ͣStripeͰ ͬͯΈΔ
Subscription
ݒ೦͕1ͭ
ࣄલʹ՝ֹۚΛ ઃఆ͢Δ͜ͱͰ͖ͳ͍
Ͳ͏͢Δʁ
ैྔ՝ۚʁ
͍
Webhook
Make adjustments to an invoice when it's created (but before
it's been paid)
ܾࡁલͷٻॻʹ ߲ΛՃ͢Ε͑͑Μ
ຖ݄0ԁͰܾࡁ͢Δ SubscriptionΛސ٬ຖʹઃఆ
ຖ݄0ԁͷٻॻ͕࡞
invoice.created ඈΜͰ͘Δ
Invoice Created "{ "data": { "object": { "id": "in_00000000000000", //
ٻॻͷID "object": "invoice", "amount_due": 0, "amount_paid": 0, "amount_remaining": 0, "currency": "jpy", "customer": "cus_00000000000000", // ސ٬ͷID
ٻॻͷ߲Λ࡞ InvoiceItem <?php \Stripe\InvoiceItem::create([ 'amount' => ʢ୯Ձ × ར༻ऀʣ, 'invoice'
=> ‘in_00000000000000', // ٻॻͷID 'customer' => ‘cus_00000000000000', // ސ٬ͷID 'currency' => 'jpy', 'description' => 'ֹ݄අ༻', ]);
ͬͨͥ
ͱ͍͏͜ͱͰ
WebhookΛ͑ ԿͰͰ͖Δؾ͕ͯ͘͠Δ
ͬͱྑ͍ํ๏͋ͬͨΒ ڭ͍͑ͯͩ͘͞
৽ೖࣾһͰStripeΛ͑ Χʔυܾࡁ͘Β͍ͳΜͱ͔ͳΔ
͓͠·͍