Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentInstrument.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentInstrument.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentInstrument.java |
| index 34f3ed8260ada6490e483aef3e56536479f6388e..3e136d081e304cb75fc24888b71c49d8548bcc67 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentInstrument.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/PaymentInstrument.java |
| @@ -11,6 +11,8 @@ import org.chromium.payments.mojom.PaymentItem; |
| import org.chromium.payments.mojom.PaymentMethodData; |
| import java.util.List; |
| +import java.util.Map; |
| +import java.util.Set; |
| /** |
| * The base class for a single payment instrument, e.g., a credit card. |
| @@ -21,10 +23,10 @@ public abstract class PaymentInstrument extends PaymentOption { |
| */ |
| public interface InstrumentDetailsCallback { |
| /** |
| - * Called by the credit card payment instrument when CVC has been unmasked, but billing |
| - * address has not been normalized yet. |
| + * Called by the payment instrument to let the UI that there will be a delay in |
|
please use gerrit instead
2016/11/29 14:17:18
Called by the payment instrument to let Chrome kno
tommyt
2016/11/30 10:15:50
Done.
|
| + * loading the instrument details. This is a good time to show some loading UI. |
| */ |
| - void loadingInstrumentDetails(); |
| + void onInstrumentDetailsLoading(); |
|
please use gerrit instead
2016/11/29 14:17:18
onInstrumentdetailsLoadingWithoutUI();
tommyt
2016/11/30 10:15:49
Done.
|
| /** |
| * Called after retrieving instrument details. |
| @@ -45,26 +47,31 @@ public abstract class PaymentInstrument extends PaymentOption { |
| } |
| /** |
| - * Returns a method name for this instrument, e.g., "visa" or "mastercard" in basic card |
| - * payments: https://w3c.github.io/webpayments-methods-card/#method-id |
| + * Returns a set of payment method names for this instrument, e.g., "visa" or |
| + * "mastercard" in basic card payments: |
| + * https://w3c.github.io/webpayments-methods-card/#method-id |
| * |
| * @return The method names for this instrument. |
| */ |
| - public abstract String getInstrumentMethodName(); |
| + public abstract Set<String> getInstrumentMethodNames(); |
| /** |
| - * Asynchronously retrieves the instrument details and invokes the callback with the result. |
| + * Invoke a payment app using this payment instrument. |
|
please use gerrit instead
2016/11/29 14:17:18
Invoke the payment app to retrieve this payment in
tommyt
2016/11/30 10:15:50
How about if I take a step back and use something
|
| + * |
| + * The callback will be invoked with the resulting payment details or error. |
| * |
| * @param merchantName The name of the merchant. |
| * @param origin The origin of this merchant. |
| * @param total The total amount. |
| * @param items The shopping cart items. |
| - * @param details The payment-method specific data, e.g., whether the app should be invoked |
| - * in test or production key, a merchant identifier, or a public key. |
| + * @param methodData The payment-method specific data for all applicable payment methods, |
| + * e.g., whether the app should be invoked in test or production key, a |
| + * merchant identifier, or a public key. |
| * @param callback The object that will receive the instrument details. |
| */ |
| - public abstract void getInstrumentDetails(String merchantName, String origin, PaymentItem total, |
| - List<PaymentItem> cart, PaymentMethodData details, InstrumentDetailsCallback callback); |
| + public abstract void invokePayment(String merchantName, String origin, PaymentItem total, |
|
please use gerrit instead
2016/11/29 14:17:18
invokePaymentApp().
tommyt
2016/11/30 10:15:50
Done.
|
| + List<PaymentItem> cart, Map<String, PaymentMethodData> methodData, |
| + InstrumentDetailsCallback callback); |
| /** |
| * Cleans up any resources held by the payment instrument. For example, closes server |