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
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
250
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
6
970
nekko cloudにおけるProxmox VE利用事例
irumaru
3
430
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
Spatial Rendering for Apple Vision Pro
warrenm
0
110
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
250
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
330
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
3
390
Security_for_introducing_eBPF
kentatada
0
110
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
Featured
See All Featured
Producing Creativity
orderedlist
PRO
341
39k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Git: the NoSQL Database
bkeepers
PRO
427
64k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
4 Signs Your Business is Dying
shpigford
181
21k
How To Stay Up To Date on Web Technology
chriscoyier
789
250k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
How STYLIGHT went responsive
nonsquared
95
5.2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
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