-
- 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>
orderItems
private Double
orderTotal
private String
paymentDetails
private String
paymentBrand
private String
shippingInfo
public 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 OrderSummary
setOrderItems(@NonNull() LinkedHashMap<String, Double> orderItems)
Sets map of order items. Double
getOrderTotal()
Returns total amount for the order OrderSummary
setOrderTotal(@NonNull() Double orderTotal)
Sets total amount for the order String
getPaymentDetails()
Returns the text with information about the way the shopper wants to pay OrderSummary
setPaymentDetails(@NonNull() String paymentDetails)
Sets text with information about the way the shopper wants to pay String
getPaymentBrand()
Returns payment brand constant OrderSummary
setPaymentBrand(@NonNull() String paymentBrand)
Sets payment brand to show appropriate brand logo String
getShippingInfo()
Returns shipping details, might be a multi-line string OrderSummary
setShippingInfo(@Nullable() String shippingInfo)
Sets shipping details to show on summary screen int
describeContents()
void
writeToParcel(Parcel dest, int flags)
boolean
equals(@Nullable() Object o)
int
hashCode()
-
-
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()
-
-
-
-