Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
カンムとGo
Search
pongzu
April 24, 2021
Technology
1.9k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
カンムとGo
pongzu
April 24, 2021
More Decks by pongzu
See All by pongzu
Goで実装するブランドネットワークとの接続ポイント
pongzu
2
3.6k
外部コマンドの実行を含む関数のテスト
pongzu
0
3.3k
SQLFormatter written in Go
pongzu
2
3.2k
Other Decks in Technology
See All in Technology
VLA-JEPA: Enhancing Vision-Language-Action Models with Latent World Models
takmin
0
160
LLM-as-a-Judgeは本当に信頼できるのか――評価器を評価する話
taka_aki
3
1.1k
20年間 SNS サービス「GREE」 を支えた技術の刷新と、長期運用サービスの Kubernetes へのリアーキテクト
gree_tech
PRO
0
110
DBについての基礎説明(MySQL編) - コロプラ 2026年度 新卒研修
colopl
0
160
sue445's proposals 2026
sue445
0
130
dbt Semantic Layerで進めるenechainのデータ民主化
akizhou
1
220
AIにシークレットを見せない、WSL2で安全な開発環境
yazm
0
340
Classmethod Company Deck
satoshi7
1
820
ストレスなくAIと付き合いたい!こんなときどうしてる?
namiki64
4
670
Browser Spec: Testing Hotwire with Ruby
takahashim
1
160
Turning Repos into the Product Second Brain with an LLM Wiki
linedevth
0
140
Code for Security プロジェクト紹介 2026年10月
yu23ki14
0
120
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
225
10k
Writing Fast Ruby
sferik
630
63k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Building a Scalable Design System with Sketch
lauravandoore
464
34k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
640
From π to Pie charts
rasagy
1
410
BBQ
matthewcrist
90
10k
Bash Introduction
62gerente
615
220k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
720
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.5k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
540
Transcript
カンムとGo Yu Tanaka Kanmu, Inc. Go Conference 2021 Spring April
24,2021
Copyright Kanmu, Inc. All right reserved. 2 田中 悠(ぽんず) @pongzu
@_pongzu 自己紹介
Copyright Kanmu, Inc. All right reserved. バンドルカードを作ってます
Copyright Kanmu, Inc. All right reserved. 4 バンドルカードのバックエンド オーソリゼーションとISO8583 プロセッシングシステムを作る
失敗談 1 2 3 目次 4
バンドルカードのバックエンド 1
Copyright Kanmu, Inc. All right reserved. バンドルカードのバックエンド 6 1 データ/お金の流れ
Processor API カンム 売上データ 購入OK/NG • カード作成 • カード利用履歴 • ユーザ情報 • チャージリクエスト 通知 売上データ 購入OK/NG
Copyright Kanmu, Inc. All right reserved. バンドルカードのバックエンド 7 1 データ/お金の流れ
Processor API カンム 売上データ 購入OK/NG • カード作成 • カード利用履歴 • ユーザ情報 • チャージリクエスト 通知 売上データ 購入OK/NG Go Go
オーソリゼーションとISO8583 2
Copyright Kanmu, Inc. All right reserved. 売上データ 購入OK/NG 売上データ 購入OK/NG
Processor オーソリゼーション オーソリゼーションとISO8583 2 • 決済をするとお店から売上データがVisaNetを経由して飛んでくる • 売上データはISO8583というプロトコルで定義された電文 • Processorは電文を受けて売上データを通して良いのか判断
Copyright Kanmu, Inc. All right reserved. Processor ISO8583 ISO8583 ISO8583
• オーソリゼーションを行う為の共通フォーマット • 通信はTCPで行われる • 既にParserがありそうだが、ない オーソリゼーションとISO8583 2
Copyright Kanmu, Inc. All right reserved. 11 オーソリゼーションとISO8583 2
Copyright Kanmu, Inc. All right reserved. 12 オーソリゼーションとISO8583 2
Copyright Kanmu, Inc. All right reserved. オーソリゼーションとISO8583 2
プロセッシングシステムを作る 3
Copyright Kanmu, Inc. All right reserved. 売上データ OK/NG プロセッシングシステムを作る 3
プロセッシングシステムとは • Visaのサーバに対してTCPのコネクションを張って電文を読み書きする • ISO8583でフォーマットされた電文をParseする • Parseしたデータを見て、決済を通すか判断する Visa Server Processor 売上データ OK/NG
Copyright Kanmu, Inc. All right reserved. プロセッシングシステムを作る 3 Visaのサーバに対してTCPのコネクションを張って電文を読み書きする
Copyright Kanmu, Inc. All right reserved. プロセッシングシステムを作る 3 ISO8583でフォーマットされた電文をParseし、Goの構造体に落とし込む
Copyright Kanmu, Inc. All right reserved. プロセッシングシステムを作る 3 Parseしたデータを使って決済を通すか判断する
Copyright Kanmu, Inc. All right reserved. プロセッシングシステムを作る 3 Parseしたデータを使って決済を通すか判断する
Copyright Kanmu, Inc. All right reserved. プロセッシングシステムを作る 3 Parse後のデータを使って決済を通すか判断する(のテスト)
失敗談 4
Copyright Kanmu, Inc. All right reserved. 4 失敗談 分岐が多いメソッドを定義してしまった
Copyright Kanmu, Inc. All right reserved. • MessageType=100は通常売上を意味する • 通常売上が来た場合、決済手段によって見るべきフィールドが異なる
例)非対面の場合はセキュリティコードをチェック、対面決済の場合は暗証番号をチェック、 • とはいえ、大まかな処理は共通している 例)有効期限チェック、残高チェック...etc 分岐が多いメソッドを定義してしまった 共通化できるところは共通化し たほうが良いのでは...? 4 失敗談
Copyright Kanmu, Inc. All right reserved. 最終的にどう書いたか 4 失敗談
Copyright Kanmu, Inc. All right reserved. 決済の手段別に細かく処理を分けた 4 失敗談
最後に
Copyright Kanmu, Inc. All right reserved. We are hiring! まだまだやりたいことはたくさん!
一緒に決済システムをつくりませんか!
Copyright Kanmu, Inc. All right reserved. Remo でオフィスアワーやります! 1. Goプログラムのバイナリを解析して
秘密のメッセージを見つけよう! 2. カンム CTO x COO が語る障害/失敗の振り返り 3. COO achiku が答えるプロダクトや組織の質問タイム ぜひ遊びに来てくださいね 😌
Thank you!