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 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
アプリの "かわいい" を支えるアニメーションツールRiveについて
uetyo
0
280
個人軟體時代
ethanhuang13
0
330
How Android Uses Data Structures Behind The Scenes
l2hyunwoo
0
490
楽して成果を出すためのセルフリソース管理
clipnote
0
200
2025 年のコーディングエージェントの現在地とエンジニアの仕事の変化について
azukiazusa1
24
12k
「手軽で便利」に潜む罠。 Popover API を WCAG 2.2の視点で安全に使うには
taitotnk
0
880
AI Coding Agentのセキュリティリスク:PRの自己承認とメルカリの対策
s3h
0
240
CJK and Unicode From a PHP Committer
youkidearitai
PRO
0
120
複雑なフォームに立ち向かう Next.js の技術選定
macchiitaka
3
640
Updates on MLS on Ruby (and maybe more)
sylph01
1
190
はじめてのMaterial3 Expressive
ym223
2
940
Introducing ReActionView: A new ActionView-compatible ERB Engine @ Rails World 2025, Amsterdam
marcoroth
0
720
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
36
6.9k
Designing Experiences People Love
moore
142
24k
The Cost Of JavaScript in 2023
addyosmani
53
8.9k
For a Future-Friendly Web
brad_frost
180
9.9k
Side Projects
sachag
455
43k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
53k
Faster Mobile Websites
deanohume
309
31k
Bash Introduction
62gerente
615
210k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Embracing the Ebb and Flow
colly
87
4.8k
Mobile First: as difficult as doing things right
swwweet
224
9.9k
Visualization
eitanlees
148
16k
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