Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Stripe Billingで価格改訂 v2

Stripe Billingで価格改訂 v2

JP_Stripes kyoto

Hidetaka Okamoto

November 21, 2018
Tweet

More Decks by Hidetaka Okamoto

Other Decks in Programming

Transcript

  1. S t r i p e B i l l

    i n g Ͱ Ձ ֨ վ గ J P _ S t r i p e s K y o t o N o v. 2 0 1 8
  2. H i d e t a k a O k

    a m o t o • Digitalcube Co. Ltd. • JP_Stripesژ౎ɾେࡕ • Alexa Campions • AWS Samurai 2017 in Japan
  3. h t t p s : / / b i

    t . l y / 2 B 4 B p n D
  4. · ͱ Ί A g e n d a •

    Stripe BillingͰͷSaaSϓϥϯ؅ཧ • BillingͷPlanͰมߋͰ͖Δ஋ɾมߋͰ͖ͳ͍஋ • Ձ֨վగͷϙΠϯτ • Be Openness!
  5. A g e n d a • Stripe BillingͰͷSaaSϓϥϯ؅ཧ •

    BillingͷPlanͰมߋͰ͖Δ஋ɾมߋͰ͖ͳ͍஋ • Ձ֨վగͷϙΠϯτ • Be Openness!
  6. B i l l i n g : ఆ ظ

    ࢧ ෷ ͍ ͷ ͨ Ί ͷ ι Ϧ ϡ ʔ γ ϣ ϯ h t t p s : / / s t r i p e . c o m / u s / b i l l i n g
  7. ෳ ਺ ϓ ϥ ϯ ɾ ै ྔ ՝ ۚ

    ɾ ૊ Έ ߹ Θ ͤ ͳ Ͳ ͕ Մ ೳ h t t p s : / / s t r i p e . c o m / u s / b i l l i n g
  8. ༻ ޠ Λ ͬ͟ ͘ Γ ͓ ͞ Β ͍

    • Billing: StripeͷαʔϏε໊ • Product: ఆظࢧ෷͍ͷ঎඼৘ใ • Plan: ఆظࢧ෷͍ͷͨΊͷ՝ۚ৘ใ • Subscription: Ϣʔβʔͱͷܖ໿ • Invoice: Subscribe͍ͯ͠ΔPlanʹԠͯ͡ൃߦ͞ΕΔ੥ٻ
  9. A M I M O T O / S h

    i f t e r Ͱ ͷ ࢖ ͍ ํ • Product: ϓϥϯͷ੍ݶ஋Λϝλσʔλʹอଘ • Plan: Month / Annual & JPY / USDͰͦΕͧΕϓϥϯΛ࡞੒ͯ͠ • Subscription: Hosting( + Option)ͰSubscribe • Invoice: ੥ٻ೔͸ἧ͑ͣɺSubscribeͨ͠λΠϛϯά͔Β։࢝
  10. A g e n d a • Stripe BillingͰͷSaaSϓϥϯ؅ཧ •

    BillingͷPlanͰมߋͰ͖Δ஋ɾมߋͰ͖ͳ͍஋ • Ձ֨վగͷϙΠϯτ • Be Openness!
  11. C D N Φ ϓ γ ϣ ϯ ͷ ྉ

    ۚ Λ ஋ Լ ͛ h t t p s : / / j a . a m i m o t o - a m i . c o m / a m i o m o t o - m a n a g e d - h o s t i n g - c d n - o p t i o n - 3 3 - p e rc e n t - p r i c e - d ro p /
  12. P l a n ͷ Ձ ֨ Λ ม ͑

    ͨ Β ऴ Θ Γ ͡ Ό Ͷʁ
  13. A P I υ Ω ϡ ϝ ϯ τ Λ

    ݟ Δ h t t p s : / / s t r i p e . c o m / d o c s / a p i / p l a n s / u p d a t e ? l a n g = c u r l
  14. S t r i p e p l a n

    Ͱ u p d a t e Ͱ ͖ Δ ΋ ͷ • active - ༗ޮԽɾແޮԽ • metadata - ϝλσʔλ • nickname - χοΫωʔϜʢද໊ࣔʣ • product - ؔ࿈͚ͮΔProduct • trial_period_days - τϥΠΞϧظؒ
  15. S t r i p e p l a n

    Ͱ u p d a t e Ͱ ͖ ͳ ͍ ΋ ͷ • ௨՟ • Ձ֨ • ظؒ • etc… • ੥ٻ಺༰͕มΘΔ΋ͷ͸جຊߋ৽ෆՄʢͷ༷ࢠʣ
  16. A g e n d a • Stripe BillingͰͷSaaSϓϥϯ؅ཧ •

    BillingͷPlanͰมߋͰ͖Δ஋ɾมߋͰ͖ͳ͍஋ • Ձ֨վగͷϙΠϯτ • Be Openness!
  17. S t r i p e B i l l

    i n g Ͱ ͷ Ձ ֨ վ గ ͸ ̎ ύλ ʔϯ • PlanΛ࡞Γ௚͠ -> SubscriptionΛߋ৽ • ৽͘͠Product / PlanΛ࡞੒ -> ৐Γ׵͑Λଅͭͭ͠طଘ͚ͩϑΥϩʔ
  18. P l a n Λ ࡞ Γ ௚ ͠ -

    > S u b s c r i p t i o n Λ ߋ ৽ • ͍ΘΏΔՁ֨վగ͸͜ͷ΍ΓํʹͳΔ • UPDATEͰ͖ͳ͍ͷͰɺDELETE -> CREATE͢Δ • planΛDELETEͯ͠΋طଘͷsubscriptionʹ͸Өڹͳ͠ • طଘͷsubscription΁ͷ൓ө͸UPDATE subscription͕ඞཁ • ൺྫ഑෼ͷ৔߹ɺUPDATE subscription͸Ұؾʹ
  19. ৽ ͠ ͘ P ro d u c t /

    P l a n Λ ࡞ ੒ - > ৐ Γ ׵ ͑Λ ଅ ͭ͠ ͭ ط ଘ ͩ ͚ ϑ Υ ϩ ʔ • ܞଳͷϓϥϯͱ͔͸͜Εͷҹ৅ • چϓϥϯ͸planΛফͯ͠৽نsubscribeͰ͖ͳ͘͢Δ • ৽ن͸৽ϓϥϯɾطଘ͸چϓϥϯͱ͍͏ӡ༻͕ՄೳʹͳΔ • ੾Γସ͑࣌ظ͕Ϣʔβʔ࣍ୈʹ • ظݶΛ੾ͬͯɺظݶ೔ա͗ͨΒࣗಈͰ৽ϓϥϯ੾Γସ͑ͱ͍͏ख΋
  20. T i p s • ಉҰͷplan idͰߋ৽͢Δ͜ͱ΋ՄೳʢDELETE -> CREATEʣ •

    ͦͷ৔߹΋طଘͷsubscription͸DELETE͞ΕͨϓϥϯΛࢀর͢Δ • ϓϥϯ਺͕ଟ͍ͱ࿙Ε΍ϥά͕ͰΔͷͰεΫϦϓτԽਪ঑
  21. T i p s • ಉҰͷplan idͰߋ৽͢Δ͜ͱ΋ՄೳʢDELETE -> CREATEʣ •

    ͦͷ৔߹΋طଘͷsubscription͸DELETE͞ΕͨϓϥϯΛࢀর͢Δ • ϓϥϯ਺͕ଟ͍ͱ࿙Ε΍ϥά͕ͰΔͷͰεΫϦϓτԽਪ঑
  22. A M I M O T O ͷ ߋ ৽

    ʹ ࢖ ͬ ͨ π ʔϧ ʢ ࣗ ࡞ ʣ h t t p s : / / w w w. n p m j s . c o m / p a c k a g e / @ h i d e o k a m o t o / f i l l e t
  23. ࢖ ͍ ํ # Πϯετʔϧ $ npm i -g @hideokamoto/fillet

    # ηοτΞοϓ $ fillet init {STRIPE_SK_KEY}
  24. ϓ ϩ μΫ τ Ұ ཡ ( - o Ͱ

    ΤΫ ε ϙ ʔ τ ) $ fillet billing list-products { "object": "list", "data": [ { "id": "prod_DGWldswlJ3M5cb", "object": “product", $ fillet billing list-products -o Export file: products.json
  25. S t r i p e ্ ͱ ͷ D

    i ff Λ Έ Δ ʢ b i l l i n g d i ff - p l a n s ʣ $ fillet billing diff-plans -n ./product.yml - [] + [ + { + "active": true, + "amount": 10000, + "currency": "jpy", + "id": "my-plan", + "interval": "month", + "nickname": "ςετ" + } +]
  26. b i l l i n g i m p

    o r t - p ro d u c t Ͱ Π ϯ ϙ ʔ τ $ fillet billing import-product -n ./product.yml Import product:: prod_D0McCs8dStiX1Z plan created:my-plan Finished
  27. b i l l i n g i m p

    o r t - p ro d u c t - f Ͱ ڧ ੍ ߋ ৽ $ fillet billing import-product -n ./product.yml -f Import product:: prod_D0McCs8dStiX1Z [Replace]: my-plan [Replace]:starting to delete my-plan plan deleted:my-plan [Replace]:starting to create new plan plan created:my-plan [Replace]:replace new plan: my-plan Finished
  28. ਓ ப ื ू த h t t p s

    : / / w w w. n p m j s . c o m / p a c k a g e / @ h i d e o k a m o t o / f i l l e t
  29. S h i f t e r / A M

    I M O T O Ͱ ࢖ ͏ ΋ ͷ Λ ڞ ௨ Խ h t t p s : / / w w w. n p m j s . c o m / p a c k a g e / s t r i p e - u t i l s
  30. ߋ ৽ ೔ · Ͱ ͋ ͱ 3 0 ೔

    ʹ ͳ ͬ ͨ ϓ ϥ ϯ Λ ந ग़ h t t p s : / / w w w. n p m j s . c o m / p a c k a g e / s t r i p e - u t i l s
  31. d e c l i n e ͷ આ ໌

    จ Λ ί ʔ υ ͔ Β ௐ ΂ Δ h t t p s : / / w w w. n p m j s . c o m / p a c k a g e / s t r i p e - u t i l s
  32. A g e n d a • Stripe BillingͰͷSaaSϓϥϯ؅ཧ •

    BillingͷPlanͰมߋͰ͖Δ஋ɾมߋͰ͖ͳ͍஋ • Ձ֨վగͷϙΠϯτ • Be Openness!
  33. ࣗ ෼ ͕ ᪴ ͍ ͨ ͱ ͜ Ζ ͸

    ɺ ଟ ෼ ୭ ͔ ΋ ᪴ ͍ͯ Δ
  34. ࣗ ෼ ͕ ᪴ ͍ ͨ ͱ ͜ Ζ ͸

    ɺ ଟ ෼ ୭ ͔ ΋ ᪴ ͍ͯ Δ
  35. ࣗ ෼ ͕ ᪴ ͍ ͨ ͱ ͜ Ζ ͸

    ɺ ଟ ෼ ୭ ͔ ΋ ᪴ ͍ͯ Δ - > ͦ ͷ ୭ ͔ ͕ ڭ ͑ͯ͘Ε ͨ Βʁ
  36. G e t I n v o l v e

    d : ࢀ Ճ ͢ Δ ɾ ר ͖ ࠐ · Ε Δ h t t p s : / / m a k e . w o rd p re s s . o rg /
  37. ࢀ Ճ ͢ Δ ํ ๏ ͸ ͍ Ζ ͍

    Ζ • ৘ใͷൃ৴ʢ #JP_Stripes ʣ • ϥΠϒϥϦɾπʔϧɾOSSͳͲͷ։ൃɾެ։ • ຋༁ • ίϛϡχςΟͷ্ཱͪ͛ɾӡӦ • etc…
  38. h t t p s : / / w w

    w. s l i d e s h a re . n e t / t k o n p a r u / 2 0 1 6 0 3 1 2 - j a w s - d a y s - 2 0 1 6 - k e y n o t e
  39. 1 0 0 ճ ͷ ࢀ Ճ Α Γ 1

    ճ ͷ ొ ஃ h t t p s : / / k i t e re t z . c o m / 1 /
  40. · ͱ Ί • Stripe Billing͸Product + PlanͰSaaSͷྉۚϓϥϯ͕؅ཧͰ͖Δ • BillingͷPlan͸੥ٻʹؔ͢Δ৘ใΛߋ৽Ͱ͖ͳ͍

    • Ձ֨վగͰ͸ͳ͘৽ϓϥϯʹ͢Δͷ΋खɻ੾Γସ͑WFͱ૬ஊ • ϊ΢ϋ΢ɾࣦഊஊ͸ڞ༗ͯͦ͜͠ຏ͔ΕΔ