Commit 7936c6ed authored by Liquan (Max) Gu's avatar Liquan (Max) Gu Committed by Commit Bot

[PRImpl] Move PRImpl's request params into PaymentRequestSpec

Change:
Only moving mId, mRawShippingOptions, mRawLineItems, mRawTotal.

Bug: 1102522

Change-Id: I58f1e56a2a51a4deacd4d2684ccb56456677fdb3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2390942
Commit-Queue: Liquan (Max) Gu <maxlg@chromium.org>
Reviewed-by: default avatarSahel Sharify <sahel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805156}
parent 521940cd
...@@ -224,33 +224,7 @@ public class PaymentRequestImpl ...@@ -224,33 +224,7 @@ public class PaymentRequestImpl
private boolean mHasClosed; private boolean mHasClosed;
/**
* The raw total amount being charged, as it was received from the website. This data is passed
* to the payment app.
*/
private PaymentItem mRawTotal;
/**
* The raw items in the shopping cart, as they were received from the website. This data is
* passed to the payment app.
*/
private List<PaymentItem> mRawLineItems;
/**
* The raw shipping options, as it was received from the website. This data is passed to the
* payment app when the app is responsible for handling shipping address.
*/
private List<PaymentShippingOption> mRawShippingOptions;
/**
* A mapping from method names to modifiers, which include modified totals and additional line
* items. Used to display modified totals for each payment apps, modified total in order
* summary, and additional line items in order summary.
*/
private Map<String, PaymentDetailsModifier> mModifiers = new ArrayMap<>();
private PaymentRequestSpec mSpec; private PaymentRequestSpec mSpec;
private String mId;
private Map<String, PaymentMethodData> mMethodData; private Map<String, PaymentMethodData> mMethodData;
private int mShippingType; private int mShippingType;
private boolean mIsFinishedQueryingPaymentApps; private boolean mIsFinishedQueryingPaymentApps;
...@@ -414,7 +388,8 @@ public class PaymentRequestImpl ...@@ -414,7 +388,8 @@ public class PaymentRequestImpl
mSpec = new PaymentRequestSpec(mPaymentOptions, mMethodData.values()); mSpec = new PaymentRequestSpec(mPaymentOptions, mMethodData.values());
if (parseAndValidateDetails(details) if (parseAndValidateDetails(details)
&& parseAndValidateDetailsForSkipToGPayHelper(details)) { && parseAndValidateDetailsForSkipToGPayHelper(details)) {
mPaymentUIsManager.updateDetailsOnPaymentRequestUI(details, mRawTotal, mRawLineItems); mPaymentUIsManager.updateDetailsOnPaymentRequestUI(
details, mSpec.getRawTotal(), mSpec.getRawLineItems());
} else { } else {
mJourneyLogger.setAborted(AbortReason.INVALID_DATA_FROM_RENDERER); mJourneyLogger.setAborted(AbortReason.INVALID_DATA_FROM_RENDERER);
disconnectFromClientWithDebugMessage(ErrorStrings.INVALID_PAYMENT_DETAILS); disconnectFromClientWithDebugMessage(ErrorStrings.INVALID_PAYMENT_DETAILS);
...@@ -422,12 +397,12 @@ public class PaymentRequestImpl ...@@ -422,12 +397,12 @@ public class PaymentRequestImpl
} }
mSpec.createNative(details, LocaleUtils.getDefaultLocaleString()); mSpec.createNative(details, LocaleUtils.getDefaultLocaleString());
if (mRawTotal == null) { if (mSpec.getRawTotal() == null) {
mJourneyLogger.setAborted(AbortReason.INVALID_DATA_FROM_RENDERER); mJourneyLogger.setAborted(AbortReason.INVALID_DATA_FROM_RENDERER);
disconnectFromClientWithDebugMessage(ErrorStrings.TOTAL_REQUIRED); disconnectFromClientWithDebugMessage(ErrorStrings.TOTAL_REQUIRED);
return false; return false;
} }
mId = details.id; mSpec.setId(details.id);
// The first time initializations and validation of all of the parameters of {@link // The first time initializations and validation of all of the parameters of {@link
// PaymentRequestParams} should be done before {@link // PaymentRequestParams} should be done before {@link
...@@ -588,7 +563,8 @@ public class PaymentRequestImpl ...@@ -588,7 +563,8 @@ public class PaymentRequestImpl
// Send AppListReady signal when all apps are created and request.show() is called. // Send AppListReady signal when all apps are created and request.show() is called.
if (ComponentPaymentRequestImpl.getNativeObserverForTest() != null) { if (ComponentPaymentRequestImpl.getNativeObserverForTest() != null) {
ComponentPaymentRequestImpl.getNativeObserverForTest().onAppListReady( ComponentPaymentRequestImpl.getNativeObserverForTest().onAppListReady(
mPaymentUIsManager.getPaymentMethodsSection().getItems(), mRawTotal); mPaymentUIsManager.getPaymentMethodsSection().getItems(),
mSpec.getRawTotal());
} }
// Calculate skip ui and build ui only after all payment apps are ready and // Calculate skip ui and build ui only after all payment apps are ready and
// request.show() is called. // request.show() is called.
...@@ -641,12 +617,12 @@ public class PaymentRequestImpl ...@@ -641,12 +617,12 @@ public class PaymentRequestImpl
dimBackgroundIfNotBottomSheetPaymentHandler(selectedApp); dimBackgroundIfNotBottomSheetPaymentHandler(selectedApp);
mDidRecordShowEvent = true; mDidRecordShowEvent = true;
mJourneyLogger.setEventOccurred(Event.SKIPPED_SHOW); mJourneyLogger.setEventOccurred(Event.SKIPPED_SHOW);
assert mRawTotal != null; assert mSpec.getRawTotal() != null;
// The total amount in details should be finalized at this point. So it is safe to // The total amount in details should be finalized at this point. So it is safe to
// record the triggered transaction amount. // record the triggered transaction amount.
assert !mWaitForUpdatedDetails; assert !mWaitForUpdatedDetails;
mJourneyLogger.recordTransactionAmount( mJourneyLogger.recordTransactionAmount(mSpec.getRawTotal().amount.currency,
mRawTotal.amount.currency, mRawTotal.amount.value, false /*completed*/); mSpec.getRawTotal().amount.value, false /*completed*/);
onPayClicked(null /* selectedShippingAddress */, null /* selectedShippingOption */, onPayClicked(null /* selectedShippingAddress */, null /* selectedShippingOption */,
selectedApp); selectedApp);
} }
...@@ -680,7 +656,8 @@ public class PaymentRequestImpl ...@@ -680,7 +656,8 @@ public class PaymentRequestImpl
if (mMinimalUi.show(chromeActivity, if (mMinimalUi.show(chromeActivity,
BottomSheetControllerProvider.from(chromeActivity.getWindowAndroid()), BottomSheetControllerProvider.from(chromeActivity.getWindowAndroid()),
(PaymentApp) mPaymentUIsManager.getPaymentMethodsSection().getSelectedItem(), (PaymentApp) mPaymentUIsManager.getPaymentMethodsSection().getSelectedItem(),
mPaymentUIsManager.getCurrencyFormatterMap().get(mRawTotal.amount.currency), mPaymentUIsManager.getCurrencyFormatterMap().get(
mSpec.getRawTotal().amount.currency),
mPaymentUIsManager.getUiShoppingCart().getTotal(), this::onMinimalUIReady, mPaymentUIsManager.getUiShoppingCart().getTotal(), this::onMinimalUIReady,
this::onMinimalUiConfirmed, this::onMinimalUiDismissed)) { this::onMinimalUiConfirmed, this::onMinimalUiDismissed)) {
mDidRecordShowEvent = true; mDidRecordShowEvent = true;
...@@ -698,8 +675,8 @@ public class PaymentRequestImpl ...@@ -698,8 +675,8 @@ public class PaymentRequestImpl
} }
private void onMinimalUiConfirmed(PaymentApp app) { private void onMinimalUiConfirmed(PaymentApp app) {
mJourneyLogger.recordTransactionAmount( mJourneyLogger.recordTransactionAmount(mSpec.getRawTotal().amount.currency,
mRawTotal.amount.currency, mRawTotal.amount.value, false /*completed*/); mSpec.getRawTotal().amount.value, false /*completed*/);
app.disableShowingOwnUI(); app.disableShowingOwnUI();
onPayClicked(null /* selectedShippingAddress */, null /* selectedShippingOption */, app); onPayClicked(null /* selectedShippingAddress */, null /* selectedShippingOption */, app);
} }
...@@ -773,12 +750,12 @@ public class PaymentRequestImpl ...@@ -773,12 +750,12 @@ public class PaymentRequestImpl
if (TextUtils.isEmpty(shippingOptionId) || mComponentPaymentRequestImpl == null if (TextUtils.isEmpty(shippingOptionId) || mComponentPaymentRequestImpl == null
|| mInvokedPaymentApp == null || mInvokedPaymentApp == null
|| mInvokedPaymentApp.isWaitingForPaymentDetailsUpdate() || !mRequestShipping || mInvokedPaymentApp.isWaitingForPaymentDetailsUpdate() || !mRequestShipping
|| mRawShippingOptions == null) { || mSpec.getRawShippingOptions() == null) {
return false; return false;
} }
boolean isValidId = false; boolean isValidId = false;
for (PaymentShippingOption option : mRawShippingOptions) { for (PaymentShippingOption option : mSpec.getRawShippingOptions()) {
if (shippingOptionId.equals(option.id)) { if (shippingOptionId.equals(option.id)) {
isValidId = true; isValidId = true;
break; break;
...@@ -951,7 +928,8 @@ public class PaymentRequestImpl ...@@ -951,7 +928,8 @@ public class PaymentRequestImpl
if (parseAndValidateDetails(details) if (parseAndValidateDetails(details)
&& parseAndValidateDetailsForSkipToGPayHelper(details)) { && parseAndValidateDetailsForSkipToGPayHelper(details)) {
mPaymentUIsManager.updateDetailsOnPaymentRequestUI(details, mRawTotal, mRawLineItems); mPaymentUIsManager.updateDetailsOnPaymentRequestUI(
details, mSpec.getRawTotal(), mSpec.getRawLineItems());
} else { } else {
mJourneyLogger.setAborted(AbortReason.INVALID_DATA_FROM_RENDERER); mJourneyLogger.setAborted(AbortReason.INVALID_DATA_FROM_RENDERER);
disconnectFromClientWithDebugMessage(ErrorStrings.INVALID_PAYMENT_DETAILS); disconnectFromClientWithDebugMessage(ErrorStrings.INVALID_PAYMENT_DETAILS);
...@@ -997,7 +975,8 @@ public class PaymentRequestImpl ...@@ -997,7 +975,8 @@ public class PaymentRequestImpl
if (parseAndValidateDetails(details) if (parseAndValidateDetails(details)
&& parseAndValidateDetailsForSkipToGPayHelper(details)) { && parseAndValidateDetailsForSkipToGPayHelper(details)) {
mPaymentUIsManager.updateDetailsOnPaymentRequestUI(details, mRawTotal, mRawLineItems); mPaymentUIsManager.updateDetailsOnPaymentRequestUI(
details, mSpec.getRawTotal(), mSpec.getRawLineItems());
} else { } else {
mJourneyLogger.setAborted(AbortReason.INVALID_DATA_FROM_RENDERER); mJourneyLogger.setAborted(AbortReason.INVALID_DATA_FROM_RENDERER);
disconnectFromClientWithDebugMessage(ErrorStrings.INVALID_PAYMENT_DETAILS); disconnectFromClientWithDebugMessage(ErrorStrings.INVALID_PAYMENT_DETAILS);
...@@ -1025,9 +1004,9 @@ public class PaymentRequestImpl ...@@ -1025,9 +1004,9 @@ public class PaymentRequestImpl
// condition is already met. Otherwise it will get recorded when triggered condition becomes // condition is already met. Otherwise it will get recorded when triggered condition becomes
// true. // true.
if (mDidRecordShowEvent) { if (mDidRecordShowEvent) {
assert mRawTotal != null; assert mSpec.getRawTotal() != null;
mJourneyLogger.recordTransactionAmount( mJourneyLogger.recordTransactionAmount(mSpec.getRawTotal().amount.currency,
mRawTotal.amount.currency, mRawTotal.amount.value, false /*completed*/); mSpec.getRawTotal().amount.value, false /*completed*/);
} }
triggerPaymentAppUiSkipIfApplicable(chromeActivity); triggerPaymentAppUiSkipIfApplicable(chromeActivity);
...@@ -1101,34 +1080,34 @@ public class PaymentRequestImpl ...@@ -1101,34 +1080,34 @@ public class PaymentRequestImpl
if (!PaymentValidator.validatePaymentDetails(details)) return false; if (!PaymentValidator.validatePaymentDetails(details)) return false;
if (details.total != null) { if (details.total != null) {
mRawTotal = details.total; mSpec.setRawTotal(details.total);
} }
if (mRawLineItems == null || details.displayItems != null) { if (mSpec.getRawLineItems() == null || details.displayItems != null) {
mRawLineItems = Collections.unmodifiableList(details.displayItems != null mSpec.setRawLineItems(Collections.unmodifiableList(details.displayItems != null
? Arrays.asList(details.displayItems) ? Arrays.asList(details.displayItems)
: new ArrayList<>()); : new ArrayList<>()));
} }
if (details.modifiers != null) { if (details.modifiers != null) {
if (details.modifiers.length == 0) mModifiers.clear(); if (details.modifiers.length == 0) mSpec.getModifiers().clear();
for (int i = 0; i < details.modifiers.length; i++) { for (int i = 0; i < details.modifiers.length; i++) {
PaymentDetailsModifier modifier = details.modifiers[i]; PaymentDetailsModifier modifier = details.modifiers[i];
String method = modifier.methodData.supportedMethod; String method = modifier.methodData.supportedMethod;
mModifiers.put(method, modifier); mSpec.getModifiers().put(method, modifier);
} }
} }
if (details.shippingOptions != null) { if (details.shippingOptions != null) {
mRawShippingOptions = mSpec.setRawShippingOptions(
Collections.unmodifiableList(Arrays.asList(details.shippingOptions)); Collections.unmodifiableList(Arrays.asList(details.shippingOptions)));
} else if (mRawShippingOptions == null) { } else if (mSpec.getRawShippingOptions() == null) {
mRawShippingOptions = Collections.unmodifiableList(new ArrayList<>()); mSpec.setRawShippingOptions(Collections.unmodifiableList(new ArrayList<>()));
} }
assert mRawTotal != null; assert mSpec.getRawTotal() != null;
assert mRawLineItems != null; assert mSpec.getRawLineItems() != null;
return true; return true;
} }
...@@ -1165,9 +1144,9 @@ public class PaymentRequestImpl ...@@ -1165,9 +1144,9 @@ public class PaymentRequestImpl
// finalized (i.e. mWaitForUpdatedDetails == false). Otherwise it will get recorded when // finalized (i.e. mWaitForUpdatedDetails == false). Otherwise it will get recorded when
// the updated details become available. // the updated details become available.
if (!mWaitForUpdatedDetails) { if (!mWaitForUpdatedDetails) {
assert mRawTotal != null; assert mSpec.getRawTotal() != null;
mJourneyLogger.recordTransactionAmount( mJourneyLogger.recordTransactionAmount(mSpec.getRawTotal().amount.currency,
mRawTotal.amount.currency, mRawTotal.amount.value, false /*completed*/); mSpec.getRawTotal().amount.value, false /*completed*/);
} }
} }
...@@ -1316,8 +1295,8 @@ public class PaymentRequestImpl ...@@ -1316,8 +1295,8 @@ public class PaymentRequestImpl
if (mMethodData.containsKey(paymentMethodName)) { if (mMethodData.containsKey(paymentMethodName)) {
methodData.put(paymentMethodName, mMethodData.get(paymentMethodName)); methodData.put(paymentMethodName, mMethodData.get(paymentMethodName));
} }
if (mModifiers.containsKey(paymentMethodName)) { if (mSpec.getModifiers().containsKey(paymentMethodName)) {
modifiers.put(paymentMethodName, mModifiers.get(paymentMethodName)); modifiers.put(paymentMethodName, mSpec.getModifiers().get(paymentMethodName));
} }
if (paymentMethodName.equals(MethodStrings.ANDROID_PAY) if (paymentMethodName.equals(MethodStrings.ANDROID_PAY)
|| paymentMethodName.equals(MethodStrings.GOOGLE_PAY)) { || paymentMethodName.equals(MethodStrings.GOOGLE_PAY)) {
...@@ -1351,12 +1330,13 @@ public class PaymentRequestImpl ...@@ -1351,12 +1330,13 @@ public class PaymentRequestImpl
// Redact shipping options if the selected app cannot handle shipping. // Redact shipping options if the selected app cannot handle shipping.
List<PaymentShippingOption> redactedShippingOptions = List<PaymentShippingOption> redactedShippingOptions =
mInvokedPaymentApp.handlesShippingAddress() mInvokedPaymentApp.handlesShippingAddress()
? mRawShippingOptions ? mSpec.getRawShippingOptions()
: Collections.unmodifiableList(new ArrayList<>()); : Collections.unmodifiableList(new ArrayList<>());
mInvokedPaymentApp.invokePaymentApp(mId, mMerchantName, mTopLevelOrigin, mInvokedPaymentApp.invokePaymentApp(mSpec.getId(), mMerchantName, mTopLevelOrigin,
mPaymentRequestOrigin, mCertificateChain, Collections.unmodifiableMap(methodData), mPaymentRequestOrigin, mCertificateChain, Collections.unmodifiableMap(methodData),
mRawTotal, mRawLineItems, Collections.unmodifiableMap(modifiers), paymentOptions, mSpec.getRawTotal(), mSpec.getRawLineItems(),
redactedShippingOptions, this); Collections.unmodifiableMap(modifiers), paymentOptions, redactedShippingOptions,
this);
mJourneyLogger.setEventOccurred(Event.PAY_CLICKED); mJourneyLogger.setEventOccurred(Event.PAY_CLICKED);
boolean isAutofillCard = mInvokedPaymentApp.isAutofillInstrument(); boolean isAutofillCard = mInvokedPaymentApp.isAutofillInstrument();
...@@ -1451,9 +1431,9 @@ public class PaymentRequestImpl ...@@ -1451,9 +1431,9 @@ public class PaymentRequestImpl
if (!PaymentPreferencesUtil.isPaymentCompleteOnce()) { if (!PaymentPreferencesUtil.isPaymentCompleteOnce()) {
PaymentPreferencesUtil.setPaymentCompleteOnce(); PaymentPreferencesUtil.setPaymentCompleteOnce();
} }
assert mRawTotal != null; assert mSpec.getRawTotal() != null;
mJourneyLogger.recordTransactionAmount( mJourneyLogger.recordTransactionAmount(mSpec.getRawTotal().amount.currency,
mRawTotal.amount.currency, mRawTotal.amount.value, true /*completed*/); mSpec.getRawTotal().amount.value, true /*completed*/);
} }
/** Update records of the used payment app for sorting payment apps next time. */ /** Update records of the used payment app for sorting payment apps next time. */
...@@ -1644,7 +1624,7 @@ public class PaymentRequestImpl ...@@ -1644,7 +1624,7 @@ public class PaymentRequestImpl
// PaymentAppFactoryParams implementation. // PaymentAppFactoryParams implementation.
@Override @Override
public String getId() { public String getId() {
return mId; return mSpec.getId();
} }
// PaymentAppFactoryParams implementation. // PaymentAppFactoryParams implementation.
...@@ -1675,13 +1655,13 @@ public class PaymentRequestImpl ...@@ -1675,13 +1655,13 @@ public class PaymentRequestImpl
// PaymentAppFactoryParams implementation. // PaymentAppFactoryParams implementation.
@Override @Override
public Map<String, PaymentDetailsModifier> getUnmodifiableModifiers() { public Map<String, PaymentDetailsModifier> getUnmodifiableModifiers() {
return Collections.unmodifiableMap(mModifiers); return Collections.unmodifiableMap(mSpec.getModifiers());
} }
// PaymentAppFactoryParams implementation. // PaymentAppFactoryParams implementation.
@Override @Override
public PaymentItem getRawTotal() { public PaymentItem getRawTotal() {
return mRawTotal; return mSpec.getRawTotal();
} }
// PaymentAppFactoryParams implementation. // PaymentAppFactoryParams implementation.
...@@ -1869,7 +1849,8 @@ public class PaymentRequestImpl ...@@ -1869,7 +1849,8 @@ public class PaymentRequestImpl
// Send AppListReady signal when all apps are created and request.show() is called. // Send AppListReady signal when all apps are created and request.show() is called.
if (ComponentPaymentRequestImpl.getNativeObserverForTest() != null) { if (ComponentPaymentRequestImpl.getNativeObserverForTest() != null) {
ComponentPaymentRequestImpl.getNativeObserverForTest().onAppListReady( ComponentPaymentRequestImpl.getNativeObserverForTest().onAppListReady(
mPaymentUIsManager.getPaymentMethodsSection().getItems(), mRawTotal); mPaymentUIsManager.getPaymentMethodsSection().getItems(),
mSpec.getRawTotal());
} }
// Calculate skip ui and build ui only after all payment apps are ready and // Calculate skip ui and build ui only after all payment apps are ready and
// request.show() is called, since only then whether or not should skip payment sheet UI // request.show() is called, since only then whether or not should skip payment sheet UI
......
...@@ -129,6 +129,7 @@ android_library("java") { ...@@ -129,6 +129,7 @@ android_library("java") {
"//mojo/public/java:bindings_java", "//mojo/public/java:bindings_java",
"//mojo/public/java:system_java", "//mojo/public/java:system_java",
"//third_party/android_deps:androidx_annotation_annotation_java", "//third_party/android_deps:androidx_annotation_annotation_java",
"//third_party/android_deps:androidx_collection_collection_java",
"//third_party/blink/public/mojom:android_mojo_bindings_java", "//third_party/blink/public/mojom:android_mojo_bindings_java",
"//url:gurl_java", "//url:gurl_java",
"//url:origin_java", "//url:origin_java",
......
...@@ -5,17 +5,23 @@ ...@@ -5,17 +5,23 @@
package org.chromium.components.payments; package org.chromium.components.payments;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.collection.ArrayMap;
import org.chromium.base.annotations.CalledByNative; import org.chromium.base.annotations.CalledByNative;
import org.chromium.base.annotations.JNINamespace; import org.chromium.base.annotations.JNINamespace;
import org.chromium.base.annotations.NativeMethods; import org.chromium.base.annotations.NativeMethods;
import org.chromium.payments.mojom.PaymentDetails; import org.chromium.payments.mojom.PaymentDetails;
import org.chromium.payments.mojom.PaymentDetailsModifier;
import org.chromium.payments.mojom.PaymentItem;
import org.chromium.payments.mojom.PaymentMethodData; import org.chromium.payments.mojom.PaymentMethodData;
import org.chromium.payments.mojom.PaymentOptions; import org.chromium.payments.mojom.PaymentOptions;
import org.chromium.payments.mojom.PaymentShippingOption;
import org.chromium.payments.mojom.PaymentValidationErrors; import org.chromium.payments.mojom.PaymentValidationErrors;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.Collection; import java.util.Collection;
import java.util.List;
import java.util.Map;
/** /**
* Container for information received from the renderer that invoked the Payment Request API. Owns * Container for information received from the renderer that invoked the Payment Request API. Owns
...@@ -24,6 +30,13 @@ import java.util.Collection; ...@@ -24,6 +30,13 @@ import java.util.Collection;
*/ */
@JNINamespace("payments::android") @JNINamespace("payments::android")
public class PaymentRequestSpec { public class PaymentRequestSpec {
// TODO(crbug.com/1124917): these parameters duplicate with those in payment_request_spec from
// the blink side. We need to de-dup them.
private Map<String, PaymentDetailsModifier> mModifiers = new ArrayMap<>();
private String mId;
private List<PaymentShippingOption> mRawShippingOptions;
private List<PaymentItem> mRawLineItems;
private PaymentItem mRawTotal;
private final PaymentOptions mOptions; private final PaymentOptions mOptions;
private final Collection<PaymentMethodData> mMethodData; private final Collection<PaymentMethodData> mMethodData;
private long mNativePointer; private long mNativePointer;
...@@ -51,6 +64,64 @@ public class PaymentRequestSpec { ...@@ -51,6 +64,64 @@ public class PaymentRequestSpec {
details.serialize(), MojoStructCollection.serialize(mMethodData), appLocale); details.serialize(), MojoStructCollection.serialize(mMethodData), appLocale);
} }
/**
* A mapping from method names to modifiers, which include modified totals and additional line
* items. Used to display modified totals for each payment apps, modified total in order
* summary, and additional line items in order summary.
*/
public Map<String, PaymentDetailsModifier> getModifiers() {
return mModifiers;
}
/** @return The id of the request, found in PaymentDetails. */
public String getId() {
return mId;
}
/** Set the id found from PaymentDetails. */
public void setId(String id) {
mId = id;
}
/**
* The raw shipping options, as it was received from the website. This data is passed to the
* payment app when the app is responsible for handling shipping address.
*/
public List<PaymentShippingOption> getRawShippingOptions() {
return mRawShippingOptions;
}
/** Set the raw shipping options found from PaymentDetails. */
public void setRawShippingOptions(List<PaymentShippingOption> rawShippingOptions) {
mRawShippingOptions = rawShippingOptions;
}
/**
* The raw items in the shopping cart, as they were received from the website. This data is
* passed to the payment app.
*/
public List<PaymentItem> getRawLineItems() {
return mRawLineItems;
}
/** Set the raw payment items found in PaymentDetails. */
public void setRawLineItems(List<PaymentItem> rawLineItems) {
mRawLineItems = rawLineItems;
}
/**
* The raw total amount being charged, as it was received from the website. This data is passed
* to the payment app.
*/
public PaymentItem getRawTotal() {
return mRawTotal;
}
/** Set the total property found from PaymentDetails. */
public void setRawTotal(PaymentItem rawTotal) {
mRawTotal = rawTotal;
}
/** /**
* Called when the renderer updates the payment details in response to, e.g., new shipping * Called when the renderer updates the payment details in response to, e.g., new shipping
* address. * address.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment