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
57
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.9k
A guide to writing specs toward engineers
tomoima525
0
280
A guide to writing specs toward engineers(Japanese)
tomoima525
9
2.5k
Other Decks in Programming
See All in Programming
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
Micro Frontends Unmasked Opportunities, Challenges, Alternatives
manfredsteyer
PRO
0
110
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
Outline View in SwiftUI
1024jp
1
330
Snowflake x dbtで作るセキュアでアジャイルなデータ基盤
tsoshiro
2
520
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
7
7.8k
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
610
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
430
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
930
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Unsuck your backbone
ammeep
668
57k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
Statistics for Hackers
jakevdp
796
220k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Typedesign – Prime Four
hannesfritz
40
2.4k
Docker and Python
trallard
40
3.1k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
4 Signs Your Business is Dying
shpigford
180
21k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Thoughts on Productivity
jonyablonski
67
4.3k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
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