BasketAdjustment

public class BasketAdjustment

Allows an application to propose changes to the basket using com.verifone.commerce.triggers.BasketAdjustmentResponse. When received in the com.verifone.payment_sdk.BasketAdjustedEvent, allows the recipient to determine which adjustments will actually be applied to the cart.

Methods

addDonation

public void addDonation(Donation donation)

Adds a donation.

addDonations

public void addDonations(ArrayList<Donation> donations)

Add list of donations to existed donations or create new list if no donations yet.

addOffer

public void addOffer(Offer offer)

Adds an offer.

addOffers

public void addOffers(ArrayList<Offer> offers)

Add list of offers to existed offers or create new list if no offers yet.

create

public static BasketAdjustment create()

getDonations

public ArrayList<Donation> getDonations()

Retrieves all of the donations that have been added to this response.

getOffers

public ArrayList<Offer> getOffers()

Retrieves all of the offers that have been added to this response. Creates an array backed by the underlying list.

isBasketAdjusted

public boolean isBasketAdjusted()

Returns true if any donations or offers have been added to the basket by the current application.

removeDonation

public void removeDonation(Donation donation)

Removes a donation from the list if it is present. Only affects donations added by the current application.

removeOffer

public void removeOffer(Offer offer)

Removes an offer from the list if it is present. Only affects offers added by the current application.

setBasketAdjusted

public void setBasketAdjusted(boolean adjusted)

Set basket adjusted (in case of offers, donations, etc.)