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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
140
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
270
Apache Iceberg V3 and migration to V3
tomtanaka
0
170
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
3.9k
OSSとなったswift-buildで Xcodeのビルドを差し替えられるため 自分でXcodeを直せる時代になっている ダイアモンド問題編
yimajo
3
620
2026年 エンジニアリング自己学習法
yumechi
0
140
Architectural Extensions
denyspoltorak
0
290
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
Raku Raku Notion 20260128
hareyakayuruyaka
0
340
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
650
Oxlintはいいぞ
yug1224
5
1.3k
Featured
See All Featured
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
190
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
100
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
350
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
71
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Paper Plane
katiecoart
PRO
0
46k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
240
We Are The Robots
honzajavorek
0
160
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.7k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
250
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