BasketAdjustedEventResponse

public class BasketAdjustedEventResponse

Allows editing the adjustments that will be applied to the basket. The initial object rejects all adjustments, use setFinalAdjustments(BasketAdjustment,AmountTotals) or setFinalBasket(Basket,AmountTotals) with the adjustments to allow any of them to be included. When this response is sent, the com.verifone.commerce.triggers.BasketFinalizedNotification will be sent, and the listener will receive the BasketEvent with the BasketEvent.BasketAction.FINALIZED action.

Methods

asCommerceResponse

public static CommerceResponse asCommerceResponse(BasketAdjustedEventResponse basketAdjustedEventResponse)

Generate CommerceResponse from the provided response

asTransactionEventResponse

public static TransactionEventResponse asTransactionEventResponse(BasketAdjustedEventResponse basketAdjustedEventResponse)

Return TransactionEventResponse from the provided response

getFinalAdjustments

public BasketAdjustment getFinalAdjustments()

Returns the value that was set for the final adjustments.

getFinalBasket

public Basket getFinalBasket()

Returns final basket

getFinalTotals

public AmountTotals getFinalTotals()

Returns final totals

getInvoiceId

public String getInvoiceId()

Returns invoice id from event

getTransaction

public Transaction getTransaction()

Return Transaction from event

hasAdjustment

public boolean hasAdjustment()

Returns true if this object has been updated with changes, otherwise false.

setFinalAdjustments

public void setFinalAdjustments(BasketAdjustment adjustments, AmountTotals amountTotals)

Set the adjustments that should be applied, and the appropriate running total. Use either this method or use setFinalBasket(Basket,AmountTotals), not both.

setFinalBasket

public void setFinalBasket(Basket basket, AmountTotals amountTotals)

updateTransaction

public void updateTransaction(Transaction transaction)

Update transaction from response