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

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

Issue 2770193003: Implement request id in PaymentDetailsInit (Closed)
Patch Set: V2 Created 3 years, 9 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 a91adcd4ba9c4518beaa2c76be66d572f6620347..b700beea3ff67d0ae0db72c44f6bd1e2dd3a7318 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
@@ -56,6 +56,7 @@ public class AndroidPaymentApp
/** The maximum number of milliseconds to wait for a connection to READY_TO_PAY service. */
private static final long SERVICE_CONNECTION_TIMEOUT_MS = 1000;
+ private static final String EXTRA_REQUEST_ID = "requestId";
please use gerrit instead 2017/03/24 20:14:18 Why "requestId" instead of id"? What does the paym
private static final String EXTRA_MERCHANT_NAME = "merchantName";
private static final String EXTRA_METHOD_NAME = "methodName";
private static final String EXTRA_METHOD_NAMES = "methodNames";
@@ -146,8 +147,8 @@ public class AndroidPaymentApp
public void onServiceDisconnected(ComponentName name) {}
};
- mIsReadyToPayIntent.putExtras(buildExtras(
- null, origin, iframeOrigin, certificateChain, methodDataMap, null, null, null));
+ mIsReadyToPayIntent.putExtras(buildExtras(null, null, origin, iframeOrigin,
+ certificateChain, methodDataMap, null, null, null));
try {
if (!ContextUtils.getApplicationContext().bindService(
mIsReadyToPayIntent, mServiceConnection, Context.BIND_AUTO_CREATE)) {
@@ -243,8 +244,8 @@ public class AndroidPaymentApp
}
@Override
- public void invokePaymentApp(final String merchantName, final String origin,
- final String iframeOrigin, final byte[][] certificateChain,
+ public void invokePaymentApp(final String requestId, final String merchantName,
+ final String origin, final String iframeOrigin, final byte[][] certificateChain,
final Map<String, PaymentMethodData> methodDataMap, final PaymentItem total,
final List<PaymentItem> displayItems,
final Map<String, PaymentDetailsModifier> modifiers,
@@ -252,8 +253,8 @@ public class AndroidPaymentApp
mInstrumentDetailsCallback = callback;
if (!mIsIncognito) {
- launchPaymentApp(merchantName, origin, iframeOrigin, certificateChain, methodDataMap,
- total, displayItems, modifiers);
+ launchPaymentApp(requestId, merchantName, origin, iframeOrigin, certificateChain,
+ methodDataMap, total, displayItems, modifiers);
return;
}
@@ -270,7 +271,7 @@ public class AndroidPaymentApp
new OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
- launchPaymentApp(merchantName, origin, iframeOrigin,
+ launchPaymentApp(requestId, merchantName, origin, iframeOrigin,
certificateChain, methodDataMap, total, displayItems,
modifiers);
}
@@ -291,10 +292,10 @@ public class AndroidPaymentApp
.show();
}
- private void launchPaymentApp(String merchantName, String origin, String iframeOrigin,
- byte[][] certificateChain, Map<String, PaymentMethodData> methodDataMap,
- PaymentItem total, List<PaymentItem> displayItems,
- Map<String, PaymentDetailsModifier> modifiers) {
+ private void launchPaymentApp(String requestId, String merchantName, String origin,
+ String iframeOrigin, byte[][] certificateChain,
+ Map<String, PaymentMethodData> methodDataMap, PaymentItem total,
+ List<PaymentItem> displayItems, Map<String, PaymentDetailsModifier> modifiers) {
assert mMethodNames.containsAll(methodDataMap.keySet());
assert mInstrumentDetailsCallback != null;
@@ -304,20 +305,21 @@ public class AndroidPaymentApp
return;
}
- mPayIntent.putExtras(buildExtras(merchantName, origin, iframeOrigin, certificateChain,
- methodDataMap, total, displayItems, modifiers));
+ mPayIntent.putExtras(buildExtras(requestId, merchantName, origin, iframeOrigin,
+ certificateChain, methodDataMap, total, displayItems, modifiers));
if (!window.showIntent(mPayIntent, this, R.string.payments_android_app_error)) {
notifyErrorInvokingPaymentApp();
}
}
- private static Bundle buildExtras(@Nullable String merchantName, String origin,
- String iframeOrigin, @Nullable byte[][] certificateChain,
+ private static Bundle buildExtras(@Nullable String requestId, @Nullable String merchantName,
+ String origin, String iframeOrigin, @Nullable byte[][] certificateChain,
Map<String, PaymentMethodData> methodDataMap, @Nullable PaymentItem total,
@Nullable List<PaymentItem> displayItems,
@Nullable Map<String, PaymentDetailsModifier> modifiers) {
Bundle extras = new Bundle();
+ if (requestId != null) extras.putString(EXTRA_REQUEST_ID, requestId);
if (merchantName != null) extras.putString(EXTRA_MERCHANT_NAME, merchantName);
extras.putString(EXTRA_ORIGIN, origin);
extras.putString(EXTRA_IFRAME_ORIGIN, iframeOrigin);
« 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