-
- All Implemented Interfaces:
-
android.os.Parcelable
public class OrderSummary implements Parcelable
Class to configure order summary screen content
-
-
Field Summary
Fields Modifier and Type Field Description private LinkedHashMap<String, Double>orderItemsprivate DoubleorderTotalprivate StringpaymentDetailsprivate StringpaymentBrandprivate StringshippingInfopublic final static Parcelable.Creator<OrderSummary>CREATOR
-
Constructor Summary
Constructors Constructor Description OrderSummary(LinkedHashMap<String, Double> orderItems, Double orderTotal, String paymentDetails, String paymentBrand)Default constructor for creating OrderSummary object OrderSummary(LinkedHashMap<String, Double> orderItems, Double orderTotal, PaymentData googlePaymentData)Constructor for creating OrderSummary object from Google Pay PaymentData response object
-
Method Summary
Modifier and Type Method Description LinkedHashMap<String, Double>getOrderItems()Map of order items with localized labels and amount OrderSummarysetOrderItems(@NonNull() LinkedHashMap<String, Double> orderItems)Sets map of order items. DoublegetOrderTotal()Returns total amount for the order OrderSummarysetOrderTotal(@NonNull() Double orderTotal)Sets total amount for the order StringgetPaymentDetails()Returns the text with information about the way the shopper wants to pay OrderSummarysetPaymentDetails(@NonNull() String paymentDetails)Sets text with information about the way the shopper wants to pay StringgetPaymentBrand()Returns payment brand constant OrderSummarysetPaymentBrand(@NonNull() String paymentBrand)Sets payment brand to show appropriate brand logo StringgetShippingInfo()Returns shipping details, might be a multi-line string OrderSummarysetShippingInfo(@Nullable() String shippingInfo)Sets shipping details to show on summary screen intdescribeContents()voidwriteToParcel(Parcel dest, int flags)booleanequals(@Nullable() Object o)inthashCode()-
-
Constructor Detail
-
OrderSummary
OrderSummary(LinkedHashMap<String, Double> orderItems, Double orderTotal, String paymentDetails, String paymentBrand)
Default constructor for creating OrderSummary object- Parameters:
orderItems- order items with localized labels and amount, e.g.orderTotal- total amount of the order, e.g.paymentDetails- payment method details, e.g.paymentBrand- payment brand constant
-
OrderSummary
OrderSummary(LinkedHashMap<String, Double> orderItems, Double orderTotal, PaymentData googlePaymentData)
Constructor for creating OrderSummary object from Google Pay PaymentData response object- Parameters:
orderItems- order items with localized labels and amount, e.g.orderTotal- total amount of the order, e.g.googlePaymentData- PaymentData response object
-
-
Method Detail
-
getOrderItems
@NonNull() LinkedHashMap<String, Double> getOrderItems()
Map of order items with localized labels and amount
-
setOrderItems
@NonNull() OrderSummary setOrderItems(@NonNull() LinkedHashMap<String, Double> orderItems)
Sets map of order items. E.g. 'Subtotal' >90.00, 'Shipping cost' >10.00. Total amount should be set separately setOrderTotal.
- Parameters:
orderItems- order items, not including total amount
-
getOrderTotal
@NonNull() Double getOrderTotal()
Returns total amount for the order
-
setOrderTotal
@NonNull() OrderSummary setOrderTotal(@NonNull() Double orderTotal)
Sets total amount for the order
- Parameters:
orderTotal- total amount for the order, e.g.
-
getPaymentDetails
@NonNull() String getPaymentDetails()
Returns the text with information about the way the shopper wants to pay
-
setPaymentDetails
@NonNull() OrderSummary setPaymentDetails(@NonNull() String paymentDetails)
Sets text with information about the way the shopper wants to pay
- Parameters:
paymentDetails- payment method details, e.g.
-
getPaymentBrand
@NonNull() String getPaymentBrand()
Returns payment brand constant
-
setPaymentBrand
@NonNull() OrderSummary setPaymentBrand(@NonNull() String paymentBrand)
Sets payment brand to show appropriate brand logo
- Parameters:
paymentBrand- payment brand, e.g.
-
getShippingInfo
@Nullable() String getShippingInfo()
Returns shipping details, might be a multi-line string
-
setShippingInfo
@NonNull() OrderSummary setShippingInfo(@Nullable() String shippingInfo)
Sets shipping details to show on summary screen
- Parameters:
shippingInfo- shipping details, might be a multi-line string
-
describeContents
int describeContents()
-
writeToParcel
void writeToParcel(Parcel dest, int flags)
-
hashCode
int hashCode()
-
-
-
-