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.graphics.drawable.Drawable; | 7 import android.graphics.drawable.Drawable; |
8 | 8 |
9 import org.json.JSONObject; | 9 import org.json.JSONObject; |
10 | 10 |
11 import org.chromium.chrome.browser.payments.ui.PaymentOption; | 11 import org.chromium.chrome.browser.payments.ui.PaymentOption; |
12 import org.chromium.payments.mojom.PaymentItem; | 12 import org.chromium.payments.mojom.PaymentItem; |
13 | 13 |
14 import java.util.List; | 14 import java.util.List; |
15 | 15 |
16 /** | 16 /** |
17 * The base class for a single payment instrument, e.g., a credit card. | 17 * The base class for a single payment instrument, e.g., a credit card. |
18 */ | 18 */ |
19 public abstract class PaymentInstrument extends PaymentOption { | 19 public abstract class PaymentInstrument extends PaymentOption { |
20 /** | 20 /** |
21 * The interface for the requester of instrument details. | 21 * The interface for the requester of instrument details. |
22 */ | 22 */ |
23 public interface InstrumentDetailsCallback { | 23 public interface InstrumentDetailsCallback { |
24 /** | 24 /** |
| 25 * Called by the credit card payment instrument when CVC has been unmask
ed, but billing |
| 26 * address has not been normalized yet. |
| 27 */ |
| 28 void loadingInstrumentDetails(); |
| 29 |
| 30 /** |
25 * Called after retrieving instrument details. | 31 * Called after retrieving instrument details. |
26 * | 32 * |
27 * @param methodName Method name. For example, "visa". | 33 * @param methodName Method name. For example, "visa". |
28 * @param stringifiedDetails JSON-serialized object. For example, {"card
": "123"}. | 34 * @param stringifiedDetails JSON-serialized object. For example, {"card
": "123"}. |
29 */ | 35 */ |
30 void onInstrumentDetailsReady(String methodName, String stringifiedDetai
ls); | 36 void onInstrumentDetailsReady(String methodName, String stringifiedDetai
ls); |
31 | 37 |
32 /** | 38 /** |
33 * Called if unable to retrieve instrument details. | 39 * Called if unable to retrieve instrument details. |
34 */ | 40 */ |
(...skipping 25 matching lines...) Expand all Loading... |
60 */ | 66 */ |
61 public abstract void getInstrumentDetails(String merchantName, String origin
, PaymentItem total, | 67 public abstract void getInstrumentDetails(String merchantName, String origin
, PaymentItem total, |
62 List<PaymentItem> cart, JSONObject details, InstrumentDetailsCallbac
k callback); | 68 List<PaymentItem> cart, JSONObject details, InstrumentDetailsCallbac
k callback); |
63 | 69 |
64 /** | 70 /** |
65 * Cleans up any resources held by the payment instrument. For example, clos
es server | 71 * Cleans up any resources held by the payment instrument. For example, clos
es server |
66 * connections. | 72 * connections. |
67 */ | 73 */ |
68 public abstract void dismissInstrument(); | 74 public abstract void dismissInstrument(); |
69 } | 75 } |
OLD | NEW |