Subversion Repositories SmartDukaan

Rev

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

Rev 6050 Rev 6390
Line 1... Line 1...
1
package in.shop2020.serving.services;
1
package in.shop2020.serving.services;
2
 
2
 
3
import in.shop2020.model.v1.order.RechargeOrder;
-
 
4
import in.shop2020.payments.Attribute;
3
import in.shop2020.payments.Attribute;
5
import in.shop2020.payments.Payment;
4
import in.shop2020.payments.Payment;
6
import in.shop2020.payments.PaymentStatus;
5
import in.shop2020.payments.PaymentStatus;
7
import in.shop2020.thrift.clients.PaymentClient;
6
import in.shop2020.thrift.clients.PaymentClient;
8
 
7
 
Line 13... Line 12...
13
 
12
 
14
public class HdfcEmiPaymentService implements IPaymentService {
13
public class HdfcEmiPaymentService implements IPaymentService {
15
    private static Logger log = Logger.getLogger(HdfcEmiPaymentService.class);
14
    private static Logger log = Logger.getLogger(HdfcEmiPaymentService.class);
16
    
15
    
17
    private String redirectURL;
16
    private String redirectURL;
18
    private static int gatewayId=5;
-
 
19
    
17
    
20
    public HdfcEmiPaymentService() {
18
    public HdfcEmiPaymentService() {
21
    
19
    
22
    }
20
    }
23
    
21
    
24
    public long createPayment(long currentCartId, long userId, long txnId, String paymentOption, long sourceId){
22
    public long createPayment(long userId, long txnId, String paymentOption, int gatewayId){
25
        log.info("Creating payment for the txn#: " + txnId + " for the user: " + userId + " for processing through HDFC EMI");
23
        log.info("Creating payment for the txn#: " + txnId + " for the user: " + userId + " for processing through HDFC EMI");
26
        CommonPaymentService cps = new CommonPaymentService();
24
        CommonPaymentService cps = new CommonPaymentService();
27
        if(!cps.createPayment(currentCartId, userId, txnId, gatewayId, sourceId)){
25
        if(!cps.createPayment(userId, txnId, gatewayId)){
28
            log.error("Error while creating the basic payment");
26
            log.error("Error while creating the basic payment");
29
            return PAYMENT_NOT_CREATED;
27
            return PAYMENT_NOT_CREATED;
30
        }else{
28
        }else{
31
            return initializePayment(cps.getPaymentId(), paymentOption);
29
            return initializePayment(cps.getPaymentId(), paymentOption);
32
        }
30
        }