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
370
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
620
「エンジニアのための ドキュメントライティング」書籍のすすめ / phpconfuk 2023
gorou_178
2
910
EventBridgeの運用について
gorou_178
0
150
Stripe Appsと自サービスの連携作法
gorou_178
0
160
Laravelのsession設定を変えて 劇的にパフォーマンスを改善した話
gorou_178
0
1.4k
Stripeとアプリケーションの関係を可視化してみた
gorou_178
0
740
Stripeでの増税対応
gorou_178
0
680
Stripe+PHPでセキュアで安全な決済機能を作る
gorou_178
0
1.6k
Stripeを利用した決済機能をテストする
gorou_178
1
5.4k
Other Decks in Programming
See All in Programming
Architecture Decision Record (ADR)
nearme_tech
PRO
1
660
サーバーレスで負荷試験!Step Functions + Lambdaを使ったk6の分散実行
shuntakahashi
6
1.5k
Lessons by WebAssembly app in production on CDN Edge Computing Service
tetsuharuohzeki
0
160
【TID2024】模擬講義:プログラマと一緒にゲームをデザインしてみよう!
akatsukigames_tech
0
560
2024 컴포즈 정원사
jisungbin
0
150
LangChainでWebサイトの内容取得やGitHubソースコード取得
shukob
0
150
How to Break into Reading Open Source
kaspth
1
160
Amebaチョイス立ち上げの裏側 ~依存システムとの闘い~
daichi_igarashi
0
230
Regular Expressions, REXML, Automata Learning
makenowjust
0
210
[DroidKaigi 2024] Android ViewからJetpack Composeへ 〜Jetpack Compose移行のすゝめ〜 / From Android View to Jetpack Compose: A Guide to Migration
syarihu
1
250
dRuby 入門者によるあなたの身近にあるdRuby 入門
makicamel
4
350
RAGの回答精度評価用のQAデータセットを生成AIに作らせた話
kurahara
0
240
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
354
29k
Documentation Writing (for coders)
carmenintech
65
4.3k
VelocityConf: Rendering Performance Case Studies
addyosmani
322
23k
A Modern Web Designer's Workflow
chriscoyier
691
190k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
36
1.9k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Web Components: a chance to create the future
zenorocha
308
42k
Making the Leap to Tech Lead
cromwellryan
128
8.8k
From Idea to $5000 a Month in 5 Months
shpigford
379
46k
Unsuck your backbone
ammeep
667
57k
Docker and Python
trallard
39
3k
Building Your Own Lightsaber
phodgson
101
6k
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ΛͬͯΔ͚ͲɺҠ ߦΛܭըத
࣭
͋Γ͕ͱ͏͍͟͝·ͨ͠