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
JP_Stripes 福岡 Vol.4 - 新入社員がカード決済に取り組んだ話
Search
shimomo
September 12, 2018
Technology
0
63
JP_Stripes 福岡 Vol.4 - 新入社員がカード決済に取り組んだ話
shimomo
September 12, 2018
Tweet
Share
More Decks by shimomo
See All by shimomo
JP_Stripes Connect 2019 - 新卒エンジニアの苦悩
shimomo
0
1.2k
Other Decks in Technology
See All in Technology
AWS Lambda のトラブルシュートをしていて思うこと
kazzpapa3
2
170
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
2
430
誰も全体を知らない ~ ロールの垣根を超えて引き上げる開発生産性 / Boosting Development Productivity Across Roles
kakehashi
1
220
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
120
The Role of Developer Relations in AI Product Success.
giftojabu1
0
120
Evangelismo técnico: ¿qué, cómo y por qué?
trishagee
0
360
インフラとバックエンドとフロントエンドをくまなく調べて遅いアプリを早くした件
tubone24
1
430
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.6k
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
150
AWS Media Services 最新サービスアップデート 2024
eijikominami
0
190
いざ、BSC討伐の旅
nikinusu
2
780
Featured
See All Featured
For a Future-Friendly Web
brad_frost
175
9.4k
Side Projects
sachag
452
42k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Writing Fast Ruby
sferik
627
61k
Visualization
eitanlees
145
15k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
How GitHub (no longer) Works
holman
310
140k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Speed Design
sergeychernyshev
24
610
Adopting Sorbet at Scale
ufuk
73
9.1k
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Λ͑ Χʔυܾࡁ͘Β͍ͳΜͱ͔ͳΔ
͓͠·͍