AmountAdjustedEventResponse

public class AmountAdjustedEventResponse

Methods

applyAdjustments

public void applyAdjustments(ArrayList<AmountAdjustment> adjustments)

Sets the adjustments and performs the calculations to change the appropriate amounts. Please note, this does not change the tax amount, only the total amounts for both the transaction and the current payment.

asCommerceResponse

public static CommerceResponse asCommerceResponse(AmountAdjustedEventResponse amountAdjustedEventResponse)

Generate CommerceResponse from the provided response

asTransactionEventResponse

public static TransactionEventResponse asTransactionEventResponse(AmountAdjustedEventResponse amountAdjustedEventResponse)

Return TransactionEventResponse from the provided response

getInvoiceId

public String getInvoiceId()

Returns invoice id from event

getPayment

public Payment getPayment()

Returns the payment object that started the amount adjustment process. To update this, either update this object directly or use updatePayment(Payment);

getTransaction

public Transaction getTransaction()

Return Transaction from event

setAdjustments

public void setAdjustments(ArrayList<AmountAdjustment> adjustments)

Set the actual adjustments that are being applied to the transaction. Passing null removes any adjustments. This assumes that any recalculation of totals are being performed separately by updating the payment and transaction objects directly, or by using the applyAdjustments(AmountAdjustment[]) method.

updatePayment

public void updatePayment(Payment payment)

Update the payment object with the appropriate amounts and set it here.

updateTransaction

public void updateTransaction(Transaction transaction)

Update transaction from response