// always make sure we have a valid code entry.
// this helps us to identify the item by code later on.
// we use the one from the argument, because that one tells us why this
// promotion is added...it might not just be the promotion code, but
// one of the thousand individual codes for it...thus we have an
// external algorithm that makes our lookup why this promotion is added.
$promotionItem->
setReferencedId($code);
// add custom content to our payload.
// we need this as meta data information.
$promotionItem->
setPayload( $this->
buildPayload( $code,
$discount,
$promotion,
$currencyId,
$currencyFactor ) );
// add our lazy-validation rules.
// this is required within the recalculation process.