Skip to content

Commit

Permalink
update bidFloor
Browse files Browse the repository at this point in the history
  • Loading branch information
pro-nsk committed Jul 27, 2023
1 parent 84a5005 commit ee0833e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.prebid.server.bidder.model.BidderCall;
import org.prebid.server.bidder.model.BidderError;
import org.prebid.server.bidder.model.HttpRequest;
import org.prebid.server.bidder.model.Price;
import org.prebid.server.bidder.model.Result;
import org.prebid.server.exception.PreBidException;
import org.prebid.server.json.DecodeException;
Expand All @@ -30,6 +31,8 @@
import java.util.List;
import java.util.Objects;

import static org.prebid.server.util.BidderUtil.isValidPrice;

public class AlkimiBidder implements Bidder<BidRequest> {

private final String endpointUrl;
Expand Down Expand Up @@ -69,8 +72,10 @@ private Imp updateImp(Imp imp, ExtImpAlkimi extImpAlkimi) {
final Banner updatedBanner = updateBanner(imp.getBanner(), position);
final Video updatedVideo = updateVideo(imp.getVideo(), position);

final Price bidFloorPrice = Price.of(imp.getBidfloorcur(), imp.getBidfloor());

return imp.toBuilder()
.bidfloor(extImpAlkimi.getBidFloor())
.bidfloor(isValidPrice(bidFloorPrice) ? bidFloorPrice.getValue() : extImpAlkimi.getBidFloor())
.banner(updatedBanner)
.video(updatedVideo)
.ext(makeImpExt(imp, updatedBanner, updatedVideo, extImpAlkimi))
Expand Down

0 comments on commit ee0833e

Please sign in to comment.