Subversion Repositories SmartDukaan

Rev

Rev 7953 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7953 Rev 20278
Line 14... Line 14...
14
    private static Logger log = Logger.getLogger(Class.class);
14
    private static Logger log = Logger.getLogger(Class.class);
15
 
15
 
16
    private long paymentId;
16
    private long paymentId;
17
 
17
 
18
    @Override
18
    @Override
19
    public long createPayment(long userId, long txnId, String paymentOption, int gatewayId) {
19
    public long createPayment(long userId, long txnId, String paymentOption, int gatewayId, String paymentType) {
20
        log.info("Creating payment for the txn#: " + txnId + " for the user: " + userId + " for processing through COUPON");
20
        log.info("Creating payment for the txn#: " + txnId + " for the user: " + userId + " for processing through COUPON");
21
        CommonPaymentService cps = new CommonPaymentService();
21
        CommonPaymentService cps = new CommonPaymentService();
22
        if(!cps.createPayment(userId, txnId, gatewayId)){
22
        if(!cps.createPayment(userId, txnId, gatewayId)){
23
            log.error("Error while creating the basic payment");
23
            log.error("Error while creating the basic payment");
24
            return PAYMENT_NOT_CREATED;
24
            return PAYMENT_NOT_CREATED;
Line 26... Line 26...
26
        paymentId = cps.getPaymentId();
26
        paymentId = cps.getPaymentId();
27
 
27
 
28
        if(paymentOption != null){
28
        if(paymentOption != null){
29
            List<Attribute> attributes = new ArrayList<Attribute>();
29
            List<Attribute> attributes = new ArrayList<Attribute>();
30
            attributes.add(new Attribute(IPaymentService.PAYMENT_METHOD, paymentOption));
30
            attributes.add(new Attribute(IPaymentService.PAYMENT_METHOD, paymentOption));
-
 
31
            attributes.add(new Attribute(IPaymentService.PAYMENT_TYPE, "COUPON"));
31
        }
32
        }
32
 
33
 
33
        return paymentId;
34
        return paymentId;
34
    }
35
    }
35
}
36
}
36
37