Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Stripe API について
Search
gorou_178
October 21, 2016
Programming
0
420
Stripe API について
gorou_178
October 21, 2016
Tweet
Share
More Decks by gorou_178
See All by gorou_178
Spring Bootで作成したAPIテストのコスパを高めよう!
gorou_178
1
1.2k
「エンジニアのための ドキュメントライティング」書籍のすすめ / phpconfuk 2023
gorou_178
2
1k
EventBridgeの運用について
gorou_178
0
220
Stripe Appsと自サービスの連携作法
gorou_178
0
210
Laravelのsession設定を変えて 劇的にパフォーマンスを改善した話
gorou_178
0
1.9k
Stripeとアプリケーションの関係を可視化してみた
gorou_178
0
850
Stripeでの増税対応
gorou_178
0
800
Stripe+PHPでセキュアで安全な決済機能を作る
gorou_178
0
1.8k
Stripeを利用した決済機能をテストする
gorou_178
1
5.6k
Other Decks in Programming
See All in Programming
MLOps Japan 勉強会 #52 - 特徴量を言語を越えて一貫して管理する, 『特徴量ドリブン』な MLOps の実現への試み
taniiicom
2
610
ワイがおすすめする新潟の食 / 20250530phpconf-niigata-eve
kasacchiful
0
290
JSAI2025 RecSysChallenge2024 優勝報告
unonao
1
410
〜可視化からアクセス制御まで〜 BigQuery×Looker Studioで コスト管理とデータソース認証制御する方法
cuebic9bic
2
280
The Evolution of Enterprise Java with Jakarta EE 11 and Beyond
ivargrimstad
0
260
Interface vs Types ~型推論が過多推論~
hirokiomote
1
240
Perlで痩せる
yuukis
1
670
try-catchを使わないエラーハンドリング!? PHPでResult型の考え方を取り入れてみよう
kajitack
3
440
當開發遇上包裝:AI 如何讓產品從想法變成商品
clonn
0
2.8k
インターフェース設計のコツとツボ
togishima
2
650
Parallel::Pipesの紹介
skaji
2
890
型付け力を強化するための Hoogle のすゝめ / Boosting Your Type Mastery with Hoogle
guvalif
1
250
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
46
14k
Art, The Web, and Tiny UX
lynnandtonic
298
21k
Adopting Sorbet at Scale
ufuk
76
9.4k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
6
670
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
14
1.5k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.2k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.8k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.4k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
48
5.4k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
25
2.8k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
32
5.8k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
180
53k
Transcript
Stripe API ʹ͍ͭͯ גࣜձࣾ Πϊϕʔλʔɾδϟύϯ ݀Ҫ ྯ 2016.10.20
ࣗݾհ • גࣜձࣾΠϊϕʔλʔɾδϟύϯ • WebΤϯδχΞ • Twitter @gorou_178 • ϑΝΠϧసૹαʔϏεʮtenpuʯ
• WordPressͰαΠτߏங • AWSΛར༻ͨ͠αʔόߏஙɺอक
Stripe
10݄4 ຊͰਖ਼ࣜϩʔϯν
None
None
Stripe •ϚΠΫϩϖΠϝϯτܾࡁ •ରԠ௨՟ 130௨՟Ҏ্ •औҾֹʹରͯ͠3.6%͕खྉ •ੈքશମͷސ٬10ສࣾΛ͑Δ •ੈք26ϱࠃͰϩʔϯν
Stripe •Discover •JCB •Diners Club •Visa •Master Card •American Express
Stripe •ࢧ͍ํ๏ •ΫϨδοτΧʔυ •ϏοτίΠϯ •Alipay •ACHσϏοτ
Stripe •༻ڥར༻ਃඞཁ߲ͷೖྗ͚ͩͰྃ(Β͍͠) •WebPayͩͱ1िؒɺશͯͷΫϨδοτΧʔυར༻·Ͱ 1ϲ݄͔͔Δ •ͱΓ͙͋͑ͣ͑͢ΔͬΆ͍
StripeͬͯΔํʁ
WebPayͩΑͬͯํʁ
ͦͷଞͬͯΔํʁ
Stripe Checkout •CheckoutϘλϯΛαΠτ ʹઃஔ͢Δ͚ͩ •scriptλάΛషΔ͚ͩ
Stripe Checkout
Stripe API Libraries •Ruby •Python •PHP •Java •Node.js •Go •iOS
•Android
stripe-php •stripe/stripe-php •https://github.com/stripe/stripe-php
Stripe API •Customer: ސ٬ใ •Card: ΫϨδοτΧʔυใɻސ٬ʹରͯ͠ෳ࣋ͯΔ •Charge: ࢧ͍ɻސ٬ʹඥ͚ͭͯ̍ճݶΓͷ՝͕ۚͰ͖ Δ
Customer
Card •Χʔυใͷొ
Card •ΧʔυใΛCustomerʹඥ͚
Customer + Card •CheckoutϘλϯར༻ͨ͠߹ɺstripeToken͕post͞ΕΔ •tokenͰొ͢ΔͱCustomerͱCardΛҰॹʹొ͞ΕΔ
Stripe API •Plan: ఆظ՝ۚͷྉۚϓϥϯ •Subscription: ఆظ՝ۚɻސ٬ʹඥ͘
Plan •ఆظ՝ۚͷྉۚϓϥϯΛ࡞
Subscription •ఆظ՝ۚΛ࡞ •customerͱplanΛࢦఆ
webhook •webhook͑·͢
webhook •request bodyʹjsonͰࢦఆURLʹϦΫΤετ͕͋Δ •Event APIͰΠϕϯτID͕࣮ࡏ͢Δ͔֬ೝ͢Δ͜ͱ(ηΩϡϦςΟରࡦ) •IPΞυϨεϦετެ։͞Εͯ·͢ •https://stripe.com/docs/ips
ͦͷଞศརͦ͏ͳػೳ •Coupon: Ϋʔϙϯػೳ •ׂҾ or ׂҾֹ •ظؒ: ̍ճͷΈɺࢦఆ·Ͱɺͣͬͱ •CustomerSubscriptionʹΫʔϙϯίʔυΛࢦఆ
ͦͷଞศརͦ͏ͳػೳ •ఆظ՝ۚͷ࠶՝ۚͷઃఆͰ͖Δ
ͦͷଞศརͦ͏ͳػೳ •Χʔυใʹॅॴ͕ొͰ͖Δ •zipcodeͰෆਖ਼νΣοΫͱ͔ͯ͠ΔΒ͍͠ •customerʹҙͷmetadataઃఆͰ͖Δ •Product(ใ)ͷཧͰ͖Δ •ࡏݿɺαΠζɺͷը૾
ͦͷଞศརͦ͏ͳػೳ •receipts(ྖऩॻ)ͷૹ৴Ͱ͖Δ
·ͱΊ •StripeͰԁ͕͑ΔΑ͏ʹͳͬͨΑ •༻ڥ৹ࠪͪͳ͠Ͱ͑ΔΑ •StripeͰཧ·ͰͰ͖ͪΌ͏ •ʮԁܾࡁ͕Ͱ͖ͳ͔ͬͨͷͰʯWebPayΛͬͯΔ͚ͲɺҠ ߦΛܭըத
࣭
͋Γ͕ͱ͏͍͟͝·ͨ͠