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
The Hitch Hiker's Guide to Android Pay
Search
Tomoaki Imai
November 22, 2016
Programming
1
1.7k
The Hitch Hiker's Guide to Android Pay
[Japanese] This slide is a guide for implementing Android Pay
Tomoaki Imai
November 22, 2016
Tweet
Share
More Decks by Tomoaki Imai
See All by Tomoaki Imai
Decentralized ID とWebの未来
tomoima525
0
140
Web3/メタバースにおけるグローバルのトレンドと活用の最前線
tomoima525
2
2.9k
自分の道の歩み方~楽しくチャレンジするためのヒント~
tomoima525
2
450
Continuum: Background Checker with Zero-Knowledge Proof
tomoima525
0
2.5k
Catching up with TurboModule
tomoima525
1
3.5k
シリコンバレースタートアップのリモート開発
tomoima525
3
1.8k
A guide to writing specs toward engineers
tomoima525
0
280
A guide to writing specs toward engineers(Japanese)
tomoima525
9
2.5k
Migrating from Flow to TypeScript on a mono repo project
tomoima525
1
530
Other Decks in Programming
See All in Programming
推し活の ハイトラフィックに立ち向かう Railsとアーキテクチャ - Kaigi on Rails 2024
falcon8823
6
2.2k
プロジェクト新規参入者のリードタイム短縮の観点から見る、品質の高いコードとアーキテクチャを保つメリット
d_endo
1
1k
qmuntal/stateless のススメ
sgash708
0
120
破壊せよ!データ破壊駆動で考えるドメインモデリング / data-destroy-driven
minodriven
16
4k
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
150
Googleのテストサイズを活用したテスト環境の構築
toms74209200
0
270
外部システム連携先が10を超えるシステムでのアーキテクチャ設計・実装事例
kiwasaki
1
220
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
210
CSC509 Lecture 09
javiergs
PRO
0
110
推し活としてのrails new/oshikatsu_ha_iizo
sakahukamaki
3
1.7k
EventSourcingの理想と現実
wenas
6
2.1k
Importmapを使ったJavaScriptの 読み込みとブラウザアドオンの影響
swamp09
4
1.2k
Featured
See All Featured
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
How STYLIGHT went responsive
nonsquared
95
5.2k
What's in a price? How to price your products and services
michaelherold
243
12k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
790
Happy Clients
brianwarren
97
6.7k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Agile that works and the tools we love
rasmusluckow
327
21k
Typedesign – Prime Four
hannesfritz
39
2.4k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
43
6.6k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Transcript
The Hitch Hiker’s Guide to Android Pay @Shibuya.apk 11/22/2016 Tomoaki
Imai
twitter: @tomoaki_imai github: tomoima525 ࠓҪ ஐষ Android Engineer http://mercan.mercari.com/entry/2016/11/18/110000
࠷ۙHotͳ
None
|| Pay Apple Pay & Android Pay
Mercari supports and
Android Pay ֓ཁ • Google AccountʹܾࡁใΛඥ͚ • ొޙجຊతʹϫϯλοϓͰߪೖ ྃͰ͖Δ •
ܾࡁใΛʹอ࣋͠ͳ͍(Apple PayϩʔΧϧʹ҉߸Խͯ͠อଘ) • (ݱঢ়USͷΈ) ళฮܾࡁΫʔϙϯػ ೳରԠ • Android OS 4.4Ҏ্
Coming Japan 2017?
“ͪΐͪΐͬͱೖΕͯΑ” ͱݴΘΕͨ࣌ʹࠔΒͳ͍ͨΊʹ!
Agenda • Android Payಋೖཁ݅/ಋೖεέδϡʔϧ • Android PayͷΈ • ·ͬͨ͜ͱ
Agenda • Android Payಋೖཁ݅/ಋೖεέδϡʔϧ • Android PayͷΈ • ·ͬͨ͜ͱ
ಋೖཁ݅ • Processor(ܾࡁߦձࣾ)͕ରԠ͍ͯ͠Δ • Mercariͷ߹Braintreeͱ͍͏Processorͱఏܞ͍ͯ͠Δ • play service SDK 9.0.0Ҏ্(9.0.0ҎԼͰରԠ͍ͯ͠Δ͕ɺProcessor͕ఏڙͯ͠
͍ΔSDKͱ߹ੑ͕औΕͳ͘ͳΔՄೳੑ͕͋Δ) compile “com.google.android.gms:play-services-base:9.0.0" compile "com.google.android.gms:play-services-wallet:9.0.0"
Android Pay ಋೖεέδϡʔϧ • ։ൃ։࢝~ϩʔϯν·Ͱ3िؒ • ࣮ΑΓUIݕ౼, ϑΟʔυόοΫରԠ͕͔͔࣌ؒͬͨ • αʔόʔαΠυʹ͍ͭͯɺApple
Pay ͷΈ͕ྲྀ༻Ͱ͖ͨͷͰରԠͳ͠ "OESPJE1BZ"1*Λͬͯ ࣮ࡍʹΞϓϦΛ࡞Δ%BZ )BDLBUIPO ͜͜ͰϓϩτλΠϓ࡞ Android Pay Hackathon week1 week2 Launch ࣮࣌ͷෆ໌(PPHMFࣾ ʹ͍߹Θͤ "QLΛૹ σβΠϯ͕ΨΠυϥΠϯʹ Ԋ͍ͬͯΔ͔ ڍಈʹͳ͍͔ ϓϩτλΠϓ ༷σβΠϯ ࣮ςετ (PPHMFϨϏϡʔϑΟʔυόοΫରԠ ༻ڥͰͷ ར༻ͷղআ
Agenda • Android Payಋೖཁ݅/ಋೖεέδϡʔϧ • Android PayͷΈ • ·ͬͨ͜ͱ
Android Pay ͷΈ ͕"OESPJE1BZʹରԠ͍ͯ͠Δ͔νΣοΫ 8BMMFU1BZNFOUTJT3FBEZ5P1BZ ܾࡁΛ͢Δͷʹඞཁͳ5PLFOΛ1SPDFTTPSʹϦΫΤετ AndroidPay.getTokenizationParameters(braintreeFragment, (parameters, allowedCardNetworks) ->
{…}); 5PLFOΛݩʹ.BTLFE8BMMFUΛੜ ॅॴใɺӅṭ͞ΕͨΫϨΧใؚ͕·ΕΔ Wallet.Payments.loadMaskedWallet(googleApiClient, maskedWalletRequest, requestCode); .BTLFE8BMMFU͔Β'VMM8BMMFUΛੜ ΫϨΧܾࡁͷͨΊʹඞཁͳτʔΫϯใ͕͋Δ Wallet.Payments.loadFullWallet(googleApiClient, fullWalletRequest, REQUEST_FULL_WALLET); τʔΫϯใΛݩʹܾࡁΛߦ͏ AndroidPay.tokenize(braintreeFragment, fullWallet); Processor Google Server Client
Agenda • Android Payಋೖཁ݅/ಋೖεέδϡʔϧ • Android PayͷΈ • ·ͬͨ͜ͱ
Masked Wallet? Full Wallet? • MaskedWallet, Full Walletͷׂ • MaskedWalletܾࡁલʹϢʔβʔఏࣔʹඞཁͳใ(ActivityؒͰ͍·Θ͠OK)
• FullWalletܾࡁ࣌ʹඞཁͳใ(Ұ͖ΓɺຖMaskedWallet͔Βੜ) public MaskedWalletRequest createMaskedWalletRequest(PaymentMethodTokenizationParameters parameters, Collection<Integer> allowedCardNetworks, int finalPaymentPrice){ Cart cart = Cart.newBuilder().setCurrencyCode(Const.CURRENCY_USD) .setTotalPrice(finalPaymentPrice).build(); / return MaskedWalletRequest.newBuilder() .setPaymentMethodTokenizationParameters(parameters) .addAllowedCardNetworks(allowedCardNetworks) .setMerchantName(Const.MERCHANT_NAME) .setCurrencyCode(Const.CURRENCY_USD) .setEstimatedTotalPrice(cart.getTotalPrice()) .setCart(cart) .setShippingAddressRequired(true) .build(); } • Ͳ͏͍͏ใΛͦΕͧΕͷλΠϛϯάͰGoogleଆʹૹΕྑ͍͔Θ͔Βͳ͍ • ૹΕྑ͍ใΛ֬ೝ
ຬ͖ͨ͢ཁ͕݅৭ʑ • Branding Requirements • https://developers.google.com/android-pay/ui-branding • https://android-pay-toolkit.withgoogle.com/overview/in-android-applications • ༻ՄೳͳϩΰɺαΠζɺจݴ
• ϑϩʔͷ؍Ͱͷཁ݅ • ඇରԠͰදࣔ͠ͳ͍ etc
ݕূ͕େม • ରԠ͢ΔΫϨδοτΧʔυ͕खݩʹඞཁ ‣ ProcessorʹΑͬͯςετΧʔυ͕ར༻Ͱ͖ͳ͍ ‣ ࣗલͷΧʔυ͏ -> ొ੍ݶʹҾ͔͔ͬͬͯΧʔυఀࢭ •
༻ڥͰͷݕূGoogleͷApproveΛड͚͔ͯΒ(ͭ·Γϩʔϯνલ) • PreAuthorize(Ұར༻ͨ͠߹ʹͦͷೝূΛ࠶ར༻ग़དྷΔػೳ)Λoffʹ͢Δ ߹ʹ app ͷstorekeyΛม͑Δඞཁ͕͋Δ
ProcessorʹΑ࣮ͬͯҟͳΔ • Processor֤ࣾʹΑ࣮ͬͯͷํ๏͕ҟͳΔ • Processor͕มΘΔͱશͯมΘΔՄೳੑ͕͋Δ mGoogleApiClient = new GoogleApiClient.Builder(getActivity()) .enableAutoManage(fragmentActivity,
this /* onConnectionFailedListener */) .setAccountName(accountName) // optional .addApi(Wallet.API, new Wallet.WalletOptions.Builder() .setEnvironment(Constants.WALLET_ENVIRONMENT) .setTheme(WalletConstants.THEME_LIGHT) .build()) .build(); Wallet.Payments.loadFullWallet(mGoogleApiClient, fullWalletRequest, REQUEST_CODE_RESOLVE_LOAD_FULL_WALLET); braintreeFragment.getGoogleApiClient(googleApiClient -> Wallet.Payments.loadFullWallet(googleApiClient, fullWalletRequest, REQUEST_FULL_WALLET)); Braintree Stripe
·ͱΊ • ಋೖཁ݅Λຬ͍ͨͯ͠Δ͔֬ೝ! • ϨϏϡʔؚΊ3िؒΛݟ͓ͯ͘ͷ͕٢(αʔόαΠυผ) • ಋೖલʹΨΠυϥΠϯਫ਼ಡ/ αϯϓϧΞϓϦ৮Δ • https://github.com/android-pay/androidpay-quickstart
• https://codelabs.developers.google.com/codelabs/android- pay