All Known Implementing Classes:
ExternalOfferProvider

public interface OfferProvider
Provider for interfacing with Offers and the Offer Engine.
Author:
Sunny Yu
  • Method Summary

    Modifier and Type
    Method
    Description
    generateCodesForVouchers(VoucherCodeGenerationRequest voucherCodeGenerationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Generates OfferCodes for voucher offers based on the given VoucherCodeGenerationRequest.
    com.broadleafcommerce.promotion.offer.client.web.context.OfferAndOfferCodeUsageValidationResult
    validateVoucherOfferUsages(com.broadleafcommerce.order.client.domain.Order order, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    Validates existing vouchers stored in Order.getVouchers() to ensure that they are still valid and applicable to the given Order.
  • Method Details

    • validateVoucherOfferUsages

      com.broadleafcommerce.promotion.offer.client.web.context.OfferAndOfferCodeUsageValidationResult validateVoucherOfferUsages(com.broadleafcommerce.order.client.domain.Order order, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Validates existing vouchers stored in Order.getVouchers() to ensure that they are still valid and applicable to the given Order.
      Parameters:
      order - the Order containing the Vouchers to validate against
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      an OfferAndOfferCodeUsageValidationResult containing details about any invalid Offers and failure messages
    • generateCodesForVouchers

      CodeGenerationResult generateCodesForVouchers(VoucherCodeGenerationRequest voucherCodeGenerationRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Generates OfferCodes for voucher offers based on the given VoucherCodeGenerationRequest.

      This method will generate and return the OfferCodes in the same request, therefore it's meant for small batch of code generation only.

      Parameters:
      voucherCodeGenerationRequest - the VoucherCodeGenerationRequest to generate the voucher OfferCodes with
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      the CodeGenerationResult containing the generated voucher OfferCodes based on the given VoucherCodeGenerationRequest