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
390
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
770
「エンジニアのための ドキュメントライティング」書籍のすすめ / phpconfuk 2023
gorou_178
2
960
EventBridgeの運用について
gorou_178
0
170
Stripe Appsと自サービスの連携作法
gorou_178
0
170
Laravelのsession設定を変えて 劇的にパフォーマンスを改善した話
gorou_178
0
1.6k
Stripeとアプリケーションの関係を可視化してみた
gorou_178
0
770
Stripeでの増税対応
gorou_178
0
710
Stripe+PHPでセキュアで安全な決済機能を作る
gorou_178
0
1.7k
Stripeを利用した決済機能をテストする
gorou_178
1
5.5k
Other Decks in Programming
See All in Programming
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
150
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
110
Jakarta EE meets AI
ivargrimstad
0
720
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
310
Amazon Qを使ってIaCを触ろう!
maruto
0
420
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.8k
最新TCAキャッチアップ
0si43
0
200
Click-free releases & the making of a CLI app
oheyadam
2
120
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.3k
Macとオーディオ再生 2024/11/02
yusukeito
0
380
CSC509 Lecture 11
javiergs
PRO
0
180
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
BBQ
matthewcrist
85
9.3k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
A Tale of Four Properties
chriscoyier
156
23k
The Cult of Friendly URLs
andyhume
78
6k
Site-Speed That Sticks
csswizardry
0
33
Adopting Sorbet at Scale
ufuk
73
9.1k
Done Done
chrislema
181
16k
Building Applications with DynamoDB
mza
90
6.1k
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ΛͬͯΔ͚ͲɺҠ ߦΛܭըத
࣭
͋Γ͕ͱ͏͍͟͝·ͨ͠