BasketManager¶
-
public class
BasketManager
¶ The manager for the basket attached to a transaction. This is used when a basket is involved in a transaction, but is not required to process a simple sale.
Methods¶
addDonations¶
-
public BasketEvent
addDonations
(ArrayList<Donation> donations, AmountTotals amountTotals)¶ add donations to the existing basket object.
- Parameters:
offers – The list of donationss to be added to the basket.
amountTotals – The total running amounts to display on the customer-facing screen. This is a required field.
addMerchandise¶
-
public BasketEvent
addMerchandise
(ArrayList<Merchandise> merchandise, AmountTotals amountTotals)¶ Adds the items to the basket, notifying listening applications and updating the display.
- Parameters:
merchandise – The items to add to the basket.
amountTotals – The total running amounts to display on the customer-facing screen. This is a required field.
- Return:
The status indicating if the item was successfully added after sending the add request to the display. This does not return information regarding the display.
addModifierToMerchandise¶
-
public BasketEvent
addModifierToMerchandise
(Modifier modifier, Merchandise merchandise, AmountTotals amountTotals)¶ Adds a modifier to an existing merchandise object.
- Parameters:
modifier – The modifer to add to this merchandise object.
merchandise – The items to modify with the new values, but containing the existing Basket Item ID.
amountTotals – The total running amounts to display on the customer-facing screen. This is a required field.
addOffers¶
-
public BasketEvent
addOffers
(ArrayList<Offer> offers, AmountTotals amountTotals)¶ add offers (coupons, discounts, loyalty, etc.) to the existing basket object.
- Parameters:
offers – The list of offers to be added to the basket.
amountTotals – The total running amounts to display on the customer-facing screen. This is a required field.
finalizeBasket¶
-
public BasketEvent
finalizeBasket
()¶ Lets the payment application know that the POS has finished with the initial basket and can allow other applications to make adjustments via the REQUEST_BASKET_ADJUSTMENT trigger. The attached transaction listeners will be notified if any changes are made, and can respond with a finalized basket directly to the event. After closing the basket, no further actions should be performed on it using the basket manager.
- Return:
The status indicating success or failure.
getBasket¶
getCurrentAmountTotals¶
-
public AmountTotals
getCurrentAmountTotals
()¶ Returns the current tracked Amount Totals.
getSessionId¶
modifyDonations¶
-
public BasketEvent
modifyDonations
(ArrayList<Donation> donations, AmountTotals amountTotals)¶ modify donations attached to the existing basket object.
- Parameters:
offers – The list of donations to be modified in the basket.
amountTotals – The total running amounts to display on the customer-facing screen. This is a required field.
modifyMerchandise¶
-
public BasketEvent
modifyMerchandise
(ArrayList<Merchandise> merchandise, AmountTotals amountTotals)¶ Modifies the items in the basket, notifying listening applications and updating the display. Uses the Basket Item ID to apply the new values.
- Parameters:
merchandise – The items to modify with the new values, but containing the existing Basket Item ID.
amountTotals – The total running amounts to display on the customer-facing screen. This is a required field.
- Return:
The status indicating if the modification was successfully sent to the display. This does not return information regarding the display.
modifyOffers¶
-
public BasketEvent
modifyOffers
(ArrayList<Offer> offers, AmountTotals amountTotals)¶ modify offers (coupons, discounts, loyalty, etc.) attached to the existing basket object.
- Parameters:
offers – The list of offers to be modified in the basket.
amountTotals – The total running amounts to display on the customer-facing screen. This is a required field.
purgeBasket¶
-
public BasketEvent
purgeBasket
()¶ Removes all items in the basket and resets the basket state to open.
- Return:
The status indicating success or failure.
registerBasket¶
-
public BasketEvent
registerBasket
(Basket basket, AmountTotals totals)¶ Allows attaching a pre-existing basket to the current transaction. This returns an error if a basket has already been opened and has items.
- Parameters:
basket – The pre-existing basket.
totals – The total running amounts to display on the customer-facing screen. This is a required field.
- Return:
The status indicating success or failure.
removeDonations¶
-
public BasketEvent
removeDonations
(ArrayList<Donation> donations, AmountTotals amountTotals)¶ remove donations from the existing basket object.
- Parameters:
offers – The list of donations to be removed from the basket.
amountTotals – The total running amounts to display on the customer-facing screen. This is a required field.
removeMerchandise¶
-
public BasketEvent
removeMerchandise
(ArrayList<Merchandise> merchandise, AmountTotals amountTotals)¶ Removes the items from the basket, notifying listening applications and updating the display. Uses the Basket Item ID to remove the proper items.
- Parameters:
merchandise – The items to remove.
amountTotals – The total running amounts to display on the customer-facing screen. This is a required field.
- Return:
The status indicating if the item was successfully removed after sending the removal request to the display. This does not return information regarding the display.
removeModifierFromMerchandise¶
-
public BasketEvent
removeModifierFromMerchandise
(Modifier modifier, Merchandise merchandise, AmountTotals amountTotals)¶ Removes a modifier from an existing merchandise object.
- Parameters:
modifier – The modifer to remove from this merchandise object.
merchandise – The items to modify with the new values, but containing the existing Basket Item ID.
amountTotals – The total running amounts to display on the customer-facing screen. This is a required field.
removeOffers¶
-
public BasketEvent
removeOffers
(ArrayList<Offer> offers, AmountTotals amountTotals)¶ remove offers (coupons, discounts, loyalty, etc.) from the existing basket object.
- Parameters:
offers – The list of offers to be removed from the basket.
amountTotals – The total running amounts to display on the customer-facing screen. This is a required field.