Subversion Repositories SmartDukaan

Rev

Rev 3903 | Rev 4453 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3903 Rev 4392
Line 35... Line 35...
35
public class ProceedToPayController extends BaseController {
35
public class ProceedToPayController extends BaseController {
36
    
36
    
37
    private static Logger logger = Logger.getLogger(ProceedToPayController.class);
37
    private static Logger logger = Logger.getLogger(ProceedToPayController.class);
38
    
38
    
39
    private static final ResourceBundle resource = ResourceBundle.getBundle(ProceedToPayController.class.getName());
39
    private static final ResourceBundle resource = ResourceBundle.getBundle(ProceedToPayController.class.getName());
-
 
40
    private static final double COD_MIN_AMOUNT = Double.parseDouble(resource.getString("cod_min_amount"));
40
    private static final double COD_CUTOFF_AMOUNT = Double.parseDouble(resource.getString("cod_cutoff_amount")); 
41
    private static final double COD_MAX_AMOUNT = Double.parseDouble(resource.getString("cod_max_amount")); 
41
    private static final String RECAPTCHA_PUBLIC_KEY = resource.getString("recaptcha_public_key");
42
    private static final String RECAPTCHA_PUBLIC_KEY = resource.getString("recaptcha_public_key");
42
    private static final boolean SHOW_EBS_TEST_GATEWAY = Boolean.parseBoolean(resource.getString("show_ebs_test_gateway"));
43
    private static final boolean SHOW_EBS_TEST_GATEWAY = Boolean.parseBoolean(resource.getString("show_ebs_test_gateway"));
43
    
44
    
44
    private long addressId = -1;
45
    private long addressId = -1;
45
    private String totalAmount = "";
46
    private String totalAmount = "";
Line 119... Line 120...
119
        try {
120
        try {
120
            CatalogClient catalogServiceClient  = new CatalogClient();
121
            CatalogClient catalogServiceClient  = new CatalogClient();
121
            in.shop2020.model.v1.catalog.InventoryService.Client catalogClient = catalogServiceClient.getClient();
122
            in.shop2020.model.v1.catalog.InventoryService.Client catalogClient = catalogServiceClient.getClient();
122
            for (Line line : lineItems) {
123
            for (Line line : lineItems) {
123
                Item item = catalogClient.getItemForSource(line.getItemId(), sourceId);
124
                Item item = catalogClient.getItemForSource(line.getItemId(), sourceId);
124
                if(item.getSellingPrice() > COD_CUTOFF_AMOUNT)
125
                if(item.getSellingPrice() > COD_MAX_AMOUNT || item.getSellingPrice() < COD_MIN_AMOUNT )
125
                    showCodOption = false;    
126
                    showCodOption = false;    
126
            }
127
            }
127
        } catch(Exception e) {
128
        } catch(Exception e) {
128
            logger.error("Error while getting item info from the catalog service", e);
129
            logger.error("Error while getting item info from the catalog service", e);
129
            addActionError("We are experiencing some problem. Please try again.");
130
            addActionError("We are experiencing some problem. Please try again.");