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 org.json.JSONObject; | |
8 | |
7 import org.chromium.chrome.browser.payments.ui.PaymentOption; | 9 import org.chromium.chrome.browser.payments.ui.PaymentOption; |
8 import org.chromium.payments.mojom.PaymentItem; | 10 import org.chromium.payments.mojom.PaymentItem; |
9 | 11 |
10 import org.json.JSONObject; | |
11 | |
12 import java.util.List; | 12 import java.util.List; |
13 | 13 |
14 /** | 14 /** |
15 * The base class for a single payment instrument, e.g., a credit card. | 15 * The base class for a single payment instrument, e.g., a credit card. |
16 */ | 16 */ |
17 public abstract class PaymentInstrument extends PaymentOption { | 17 public abstract class PaymentInstrument extends PaymentOption { |
18 /** | 18 /** |
19 * The interface for the requester of instrument details. | 19 * The interface for the requester of instrument details. |
20 */ | 20 */ |
21 public interface DetailsCallback { | 21 public interface DetailsCallback { |
22 /** | 22 /** |
23 * Called when loading the instrument details to tell the Payment Reques t UI to show a | |
please use gerrit instead
2016/10/18 17:30:31
s/when loading the instrument details/by the credi
sebsg
2016/10/18 22:44:31
This is very specific. I left it more general so i
| |
24 * loading UI. | |
25 */ | |
26 void loadingInstrumentDetails(); | |
27 | |
28 /** | |
23 * Called after retrieving instrument details. | 29 * Called after retrieving instrument details. |
24 * | 30 * |
25 * @param methodName Method name. For example, "visa". | 31 * @param methodName Method name. For example, "visa". |
26 * @param stringifiedDetails JSON-serialized object. For example, {"card ": "123"}. | 32 * @param stringifiedDetails JSON-serialized object. For example, {"card ": "123"}. |
27 */ | 33 */ |
28 void onInstrumentDetailsReady(String methodName, String stringifiedDetai ls); | 34 void onInstrumentDetailsReady(String methodName, String stringifiedDetai ls); |
29 | 35 |
30 /** | 36 /** |
31 * Called if unable to retrieve instrument details. | 37 * Called if unable to retrieve instrument details. |
32 */ | 38 */ |
(...skipping 25 matching lines...) Expand all Loading... | |
58 */ | 64 */ |
59 public abstract void getDetails(String merchantName, String origin, PaymentI tem total, | 65 public abstract void getDetails(String merchantName, String origin, PaymentI tem total, |
60 List<PaymentItem> cart, JSONObject details, DetailsCallback callback ); | 66 List<PaymentItem> cart, JSONObject details, DetailsCallback callback ); |
61 | 67 |
62 /** | 68 /** |
63 * Cleans up any resources held by the payment instrument. For example, clos es server | 69 * Cleans up any resources held by the payment instrument. For example, clos es server |
64 * connections. | 70 * connections. |
65 */ | 71 */ |
66 public abstract void dismiss(); | 72 public abstract void dismiss(); |
67 } | 73 } |
OLD | NEW |