package com.ruoyi.app.utils.zaloPay;

import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;

@Data
@Component
public class ZaloPayConfig {

    @Autowired
    private ZaloPayProperties zaloPayProperties;
    public ZaloPayProperties.ZaloPayConfig getZaloPayConfig(String payType) {
        return zaloPayProperties.getConfigs().stream().filter(config -> payType.equals(config.getPay_type())).findFirst().orElse(null);
    }
}
