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

Stripe Connectを導入して得られた知見 part2

Takayuki
March 08, 2019

Stripe Connectを導入して得られた知見 part2

Stripe Connectを導入して得られた知見 part2
今回は実際に実装した話です!

Takayuki

March 08, 2019
Tweet

More Decks by Takayuki

Other Decks in Technology

Transcript

  1. Stripe ConnectΛಋೖͯ͠ ಘΒΕͨ஌ݟ

  2. 1 ձࣾ঺հɾࣗݾ঺հ 2 Stripeಋೖʹࢸͬͨഎܠ Agenda 3 Stripe ConnectΛಋೖ͢ΔϝϦοτ 4 ࣮૷ํ๏

  3. 1 ձࣾ঺հɾࣗݾ঺հ

  4. 4 ࣗݾ঺հ ◆໊લ ླ໦ ޹೭(Suzuki Takayuki) ◆ࣗݾ঺հ ɾ1990೥ɺਆಸ઒ݝੜ·Εɻ ɾࣾձਓʹͳ͔ͬͯΒɺϓϩάϥϛϯάΛ࢝ΊΔɻ ɾ2015೥ʹϑϧεϐʔυʹೖࣾ͠ɺ2017೥ʹϑϦʔϥ

    ϯεΛ΍ͬͨޙʹ2017೥11݄ʹԭೄͰىۀɻ ◆झຯ ίεϓϨɺԻָϥΠϒɺϚϥιϯେձʹग़Δɺ໺ٿ؍ ઓ ◆Twitter @kanbo0605
  5. Copyright Re:Build.inc All Rights Reserved. 1.ձࣾ঺հ ◆ձ໊ࣾ גࣜձࣾRe:Build ◆ॅॴ ԭೄݝԭೄࢢதԝ̍ஸ໨̍̒−̕

    ◆ࣄۀ಺༰ ɾࣗࣾWEBαʔϏεͷاըɾ։ൃɻ ɾडୗ։ൃ ◆ࣾһ 5໊ ◆ΤϯδχΞͷಇ͖ํ ϦϞʔτϫʔΫՄೳͳࣗ༝ͳಇ͖ํΛਪ঑ͯ͠·͢ʂ
  6. 2 Stripeಋೖʹࢸͬͨഎܠ

  7. 7 ࣗࣾWebαʔϏεͷ։ൃ ɾαʔϏε໊ Tadoru ɾγεςϜ֓ཁ Ϋϥ΢υιʔγϯά ΫϨδοτܾࡁ ͳͲ ɾ࢖͍ͬͯΔٕज़ ݴޠ

    : PHP,JavaScript ϑϨʔϜϫʔΫ: laravel5,Nuxt.jsͳͲ
  8. Re:Build اۀͷ୲౰ऀ͕ ΤʔδΣϯτΛબͿ ΤʔδΣϯτ͕ࣗ෼ͷܨ ͕Γͷ͋ΔΤϯδχΞ· ͨ͸νʔϜʹ੠Λ͔͚Δ ࢓ࣄͷۭ͖͕͋ΔϫʔΧʔ ͕͍Ε͹ɺ໘઀Λߦ͏ ΤʔδΣϯτ͸ ࣄલʹ৹੍ࠪ

    ΤϯδχΞνʔϜ ΤϯδχΞ ϫʔΧʔ ΤʔδΣϯτ اۀ ϏδωεϞσϧ ࠾༻ใु
  9. 9 ཁ݅ ɾܾࡁΛϓϥοτϑΥʔϜ্Ͱߦ͏ɻ ɾۜߦৼࠐ͸໘౗ͳͷͰɺϓϥοτϑΥʔ Ϝ্Ͱ͓ۚͷ΍ΓऔΓΛ׬͍݁ͤͨ͞ɻ

  10. 3 Stripe ConnectΛಋೖ͢ΔϝϦοτ

  11. 11 Stripe Connectͱ͸ ɾCustomerʢސ٬ʣ: ߪೖऀͰ͋Γ͓ۚΛࢧ෷͏ํɻӈͷਤ Ͱ྘ɻ ɾPlatformʢϓϥοτϑΥʔϜʣ: ͦͷ໊ͷ௨ΓϓϥοτϑΥʔϜΛఏڙ ͢Δํɻӈͷਤͷ੨ɻ ɾConnected

    accounts: ϓϥοτϑΥʔϜΛར༻ͯ͠αʔϏε Λఏڙ͠ɺೖۚΛड͚ΔํʢࢠΞΧ΢ ϯτͱ΋ݺ͹Ε·͢ʣɻӈͷਤͷϐϯ Ϋɻ ࢀߟɿhttps://qiita.com/y_toku/items/7bfa42793801dfc5415d
  12. 1 2 Stripe Connectͱ͸ ΤʔδΣϯτ Tadoru اۀ

  13. 1 3 ܾࡁର৅ اۀ ʢCustomerʣ ΤʔδΣϯτ ʢࢠΞΧ΢ϯτʣ ʢϓϥοτϑΥʔϜʣ ஥հख਺ྉ Ϛονϯά࣌ͷใु

    BtoCϞσϧ
  14. 1 4 ϝϦοτ ॊೈͳΧελϚΠζػೳ Connect ͷڧΈ͸ API ɻϓϥοτ ϑΥʔϜͷ࠷దͳΤΫεϖϦΤϯεΛσ βΠϯͰ͖·͢ɻϢʔβొ࿥ϑϩʔͷΧ

    ελϚΠζ΍ɺೖۚαΠΫϧͷઃఆɺෳ ࡶͳࢿۚҠಈͷΧελϚΠζॲཧɺ౷߹ ͞ΕͨܦཧϨϙʔςΟϯάػೳɻ ਝ଎ʹಋೖͰ͖Δ ϓϥοτϑΥʔϜͷͨΊͷܾࡁΠϯϑ ϥετϥΫνϟߏஙͰɺ͢Ͱʹ׬੒͞ Εͨ UI ཁૉΛऔΓೖΕͯɺϩʔϯνΛ εϐʔυΞοϓɺΦϖϨʔγϣϯΛγϯ ϓϧʹͰ͖·͢ɻ άϩʔόϧల։͠΍͍͢ ੈք 25ΧࠃҎ্ͷചΓख΁ࢧ෷͍Մ ೳɻϚʔέοτ͝ͱͷݱ஍ࢠձࣾ΍ ۜߦ࿈ܞ͸ඞཁ͋Γ·ͤΜɻෳࡶͳ ॲཧ͸ Connect ͕Ҿ͖ड͚·͢ɻ 1 2 3 https://stripe.com/connect
  15. 1 5 ೖۚͷλΠϛϯάʹ͍ͭͯ ೖۚʹ࣮ࡍʹࢠΞΧ΢ϯτͷۜߦʹ͓͕ۚೖΔ ɾࣗಈ σϑΥϧτ͸ࣗಈɻ Monthly ͔ WeeklyΛબ΂Δ ཧ༝͕ͳ͚Ε͹ͪ͜Β͕Φεεϝ

    ɾखಈ ೖۚλΠϛϯάΛϓϥοτϑΥʔϜଆ͕ίϯτϩʔϧ͢Δ ʢചΓखଆ͕ࣗ෼ͰҾ͖ग़ͤΔΑ͏ʹ͔ͨͬͨͨ͠Ίʣ
  16. 1 6 Ϣʔβʹࣗ෼ͷϓϥοτϑΥʔϜ Ҏ֎͸ݟͤͨ͘ͳ͍৔߹ CustomΞΧ΢ϯτͳΒɺ ΞΧ΢ϯτొ࿥~ೖۚ·ͰAPIͰίϯτϩʔϧ Ͱ͖Δʂ

  17. 1 7 ϓϥοτϑΥʔϜͷख਺ྉઃఆʹ͍ͭͯ ࣗ༝ʹઃఆͰ͖·͢ʂ

  18. 4 ࣮૷ํ๏

  19. ϑϩϯτΤϯυ αʔόαΠυ શମߏ੒ DBΞΫηε Ajax௨৴

  20. 2 0 اۀଆͷ࣮૷಺༰ ɾ࣮૷ͨ͠ػೳ - ΫϨδοτΧʔυͷొ࿥ - ܾࡁͷ࣮ߦ ɾ࢖ͬͨϥΠϒϥϦ https://stripe.com/docs/stripe-js/reference

  21. 2 1 اۀଆͷ࣮૷಺༰

  22. 2 2 اۀଆͷ࣮૷಺༰

  23. 2 3 اۀଆͷ࣮૷಺༰

  24. 2 4 اۀଆͷ࣮૷಺༰

  25. 2 5 اۀଆͷ࣮૷಺༰

  26. 2 6 اۀଆͷ࣮૷಺༰

  27. 2 7 ΤʔδΣϯτଆͷ࣮૷಺༰ ɾ࣮૷ͨ͠ػೳ - ΞΧ΢ϯτ৘ใ ※2~3೔ͷ৹͕ࠪ͋Δ - ޱ࠲৘ใͷొ࿥ ɾ࢖ͬͨϥΠϒϥϦ

    https://github.com/stripe/stripe-php
  28. 2 8 ΤʔδΣϯτଆͷ࣮૷಺༰

  29. 2 9 ΤʔδΣϯτଆͷ࣮૷಺༰

  30. 3 0 ৹ࠪͷΠϝʔδ ޱ࠲৘ใ΍ূ໌ॻͷొ࿥ ̎ʙ̏೔Ͱ݁Ռ͕͘Δ

  31. 3 1 ΤʔδΣϯτଆͷ࣮૷಺༰

  32. 3 2 ؅ཧը໘ͷݟ͑ํ

  33. 3 3 ࠓޙͷߏ૝(Ծ) اۀ ʢCustomerʣ ΤʔδΣϯτ ʢࢠΞΧ΢ϯτʣ ʢϓϥοτϑΥʔϜʣ ஥հख਺ྉ Ϛονϯά࣌ͷใु

    BtoCϞσϧ ϫʔΧʔ ͓ॕ͍ۚ
  34. 3 4 ࢀߟจݙ https://qiita.com/y_toku/items/7bfa42793801dfc5415d https://stripe.com/connect

  35. 3 5 ·ͱΊ ɾϓϥοτϑΥʔϜͰख਺ྉΛऔΔϏδωεϞ σϧʹ޲͍͍ͯΔ ɾAPIܦ༝Ͱɺೖۚ΍ख਺ྉͷઃఆͳͲ͕؆୯ ʹͰ͖Δ