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
payjp-anti-pattern
Search
Takuya Nishio
June 19, 2018
Technology
0
120
payjp-anti-pattern
Takuya Nishio
June 19, 2018
Tweet
Share
More Decks by Takuya Nishio
See All by Takuya Nishio
8年以上RailsのWebサービスをメンテしてわかったこと
webuilder240
0
100
スタートアップでどのようにAutifyを活用しているか
webuilder240
0
270
WebComponentsで フレームワークを1ページに共存させる
webuilder240
0
740
Other Decks in Technology
See All in Technology
知られざるprops命名の慣習 アクション編
uhyo
11
2.6k
Evolution on AI Agent and Beyond - AGI への道のりと、シンギュラリティの3つのシナリオ
masayamoriofficial
0
190
見てわかるテスト駆動開発
recruitengineers
PRO
6
790
AIドリブンのソフトウェア開発 - うまいやり方とまずいやり方
okdt
PRO
9
660
モダンフロントエンド 開発研修
recruitengineers
PRO
4
1k
TypeScript入門
recruitengineers
PRO
26
7.9k
MySQL HeatWave:サービス概要のご紹介
oracle4engineer
PRO
4
1.7k
[CV勉強会@関東 CVPR2025 読み会] MegaSaM: Accurate, Fast, and Robust Structure and Motion from Casual Dynamic Videos (Li+, CVPR2025)
abemii
0
200
Browser
recruitengineers
PRO
5
690
mruby(PicoRuby)で ファミコン音楽を奏でる
kishima
1
290
LLMエージェント時代に適応した開発フロー
hiragram
1
420
Android Studio の 新しいAI機能を試してみよう / Try out the new AI features in Android Studio
yanzm
0
280
Featured
See All Featured
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Git: the NoSQL Database
bkeepers
PRO
431
65k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Designing for Performance
lara
610
69k
Navigating Team Friction
lara
189
15k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.4k
The Pragmatic Product Professional
lauravandoore
36
6.8k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Designing Experiences People Love
moore
142
24k
Site-Speed That Sticks
csswizardry
10
790
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.9k
Transcript
ඌ (@webuilder240) 2018.6.19 Copyright © OSIRO,Ltd. All Rights Reserved.
PAY.JP Ξϯνύλʔϯ
Copyright © OSIRO,Ltd. All Rights Reserved. ຊΛܳज़จԽେࠃʹ͢Δʂ
Ͳ͜ͷͩΕʁ • Takuya Nishio (@webuilder240) • ΦγϩגࣜձࣾͰRubyΤϯδχΞ͍ͬͯ·͢ • ๏ਓԽ20171݄ʢϗϠϗϠͷελʔτΞοϓʂʂʣ •
PAY.JPαʔϏε։࢝ॳظ͔Βར༻ʢ2015/12ʣ • ఆֹ՝ۚΛϔϏʔʹ͍ͬͯ·͢ • github: webuilder240
PAY.JPΛར༻͢Δʹ͋ͨͬͯ ͷٕज़తͳΞϯνύλʔϯΛ ͍͔ͭ͘հ͠·͢ɻ
1.WebhookΛϛογϣϯΫϦ ςΟΧϧͳ༻్Ͱར༻͢Δ
1. ϛογϣϯΫϦςΟΧϧͳ༻్Ͱ༻͍͚ͯ͠ͳ͍ཧ༝ • ͦͦʮWebhookΛϛογϣϯΫϦςΟΧ ϧͳ෦Ͱར༻ਪ͠ͳ͍ʯͱPAY͞Μ͕ද ໌͍ͯ͠Δɻ • https://pay.jp/docs/webhook • ཧ༝Webhookͷଟॏૹ৴ૹ৴ະୡى͜
ΓಘΔͨΊɻ
1. ରࡦ • Event APIΛར༻ͯ͠ɺPAY.JP͔Βૹ৴ͯ͠ Β͏ͷͰͳ͘ɺར༻͢ΔΞϓϦέʔγϣϯ ͔ΒऔಘͰ͖ΔΑ͏ʹ͢Δɻ • Ͳ͏ͯ͠ར༻͢Δ߹ɺଟॏૹ৴ૹ৴ະ ୡ͕͋ͬͯͳ͍Α͏ʹ࣮͢Δɻ
2. ఆֹܾࡁͷεςʔλεΛαʔ Ϗεͷܧଓঢ়ଶͱ͢Δɻ
2. ఆֹܾࡁͷεςʔλεΛαʔϏεͷར༻ঢ়ଶͱ͍͚ͯ͠ͳ͍ཧ༝ • PAY.JPͷఆֹ՝ۚ՝ۚͷௐʹʮτϥΠΞϧʯΛઃఆ ͯ͠ௐ͢Δͷ͕ݱঢ়ͷํ๏ɻ • ՝ۚͷௐͷͨΊʹʮτϥΠΞϧʯʹ͍ͯ͠ΔͷͰ͋ͬͯɺ ݫີʹαʔϏε্ͰʮτϥΠΞϧʯͱͯ͠ѻ͍ͨ͘ͳ͍࣌ ͕͋Δɻ •
աڈʹ͍ͨ͠߹ɺఆֹ՝ۚΛআ => ఆֹ՝ۚΛ࡞ ͯ͠ɺʮτϥΠΞϧʯͰઃఆ͍ͨ͠·ͰͰ࠶࡞͢Δɻ
2. ରࡦ • αʔϏεͷར༻ঢ়گΛఆֹ՝ۚͷঢ়ଶͱผ ʹอଘ͓ͯ͘͠ • τϥΠΞϧͰௐ͢Δӡ༻͕ਏ͍ͳΒɺఆֹ ՝ۚ͏͖Ͱͳ͍ɻ • ظؒΛ؆୯ʹௐͰ͖ΔΑ͏ʹWrapperΛ༻
ҙ͓ͯ͘͠ͱศར
3. ఆֹ՝ۚͷ࣍ճࢧͷλ ΠϜκʔϯΛҙࣝ͠ͳ͍
3. ͋Δ… • ͳΜ͔ܾࡁ͓͔͘͠ͳ͍ʁʁʁ • Το…
3. ࣮ࡍͷSubscriptionߋ৽Πϕϯτ
3. ֬ೝͨ݁͠Ռ ʂʁ
3. ͳͥζϨͨͷ͔ • PAY.JPͷఆֹ՝ۚͷ࣍ճࢧ͍༧ఆUTC Λج४ʹࢉग़͍ͯ͠ΔͨΊൃੜ͍ͯ͠Δɻ • ΄ͱΜͲͷέʔεͰͳ͍͕ɺζϨΔ έʔε͕͋Δɻ • ೝ͍ࣝͯ͠Δͷ
JST 1 0:00ʙ9:59ͷؒ
3. ରࡦ • 1ͷJST 0:00 - 9:59ͷؒͰܾࡁΛආ͚Δ • 1ͷ10:00Ҏ߱Ͱܾࡁ͞ΕΔΑ͏ʹτϥΠ ΞϧΛར༻ͯ͠ௐ͢Δɻ
• ຊԿ͠ͳ͍͍ͯ͘Α͏ʹͯ͠΄͠ ͍…
·ͱΊ • WebhookΛΫϦςΟΧϧͳ෦Ͱར༻͠ͳ͍Ͱ ར༻ଆ͔ΒEventΛऔಘ͠Α͏ • αʔϏεͷར༻ঢ়گΛఆֹ՝ۚͷঢ়ଶͱผʹอ ଘ͓ͯ͜͠͏ • ఆֹ՝ۚͷαΠΫϧ͕ζϨͯࠔΔ߹ɺJSTͷ 0:00
ʙ 9:59Ͱܾࡁ͠ͳ͍Α͏ʹௐ͢Δɻ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ ࠙ձͰ͓͠·͠ΐ͏ʂ