Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Stripe Credit Card Flow
Search
Ross Boucher
April 03, 2014
Programming
1
89
Stripe Credit Card Flow
What happens when you charge a credit card?
Ross Boucher
April 03, 2014
Tweet
Share
Other Decks in Programming
See All in Programming
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
180
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
160
エディターってAIで操作できるんだぜ
kis9a
0
750
ZJIT: The Ruby 4 JIT Compiler / Ruby Release 30th Anniversary Party
k0kubun
0
260
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
8
3.3k
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
470
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
340
TestingOsaka6_Ozono
o3
0
170
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
440
Developing static sites with Ruby
okuramasafumi
0
320
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
130
Patterns of Patterns
denyspoltorak
0
280
Featured
See All Featured
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
260
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.1k
From π to Pie charts
rasagy
0
90
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Code Review Best Practice
trishagee
74
19k
How to Talk to Developers About Accessibility
jct
1
84
Done Done
chrislema
186
16k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
99
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Transcript
What happens when you charge a credit card?
1 2 3 4 5 6 7 8 Browser Stripe
API Your Server Credit Card Network
GET https://api.stripe.com/v1/tokens?callback=stripe123& _method=POST&key=pk_live_abcd BROWSER REQUESTS: Stripe.createToken({ number: $('#paymentNumber'), // etc.
}, function callback(status, response){ // submit the rest of the form }); JAVASCRIPT:
HTTP/1.1 200 OK ... { "id": "tok_1234", // this is
how we will refer to the Stripe token "card": { "last4": "4242", "type": "Visa", ... } } STRIPE API RETURNS:
POST https://yoursite.com/submit stripe_token=tok_1234&foo=bar... BROWSER REQUESTS:
POST https://api.stripe.com/v1/charges Authorization: Bearer sk_live_wxyz card=tok_1234&amount=500¤cy=usd&description=foo YOUR SERVER REQUESTS:
Sending authorize request (conv fdc_1234): MTI:100 (Authorization Request) 002 Primary
Account Number : "42xxxxxxxxxx42" 004 Amount of Transaction : 500 007 Transmission Date/Time : 2013-02-04 02:15:20 UTC 012 Time, Local Transmission : 2013-02-03 18:15:20 UTC 014 Card Expiration Date : "1503" 018 Merchant Category Code : "5399" 042 Merchant : "4451xxxxxxx" 049 Transaction Currency Code : 840 STRIPE REQUESTS: (binary wire protocol)
Response: MTI:110 (Authorization Request Response) 004 Amount of Transaction :
500 007 Transmission Date/Time : 2013-02-04T02:15:20+00:00 025 Point of Service (POS) Condition Code : 59 037 Retrieval Reference Number : "z8yYxxxxxxxx" 039 Response Code : "00" [Approved (for capture)] 044 Additional Response Data : "Y" [Address and 5-digit ZIP Match] CREDIT CARD NETWORK RESPONDS: (binary wire protocol)
HTTP/1.1 200 OK { "id": "ch_1234", "paid": true, // the
charge was successful "object": "charge", "amount": 500, ... } STRIPE RESPONDS
HTTP/1.1 200 OK <html> <body> <h1>Thank you for paying!</h1> </body>
</html> YOUR SERVER RESPONDS:
1 2 3 4 5 6 7 8 Browser Stripe
API Your Server Credit Card Network
Payments for Developers