OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.payments; | 5 package org.chromium.chrome.browser.payments; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.os.Handler; | 8 import android.os.Handler; |
9 import android.view.View; | 9 import android.view.View; |
10 import android.view.ViewGroup; | 10 import android.view.ViewGroup; |
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 private InstrumentsCallback mCallback; | 884 private InstrumentsCallback mCallback; |
885 | 885 |
886 TestPay(String methodName, int instrumentPresence, int responseSpeed) { | 886 TestPay(String methodName, int instrumentPresence, int responseSpeed) { |
887 mMethodName = methodName; | 887 mMethodName = methodName; |
888 mInstrumentPresence = instrumentPresence; | 888 mInstrumentPresence = instrumentPresence; |
889 mResponseSpeed = responseSpeed; | 889 mResponseSpeed = responseSpeed; |
890 } | 890 } |
891 | 891 |
892 @Override | 892 @Override |
893 public void getInstruments(Map<String, PaymentMethodData> methodData, St
ring origin, | 893 public void getInstruments(Map<String, PaymentMethodData> methodData, St
ring origin, |
894 InstrumentsCallback instrumentsCallback) { | 894 byte[][] certificateChain, InstrumentsCallback instrumentsCallba
ck) { |
895 mCallback = instrumentsCallback; | 895 mCallback = instrumentsCallback; |
896 respond(); | 896 respond(); |
897 } | 897 } |
898 | 898 |
899 void respond() { | 899 void respond() { |
900 final List<PaymentInstrument> instruments = new ArrayList<>(); | 900 final List<PaymentInstrument> instruments = new ArrayList<>(); |
901 if (mInstrumentPresence == HAVE_INSTRUMENTS) { | 901 if (mInstrumentPresence == HAVE_INSTRUMENTS) { |
902 instruments.add(new TestPayInstrument(mMethodName)); | 902 instruments.add(new TestPayInstrument(mMethodName)); |
903 } | 903 } |
904 Runnable instrumentsReady = new Runnable() { | 904 Runnable instrumentsReady = new Runnable() { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 } | 944 } |
945 | 945 |
946 @Override | 946 @Override |
947 public Set<String> getInstrumentMethodNames() { | 947 public Set<String> getInstrumentMethodNames() { |
948 Set<String> result = new HashSet<>(); | 948 Set<String> result = new HashSet<>(); |
949 result.add(mMethodName); | 949 result.add(mMethodName); |
950 return result; | 950 return result; |
951 } | 951 } |
952 | 952 |
953 @Override | 953 @Override |
954 public void invokePaymentApp(String merchantName, String origin, | 954 public void invokePaymentApp(String merchantName, String origin, byte[][
] certificateChain, |
955 Map<String, PaymentMethodData> methodData, PaymentItem total, | 955 Map<String, PaymentMethodData> methodData, PaymentItem total, |
956 List<PaymentItem> displayItems, Map<String, PaymentDetailsModifi
er> modifiers, | 956 List<PaymentItem> displayItems, Map<String, PaymentDetailsModifi
er> modifiers, |
957 InstrumentDetailsCallback detailsCallback) { | 957 InstrumentDetailsCallback detailsCallback) { |
958 detailsCallback.onInstrumentDetailsReady( | 958 detailsCallback.onInstrumentDetailsReady( |
959 mMethodName, "{\"transaction\": 1337}"); | 959 mMethodName, "{\"transaction\": 1337}"); |
960 } | 960 } |
961 | 961 |
962 @Override | 962 @Override |
963 public void dismissInstrument() {} | 963 public void dismissInstrument() {} |
964 } | 964 } |
965 } | 965 } |
OLD | NEW |