Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Kibelaの決済の仕組み
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
michiomochi
August 03, 2018
810
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Kibelaの決済の仕組み
michiomochi
August 03, 2018
Transcript
34 slides
KibelaͷܾࡁͷΈ JP_Stripes (Stripe ϢʔβʔάϧʔϓʣTokyo Vol.8 גࣜձࣾϏοτδϟʔχʔ ಓ խՅ - @michiomochi
ಓ խՅ @michiomochi Michikawa Masayoshi ܦྺ 20164݄ Ϗοτδϟʔχʔೖࣾ Kibela։ൃதʂˡ ࠓ͜͜
20144݄ ํσεΫೖࣾ (Cookpadؔ࿈ձࣾ) 2011ʙ ͍ΖΜͳITاۀΛసʑͱ 20094݄ Ϧκʔτೖࣾ (ຊྉཧͬͯ·ͨ͠) גࣜձࣾϏοτδϟʔχʔ
Kibelaͱʁ https://kibe.la
Kibelaͱʁ • ʮݸਓͷൃ৴Λ৫ͷྗʹ͢Δʯͱ͍͏ίϯηϓτͷ ใڞ༗πʔϧ • ओʹձࣾͰΘΕΔ͜ͱΛఆͯ͠࡞͍ͬͯ·͢ • ՈؒͰͷใڞ༗ͱ͍ͯͬͯ͠Δྫ • 5໊·ͰແྉͰ͓͍͍͚ͨͩ·͢
• ͓ؾܰʹ͝ࢼ༻͍ͩ͘͞ʂ • ٕज़ίϛϡχςΟڭҭػؔͷඇӦརஂମͰͷར༻ ਓʹؔΘΒͣແྉͰ͓͍͍͚ͨͩ·͢
None
None
ࠓ͢͜ͱ • KibelaͷྉۚઃܭϙϦγʔ • KibelaͷྉܾۚࡁͷྲྀΕ • ྉܾۚࡁΛͲͷΑ͏ͳΈͰ࣮ݱ͍ͯ͠Δ ͔ • ٻॻ͍ʹରԠ͠Α͏ͱ͍ͯ͠·͢
StripeΛͬͯ৽نSaaSΛ্ཱͪ͛ͨ by @dex1t https://speakerdeck.com/dex1t/kibela-meets-stripe-stripewoshi- tutexin-gui-saaswoli-tishang-getahua-number-jp-stripes
ࠓ͢͜ͱ • KibelaͷྉۚઃܭϙϦγʔ • KibelaͷྉܾۚࡁͷྲྀΕ • ྉܾۚࡁΛͲͷΑ͏ͳΈͰ࣮ݱ͍ͯ͠Δ͔ • ٻॻ͍ʹରԠ͠Α͏ͱ͍ͯ͠·͢
KibelaͷྉۚઃܭϙϦγʔ ͲͷΑ͏ʹߟ͑ྉۚઃܭΛߦ͔ͬͨ
KibelaͷྉۚઃܭϙϦγʔ • ެฏʹ՝ۚ͢Δ • ΞΫηε͕ͳ͍Ϣʔβʔͷར༻ྉٻ͠ͳ͍ • খ͞ͳ৫ΛԠԉ͢Δ • 5໊ҎԼͷνʔϜͣͬͱແྉͰ͑Δ •
ٕज़ίϛϡχςΟڭҭػؔͷඇӦརஂମར༻ਓ ʹؔΘΒͣແྉ • ެฏʹબͯ͠Β͑ΔΑ͏ʹ͢Δ • ଞࣾͱൺֱݕ౼ͯ͠Β͏Α͏ʹ͢Δ ͲͷΑ͏ʹߟ͑ྉۚઃܭΛߦ͔ͬͨ
ࠓ͢͜ͱ • KibelaͷྉۚઃܭϙϦγʔ • ྉܾۚࡁΛͲͷΑ͏ͳΈͰ࣮ݱ͍ͯ͠Δ ͔ • ٻॻ͍ʹରԠ͠Α͏ͱ͍ͯ͠·͢ • KibelaͷྉܾۚࡁͷྲྀΕ
KibelaͷྉܾۚࡁͷྲྀΕ 1. νʔϜͷ࡞ 2. Freeϓϥϯ͔ΒStandardϓϥϯΞοϓάϨʔυ • 2ϲ݄ؒτϥΠΞϧظؒ 3. τϥΠΞϧظ͕ؒऴΘΔͱಉ࣌ʹݱࡏͷϢʔβʔͷྉܾۚ ࡁΛ࣮ߦ
4. ϢʔβʔՃͷʹՃΛཌͷAM 9:00ʹ·ͱΊͯٻ 5. SubscriptionͷకΊ͕͖ͨΒΞΫηεͷͳ͔ͬͨϢʔβʔ ͷྉۚΛKibelaϙΠϯτͰؐݩ 6. 3ʹΓɺҎԼ܁Γฦ͠
ࠓ͢͜ͱ • KibelaͷྉۚઃܭϙϦγʔ • KibelaͷྉܾۚࡁͷྲྀΕ • ٻॻ͍ʹରԠ͠Α͏ͱ͍ͯ͠·͢ • ྉܾۚࡁΛͲͷΑ͏ͳΈͰ࣮ݱ͍ͯ͠Δ͔
ྉܾۚࡁΛͲͷΑ͏ͳΈͰ ࣮ݱ͍ͯ͠Δ͔ ҎԼͷ෦Λհ͠·͢ 4. ϢʔβʔՃͷʹՃΛཌͷAM 9:00ʹ·ͱΊͯٻ 5. SubscriptionͷకΊ͕͖ͨΒΞΫηεͷͳ͔ͬͨϢʔβʔ ͷྉۚΛKibelaϙΠϯτͰؐݩ 1.
νʔϜͷ࡞ 2. Freeϓϥϯ͔ΒStandardϓϥϯΞοϓάϨʔυ 3. τϥΠΞϧظ͕ؒऴΘΔͱಉ࣌ʹݱࡏͷϢʔβʔͷྉܾۚ ࡁΛ࣮ߦ 6. 3ʹΓɺҎԼ܁Γฦ͠
ϢʔβʔՃͷʹՃΛཌͷAM 9:00ʹ ·ͱΊͯٻ ͦͦͳͥ͜Μͳ͜ͱΛ͍ͯ͠Δͷ͔ • KibelaϢʔβʔʹΑΓٻֹ͕มΘΔ • ͭ·Γैྔ՝ۚͷαʔϏε • Ωϟογϡϑϩʔతʹɺ·ͨऔΓͬͺ͙ΕϦεΫΛճආ͢Δ
ͨΊʹઌ͍ʹ͍ͨ͠ • Ωϟογϡϑϩʔత = ͓͕ۚग़དྷΔ͚ͩૣ͘ೖ͖ͬͯͯ΄ ͍͠ • খ͍͞ձࣾʹͱͬͯݱۚΛૣ͘ड͚औΕΔͷඇৗʹେࣄ • ैྔ՝ۚαʔϏεͰઌ͍ʹ͢Δͷ͕ඞཁ
ϢʔβʔՃͷʹՃΛཌͷAM 9:00ʹ ·ͱΊͯٻ • Ϣʔβʔ࡞ͱಉ࣌ʹݱࡏͷPlanͱಉ͡ٻֹͷInvoiceItem Λ࡞ • InvoiceItem࡞͚ͨͩ͠Ͱܾࡁ͞Εͳ͍ • ຖAM
9:00ʹInvoiceItem͕ͳ͍͔֬ೝ͠ɺ͋ΕInvoiceΛ ࡞͢ΔόονΛ࣮ߦ͢Δ • όονͷ࣮ߦʹKuroko2Λ࠾༻ • Invoice͕࡞͞ΕΔͱStripeଆͰҰఆ࣌ؒޙʹܾࡁ͕ߦΘΕ Δ ࣮ݱͷ͔ͨ͠
ϢʔβʔՃͷʹՃΛཌͷAM 9:00ʹ ·ͱΊͯٻ
• web-based job scheduler / workflow engine. • ҰݴͰ͍͏ͱ͍͢͝cron •
δϣϒͷ࣮ߦΛ͏·͍۩߹ʹͬͯ͘ΕΔ • δϣϒͷ࣮ߦ։࢝ɺޭɺࣦഊΛϝʔϧSlackͰ௨͢ Δػೳ͕͋Δ • Web UI͕͋Δ • Web্Ͱδϣϒͷઃఆɺࣦഊͨ͠δϣϒͷϦτϥΠ͕Ͱ͖Δ • ܾࡁͷॏཁͳjobcronͰ࣮ߦ͢Δͷ৺ڐͳ͍ https://github.com/cookpad/kuroko2
https://github.com/cookpad/kuroko2
https://github.com/cookpad/kuroko2
ྉܾۚࡁΛͲͷΑ͏ͳΈͰ ࣮ݱ͍ͯ͠Δ͔ ҎԼͷ෦Λհ͠·͢ 5. SubscriptionͷకΊ͕͖ͨΒΞΫηεͷͳ͔ͬͨϢʔβʔ ͷྉۚΛKibelaϙΠϯτͰؐݩ 1. νʔϜͷ࡞ 2. Freeϓϥϯ͔ΒStandardϓϥϯΞοϓάϨʔυ
3. τϥΠΞϧظ͕ؒऴΘΔͱಉ࣌ʹݱࡏͷϢʔβʔͷྉܾۚ ࡁΛ࣮ߦ 4. ϢʔβʔՃͷʹՃΛཌͷAM 9:00ʹ·ͱΊͯٻ 6. 3ʹΓɺҎԼ܁Γฦ͠
KibelaͷྉۚઃܭϙϦγʔ • খ͞ͳ৫ΛԠԉ͢Δ • 5໊ҎԼͷνʔϜͣͬͱແྉͰ͑Δ • ٕज़ίϛϡχςΟڭҭػؔͷඇӦརஂମར ༻ਓʹؔΘΒͣແྉ • ެฏʹબͯ͠Β͑ΔΑ͏ʹ͢Δ
• ଞࣾͱൺֱݕ౼ͯ͠Β͏Α͏ʹ͢Δ ͲͷΑ͏ʹߟ͑ྉۚઃܭΛߦ͔ͬͨ • ެฏʹ՝ۚ͢Δ • ΞΫηε͕ͳ͍Ϣʔβʔͷར༻ྉٻ͠ͳ͍
SubscriptionͷకΊ͕͖ͨΒΞΫηεͷͳ͔ͬ ͨϢʔβʔͷྉۚΛKibelaϙΠϯτͰؐݩ • StripeʹAccount Balanceͱ͍͏ػೳ͕͋Δ • ܾࡁ͕ߦΘΕΔࡍʹ༏ઌతʹΘΕΔΫϨδοτ • KibelaϙΠϯτ =
Account Balance • SubscriptionͷకΊ͕͖ͯInvoice͕࡞͞ΕͨࡍʹStripe͔ ΒInvoice.created Webhook͕ඈΜͰ͘Δ • Invoice࡞͞Ε͙ܾͯ͢ࡁ͕࣮ߦ͞ΕΔΘ͚Ͱͳ͍ • ܾࡁ͕࣮ߦ͞ΕΔલʹInvoice.createdΛhookͯ͠Account BalanceΛ༩͢Δ ࣮ݱͷ͔ͨ͠
ࠓ͢͜ͱ • KibelaͷྉۚઃܭϙϦγʔ • KibelaͷྉܾۚࡁͷྲྀΕ • ྉܾۚࡁΛͲͷΑ͏ͳΈͰ࣮ݱ͍ͯ͠Δ ͔ • ٻॻ͍ʹରԠ͠Α͏ͱ͍ͯ͠·͢
ٻॻ͍ʹରԠ͠Α͏ͱ͍ͯ͠·͢ ͳΜͰʁ • ·ͩΫϨδοτΧʔυΛ͑ͳ͍ձࣾੈͷதʹͨ͘͞Μ͋ Δ • ελʔτΞοϓΫϨδοτΧʔυΛ͑Δͱ͜Ζଟ͍ • ੲ͔Β͋Δେ͖ͳاۀ͑ͳ͍ͱ͜Ζଟ͍ •
ΫϨδοτΧʔυΛ͑ͳ͍ձࣾ ≒ େ͖ͳձࣾ ͳͷͰ͜͜Λ औΕΔ͜ͱച্ʹେ͖͘ܨ͕Δ • ͭΒͯ͘Δ͔͠ͳ͍
ٻॻ͍ʹରԠ͠Α͏ͱ͍ͯ͠·͢ ࣮ݱํ๏ खಈ…ʁ
ٻॻ͍ʹରԠ͠Α͏ͱ͍ͯ͠·͢
ٻॻ͍ʹରԠ͠Α͏ͱ͍ͯ͠·͢ Docs: https://stripe.com/docs/billing/invoices
ٻॻ͍ʹରԠ͠Α͏ͱ͍ͯ͠·͢ ࣮ݱํ๏ • SubscriptionͷbillingઃఆΛAutomatically ʙ͔ΒEmail ʙมߋ͢Δ • ܾࡁํ๏(ΫϨδοτΧʔυ)͕ొ͞Ε͍ͯͳͯ͘༗ྉProduct มߋͰ͖ΔΑ͏ʹͳΔ •
ࣗಈͰܾࡁ͕ߦΘΕͳ͘ͳΔ • SubscriptionͷకΊʹͳΔͱInvoice͕࡞͞ΕΔ • ࡞͞ΕͨInvoiceΛݟͯٻॻΛ࡞͓͠٬༷ૹ • Stripe͔ΒϝʔϧͰૹΔ͜ͱ͕Ͱ͖Δ • ͕ɺॻྨͰ͘Εͱ͍͏ͱ͜Ζ͋Γͦ͏… • ৼΓࠐ·Ε͔ͨΛۜߦޱ࠲Λݟͯ֬ೝ • खಈʁ • ৼΓࠐ·Ε͍ͯͨΒInvoiceΛMark as paid
ٻॻ͍ʹରԠ͠Α͏ͱ͍ͯ͠·͢
ٻॻ͍ʹରԠ͠Α͏ͱ͍ͯ͠·͢ ͍͍ͱ͜Ζ • ٻॻ͍ʹؔͯ͠Stripe্ཧ͕ग़དྷΔ • ாථ͕StripeͰҰݩཧͰ͖Δ • ͜Ε͕ग़དྷͳ͍ͱStripeͱผͰཧ͢Δඞཁ͕͋ΓͭΒ͍ͱ͜Ζ ͩͬͨ ͳΜͱ͔͍ͨ͠ͱ͜Ζ
• ݱঢ়ɺۜߦʹৼΓࠐ·Εͨ͜ͱͷ֬ೝ͕खಈ͔͠ͳ͍ʁ • billingઃఆ͕Email ʙͷInvoice͕࡞͞Εͨ͜ͱΛͪ͜Β͕ݕ͢Δ ํ๏ • Slack௨ͱ͔͋Δͱخ͍͚͠Ͳ…
ࠓͨ͜͠ͱ • KibelaͷྉۚઃܭϙϦγʔ • KibelaͷྉܾۚࡁͷྲྀΕ • ྉܾۚࡁΛͲͷΑ͏ͳΈͰ࣮ݱ͍ͯ͠Δ ͔ • ٻॻ͍ʹରԠ͠Α͏ͱ͍ͯ͠·͢
͍͞͝ʹ ϏοτδϟʔχʔΤϯδχΞΛେืूதͰ͢ʂʂʂ ҰॹʹKibelaΛ࡞Γ·ͤΜ͔ʁ ڵຯ͕͋Δํ࠙ձͰ͔͚ͯ͠Β͑Δͱ͏Ε ͍͠Ͱ͢ʂ
More Decks by michiomochi
See All by michiomochi
Visaのあれこれを継続的に対応していく体制づくり
michiomochi
0
130
Featured
See All Featured
Optimizing for Happiness
mojombo
378
72k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.6k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
960
Unsuck your backbone
ammeep
672
58k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
How Software Deployment tools have changed in the past 20 years
geshan
3
35k
VelocityConf: Rendering Performance Case Studies
addyosmani
331
25k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
580
Reality Check: Gamification 10 Years Later
codingconduct
0
2.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3.1k
The Cult of Friendly URLs
andyhume
79
7.1k
Technical Leadership for Architectural Decision Making
baasie
4
650