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

Mackerel and Stripe / Qiita x Stripe Meetup

astj
PRO
April 12, 2019

Mackerel and Stripe / Qiita x Stripe Meetup

astj
PRO

April 12, 2019
Tweet

More Decks by astj

Other Decks in Technology

Transcript

  1. Mackerel and Stripe
    2019/04/12 Qiita x Stripe Meetup
    Asato WAKISAKA (Hatena)

    View Slide

  2. Asato WAKISAKA (GitHub: @astj)
    ͸ͯͳ ΞϓϦέʔγϣϯΤϯδχΞ
    Mackerel ։ൃνʔϜ (2016/08~)
    Mackerel ςοΫϦʔυ (2018/05~)

    View Slide

  3. Mackerel

    View Slide

  4. View Slide

  5. View Slide

  6. View Slide

  7. View Slide

  8. • 2014೥ϦϦʔεͷʮαʔόʔ؂ࢹαʔϏεʯ
    • ೔ʑΞΫςΟϒʹ։ൃத
    • ܧଓతͳ৽ػೳϦϦʔε
    • ແྉͰ΋ར༻Մೳ
    • ϑϧػೳʹ͸༗ྉϓϥϯͷܖ໿͕ඞཁ

    View Slide

  9. View Slide

  10. Mackerel ͱܾࡁ

    View Slide

  11. • ຖ݄ͷར༻࣮੷ʹԠͨ͡ैྔ՝ۚ
    • ར༻͍ͯ͠Δϗετ୆਺ʢͳͲʣͷҠಈฏۉ
    • ελϯμʔυϗετ1୆/1݄͋ͨΓ1800ԁ
    • ܾࡁखஈ: جຊతʹΫϨδοτΧʔυ
    • => ΫϨδοτΧʔυܾࡁʹ Stripe

    View Slide

  12. Stripe
    Mackerel
    Stripe.js v2
    Mackerel JS
    Token Customer
    Token
    CardNumber, etc
    Token

    View Slide

  13. 3/1 4/1
    ݄͝ͱͷ୆਺Ҡಈฏۉ

    View Slide

  14. Stripe
    Payments
    Mackerel
    Charge.create(
    amount: 2*1800,
    customer: "XXX"
    )
    ݄ॳόον

    View Slide

  15. • ϘϦϡʔϜσΟεΧ΢ϯτͳͲಛผ৚݅͋Γ
    • ੥ٻॻ෷͍͋Γ
    • ࠓ͸ΫϨδοτΧʔυͱ͸ผޱͰूܭ

    View Slide

  16. Mackerel ͱܾࡁαʔϏε

    View Slide

  17. • ݱࡏ͸ΫϨδοτΧʔυܾࡁ͸ Stripe ܦ༝
    • ࣮͸ Stripe ͕3ࣾ໨ (2019/02~)

    View Slide

  18. • αʔϏεϩʔϯν࣌఺
    • ಛʹUSDܾࡁͰ Stripe ΋બ୒ࢶʹ
    • JPYܾࡁͷΈͱͷ൑அ: WebPay Λબ୒
    • (2014: Stripe ͷ೔ຊਐग़લ)
    2014

    View Slide

  19. • WebPay αʔϏεऴྃ
    • ಉ͡ࠒ Stripe ೔ຊ্཮
    • JCB ܾࡁ͕ඞཁ: PayJp Λબ୒
    • 2018೥࣌఺Ͱ໿10%͕ JCB
    2016~2017

    View Slide

  20. • Stripe JCB ରԠʂʂʂʂʂ
    • ຬΛ࣋ͯ͠ Stripe ΁Ҡߦ
    2018~19

    View Slide

  21. ܾࡁαʔϏεΛҠߦ͢Δ

    View Slide

  22. • See Stripe docs !
    • https://stripe.com/docs/
    security/data-migrations

    View Slide

  23. • ৽αʔϏεͰͷܾࡁϩδοΫ࣮૷
    • ސ٬σʔλͷҠ؅
    • ܾࡁઌͷ੾Γ׵͑
    • ϨϙʔςΟϯάͷ࠶ߏங

    View Slide

  24. • ࠔΔ͜ͱ͸ͦΜͳʹͳ͔ͬͨ
    • ϓϦϛςΟϒͳػೳͰ࣮ݱ͍ͯͨ͠
    • ෳ਺ͷܾࡁαʔϏεΛಉ࣌ʹѻ͏͜ͱ͕
    Մೳͳઃܭʹͳ͍ͬͯͨ
    ΤϯυϢʔβʔ޲͚ͷػೳҠߦ

    View Slide

  25. • (چސ٬ id) => (৽ސ٬ id) ͷϚοϐϯά͕ඞཁ
    • αʔϏεؒͰσʔλҠߦ => ϚοϐϯάΛड͚औΔ
    • ࣄۀऀؒͷεέδϡʔϧௐ੔͕ඞཁɹ
    • ҠߦޙܾࡁͰ͖ͳ͘ͳͬͨͷ͸1%ఔ౓
    ސ٬σʔλͷσʔλҠߦ

    View Slide

  26. ৽نސ٬ 1BZ+Q
    طଘސ٬ 1BZ+Q
    ܾࡁ 1BZ+Q

    View Slide

  27. ৽نސ٬ 4USJQF
    طଘސ٬ 1BZ+Q
    ܾࡁ 4USJQF1BZ+Q

    View Slide

  28. ৽نސ٬ 4USJQF
    طଘސ٬ NJHSBUJPO

    ܾࡁ QFOEJOH

    View Slide

  29. ৽نސ٬ 4USJQF
    طଘސ٬ 4USJQF
    ܾࡁ 4USJQF

    View Slide

  30. • ച্ɺೖۚͷαΠΫϧ͕มԽ͢Δ
    • ΧʔυϒϥϯυʹΑͬͯ΋ҟͳΔʂ
    • όοΫΦϑΟεͱௐ੔ɺ࣮૷
    όοΫΦϑΟεͱͷ࿈ܞ

    View Slide

  31. • Ҡߦ͸੔ཧͷ޷ػͱଊ͑Δ
    • Ϩϙʔτ಺༰ɾ࣌ظΛ࠶ઃܭ͢Δ

    View Slide

  32. • ʮച্ΛకΊΔλΠϛϯάͰച্ͷ಺༁͕஌Γ͍ͨʂʯ
    • => Stripe ଆͷܾࡁҰཡ
    • ʮͦͷച্͕͍ͭೖۚ͞ΕΔ༧ఆͳͷ͔ʯΛؚΊΔ
    • ʮೖۚͷλΠϛϯάͰͦͷೖۚͷ಺༁͕஌Γ͍ͨʂʯ
    • => Stripe ଆͷೖۚ಺༁
    ʮ͍ͭɺͲͷ਺ࣈ͕ඞཁʁʯ

    View Slide

  33. ݄ച্"""ԁ
    ݄ೖۚ༧ఆQQQԁ
    ݄ೖۚ༧ఆRRRԁ
    ݄ച্###ԁ
    ݄ೖۚ༧ఆSSSԁ
    ݄ೖۚ༧ఆTTTԁ
    ݄ೖۚ:::ԁ
    ݄ച্RRRԁ
    ݄ച্SSSԁ
    ݄ೖۚ999ԁ
    ݄ച্PPPԁ
    ݄ച্QQQԁ

    View Slide

  34. • Ϛελσʔλ͸ Stripe ͷ API
    • ͳΜͰ΋औΕΔʂ
    • ඞཁͳ௥Ճ৘ใ͸ܾࡁ࣌఺ͰϝλσʔλʹؚΊΔ
    • ʮϗετ୆਺ʯʮ૊৫໊ʯetc
    • API ܦ༝ͰϨϙʔτΛ࡞੒
    • ޙॲཧΛՃ͔͑ͯΒόοΫΦϑΟεʹఏग़

    View Slide

  35. Ҡߦ͠·ͨ͠

    View Slide

  36. Stripe
    Mackerel
    Stripe.js v2
    Mackerel JS
    CardNumber, etc
    Token
    Token
    Token Customer
    ࠶ܝ

    View Slide

  37. Stripe
    Payments
    Mackerel
    Customer.charge(
    amount: 2*1800,
    customer: "XXX"
    )
    ݄ॳόον
    ࠶ܝ

    View Slide

  38. • ࠓͷͱ͜ΖStripe ΛඇৗʹϓϦϛςΟϒʹ࢖͍ͬͯΔ
    • Stripe ར༻ͱ͍͏ελʔτϥΠϯʹ
    • ͳΔ΂ͦ͘ͷ··Ҡߦ͢Δ͜ͱΛ༏ઌ
    • ΑΓϦονͳιϦϡʔγϣϯʹ΋໪࿦ڵຯ͕͋Δʂʂ
    • Elements / Billing
    • ࣮ࡍ Elements ΁ͷҠߦΛ·͞ʹ࣮ࢪத

    View Slide

  39. • ܧଓతʹαʔϏεશମΛվળ͍ͯ͘͠
    • ܾࡁػೳ΋"੟Ҭ" ʹ͠ͳ͍
    • ϢʔβʔɺϏδωεɺόοΫΦϑΟε
    SaaS ఏڙऀͱͯ͠

    View Slide

  40. • ๛෋ͳػೳɾվળͷԸܙΛड͚͍ͯ͘
    • ࠓޙͷ·͢·͢ͷύϫʔΞοϓʹظ଴
    • ࠷ۙ͸੥ٻॻʹ஫໨͍ͯ͠·͢
    SaaS ར༻ऀͱͯ͠

    View Slide

  41. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠

    View Slide