Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1279)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/payments/AndroidPaymentApp.java

Issue 2640743005: PaymentApp: Implement invokePaymentApp for Android (Closed)
Patch Set: Fix a compile error Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/payments/AutofillPaymentInstrument.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/payments/AndroidPaymentApp.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/payments/AndroidPaymentApp.java b/chrome/android/java/src/org/chromium/chrome/browser/payments/AndroidPaymentApp.java
index 4fc52011f997f428b6c49a675241d970a72997fd..0cf740802273d9c8679e2093d7060fcb13880f4b 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/payments/AndroidPaymentApp.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/payments/AndroidPaymentApp.java
@@ -21,6 +21,7 @@ import org.chromium.IsReadyToPayServiceCallback;
import org.chromium.chrome.R;
import org.chromium.content.browser.ContentViewCore;
import org.chromium.content_public.browser.WebContents;
+import org.chromium.payments.mojom.PaymentDetailsModifier;
import org.chromium.payments.mojom.PaymentItem;
import org.chromium.payments.mojom.PaymentMethodData;
import org.chromium.ui.base.WindowAndroid;
@@ -201,8 +202,9 @@ public class AndroidPaymentApp extends PaymentInstrument implements PaymentApp,
}
@Override
- public void invokePaymentApp(String merchantName, String origin, PaymentItem total,
- List<PaymentItem> cart, Map<String, PaymentMethodData> methodDataMap,
+ public void invokePaymentApp(String merchantName, String origin,
+ Map<String, PaymentMethodData> methodDataMap, PaymentItem total,
+ List<PaymentItem> displayItems, Map<String, PaymentDetailsModifier> modifiers,
InstrumentDetailsCallback callback) {
assert !mMethodNames.isEmpty();
Bundle extras = new Bundle();
@@ -215,7 +217,7 @@ public class AndroidPaymentApp extends PaymentInstrument implements PaymentApp,
extras.putString(
EXTRA_DATA, methodData == null ? EMPTY_JSON_DATA : methodData.stringifiedData);
- String details = serializeDetails(total, cart);
+ String details = serializeDetails(total, displayItems);
extras.putString(EXTRA_DETAILS, details == null ? EMPTY_JSON_DATA : details);
mPayIntent.putExtras(extras);
@@ -247,7 +249,7 @@ public class AndroidPaymentApp extends PaymentInstrument implements PaymentApp,
});
}
- private static String serializeDetails(PaymentItem total, List<PaymentItem> cart) {
+ private static String serializeDetails(PaymentItem total, List<PaymentItem> displayItems) {
StringWriter stringWriter = new StringWriter();
JsonWriter json = new JsonWriter(stringWriter);
try {
@@ -260,10 +262,10 @@ public class AndroidPaymentApp extends PaymentInstrument implements PaymentApp,
// }}} total
// displayitems {{{
- if (cart != null) {
+ if (displayItems != null) {
json.name("displayItems").beginArray();
- for (int i = 0; i < cart.size(); i++) {
- serializePaymentItem(json, cart.get(i));
+ for (int i = 0; i < displayItems.size(); i++) {
+ serializePaymentItem(json, displayItems.get(i));
}
json.endArray();
}
« no previous file with comments | « no previous file | chrome/android/java/src/org/chromium/chrome/browser/payments/AutofillPaymentInstrument.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698