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
パッションの見つけ方,育て方
tomoima525
1
60
Decentralized ID とWebの未来
tomoima525
0
150
Web3/メタバースにおけるグローバルのトレンドと活用の最前線
tomoima525
2
2.9k
自分の道の歩み方~楽しくチャレンジするためのヒント~
tomoima525
2
460
Continuum: Background Checker with Zero-Knowledge Proof
tomoima525
0
2.5k
Catching up with TurboModule
tomoima525
1
3.7k
シリコンバレースタートアップのリモート開発
tomoima525
3
1.9k
A guide to writing specs toward engineers
tomoima525
0
290
A guide to writing specs toward engineers(Japanese)
tomoima525
9
2.5k
Other Decks in Programming
See All in Programming
range over funcの使い道と非同期N+1リゾルバーの夢 / about a range over func
mackee
0
110
第5回日本眼科AI学会総会_AIコンテスト_3位解法
neilsaw
0
170
MCP with Cloudflare Workers
yusukebe
2
220
HTTP compression in PHP and Symfony apps
dunglas
2
1.7k
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
2
460
採用事例の少ないSvelteを選んだ理由と それを正解にするためにやっていること
oekazuma
2
1k
Zoneless Testing
rainerhahnekamp
0
120
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
330
バグを見つけた?それAppleに直してもらおう!
uetyo
0
180
快速入門可觀測性
blueswen
0
330
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
440
fs2-io を試してたらバグを見つけて直した話
chencmd
0
220
Featured
See All Featured
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
For a Future-Friendly Web
brad_frost
175
9.4k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Scaling GitHub
holman
458
140k
Practical Orchestrator
shlominoach
186
10k
4 Signs Your Business is Dying
shpigford
181
21k
KATA
mclloyd
29
14k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
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