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

Stripe API について

81011f5622102c067230901506f21e5f?s=47 gorou_178
October 21, 2016

Stripe API について

81011f5622102c067230901506f21e5f?s=128

gorou_178

October 21, 2016
Tweet

Transcript

  1. Stripe API ʹ͍ͭͯ גࣜձࣾ Πϊϕʔλʔɾδϟύϯ ݀Ҫ ྯ 2016.10.20

  2. ࣗݾ঺հ • גࣜձࣾΠϊϕʔλʔɾδϟύϯ • WebΤϯδχΞ • Twitter @gorou_178 • ϑΝΠϧసૹαʔϏεʮtenpuʯ

    • WordPressͰαΠτߏங • AWSΛར༻ͨ͠αʔόߏஙɺอक
  3. Stripe

  4. 10݄4೔ ೔ຊͰਖ਼ࣜϩʔϯν

  5. None
  6. None
  7. Stripe •ϚΠΫϩϖΠϝϯτܾࡁ •ରԠ௨՟ 130௨՟Ҏ্ •औҾֹʹରͯ͠3.6%͕ख਺ྉ •ੈքશମͷސ٬਺͸10ສࣾΛ௒͑Δ •ੈք26ϱࠃͰϩʔϯν

  8. Stripe •Discover •JCB •Diners Club •Visa •Master Card •American Express

  9. Stripe •ࢧ෷͍ํ๏ •ΫϨδοτΧʔυ •ϏοτίΠϯ •Alipay •ACHσϏοτ

  10. Stripe •঎༻؀ڥར༻ਃ੥͸ඞཁ߲໨ͷೖྗ͚ͩͰ׬ྃ(Β͍͠) •WebPayͩͱ໿1िؒɺશͯͷΫϨδοτΧʔυར༻·Ͱ ໿1ϲ݄͔͔Δ •ͱΓ͙͋͑ͣ͢࢖͑ΔͬΆ͍

  11. Stripe࢖ͬͯΔํʁ

  12. WebPayͩΑͬͯํʁ

  13. ͦͷଞ࢖ͬͯΔํʁ

  14. Stripe Checkout •CheckoutϘλϯΛαΠτ ʹઃஔ͢Δ͚ͩ •scriptλάΛషΔ͚ͩ

  15. Stripe Checkout

  16. Stripe API Libraries •Ruby •Python •PHP •Java •Node.js •Go •iOS

    •Android
  17. stripe-php •stripe/stripe-php •https://github.com/stripe/stripe-php

  18. Stripe API •Customer: ސ٬৘ใ •Card: ΫϨδοτΧʔυ৘ใɻސ٬ʹରͯ͠ෳ਺࣋ͯΔ •Charge: ࢧ෷͍ɻސ٬ʹඥ͚ͭͯ̍ճݶΓͷ՝͕ۚͰ͖ Δ

  19. Customer

  20. Card •Χʔυ৘ใͷొ࿥

  21. Card •Χʔυ৘ใΛCustomerʹඥ෇͚

  22. Customer + Card •CheckoutϘλϯར༻ͨ͠৔߹ɺstripeToken͕post͞ΕΔ •tokenͰొ࿥͢ΔͱCustomerͱCardΛҰॹʹొ࿥͞ΕΔ

  23. Stripe API •Plan: ఆظ՝ۚͷྉۚϓϥϯ •Subscription: ఆظ՝ۚɻސ٬ʹඥ෇͘

  24. Plan •ఆظ՝ۚͷྉۚϓϥϯΛ࡞੒

  25. Subscription •ఆظ՝ۚΛ࡞੒ •customerͱplanΛࢦఆ

  26. webhook •webhook΋࢖͑·͢

  27. webhook •request bodyʹjsonͰࢦఆURLʹϦΫΤετ͕͋Δ •Event APIͰΠϕϯτID͕࣮ࡏ͢Δ͔֬ೝ͢Δ͜ͱ(ηΩϡϦςΟରࡦ) •IPΞυϨεϦετ΋ެ։͞Εͯ·͢ •https://stripe.com/docs/ips

  28. ͦͷଞศརͦ͏ͳػೳ •Coupon: Ϋʔϙϯػೳ •ׂҾ཰ or ׂҾֹ •ظؒ: ̍ճͷΈɺࢦఆ೔·Ͱɺͣͬͱ •Customer΍SubscriptionʹΫʔϙϯίʔυΛࢦఆ

  29. ͦͷଞศརͦ͏ͳػೳ •ఆظ՝ۚͷ࠶՝ۚͷઃఆ΋Ͱ͖Δ

  30. ͦͷଞศརͦ͏ͳػೳ •Χʔυ৘ใʹॅॴ͕ొ࿥Ͱ͖Δ •zipcodeͰෆਖ਼νΣοΫͱ͔ͯ͠ΔΒ͍͠ •customerʹ೚ҙͷmetadataઃఆͰ͖Δ •Product(঎඼৘ใ)ͷ؅ཧ΋Ͱ͖Δ •ࡏݿɺαΠζɺ঎඼ͷը૾

  31. ͦͷଞศརͦ͏ͳػೳ •receipts(ྖऩॻ)ͷૹ৴΋Ͱ͖Δ

  32. ·ͱΊ •StripeͰԁ͕࢖͑ΔΑ͏ʹͳͬͨΑ •঎༻؀ڥ৹ࠪ଴ͪͳ͠Ͱ࢖͑ΔΑ •StripeͰ঎඼؅ཧ·ͰͰ͖ͪΌ͏ •ʮԁܾࡁ͕Ͱ͖ͳ͔ͬͨͷͰʯWebPayΛ࢖ͬͯΔ͚ͲɺҠ ߦΛܭըத

  33. ࣭໰

  34. ͋Γ͕ͱ͏͍͟͝·ͨ͠