Skip to content

Commit

Permalink
[AD-20] Fix for checkout on pdp
Browse files Browse the repository at this point in the history
  • Loading branch information
kpieloch committed Nov 9, 2023
1 parent 42bbd1d commit e0992db
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
import com.adyen.model.checkout.CreateCheckoutSessionRequest;
import com.adyen.model.checkout.PaymentsRequest;
import de.hybris.platform.commercefacades.order.data.CartData;
import org.apache.commons.collections.CollectionUtils;

public class SubscriptionsUtils {
public static boolean containsSubscription(CartData cartData){
return cartData.getEntries().stream().anyMatch(orderEntryData -> orderEntryData.getProduct().getSubscriptionTerm()!=null);
return CollectionUtils.isNotEmpty(cartData.getEntries()) && cartData.getEntries().stream().anyMatch(orderEntryData -> orderEntryData.getProduct().getSubscriptionTerm() != null);
}

public static PaymentsRequest.RecurringProcessingModelEnum findRecurringProcessingModel(CartData cartData){
Expand Down

0 comments on commit e0992db

Please sign in to comment.