Subversion Repositories SmartDukaan

Rev

Rev 6050 | 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.PaymentStatus;
4
import in.shop2020.payments.PaymentStatus;
6
import in.shop2020.thrift.clients.PaymentClient;
5
import in.shop2020.thrift.clients.PaymentClient;
7
 
6
 
8
import java.util.ArrayList;
7
import java.util.ArrayList;
Line 12... Line 11...
12
 
11
 
13
public class CodPaymentService implements IPaymentService {
12
public class CodPaymentService implements IPaymentService {
14
 
13
 
15
    private static Logger log = Logger.getLogger(Class.class);
14
    private static Logger log = Logger.getLogger(Class.class);
16
    
15
    
17
    private static int gatewayId=4;
-
 
18
    private long paymentId;
16
    private long paymentId;
19
    
17
    
20
    @Override
18
    @Override
21
    public long createPayment(long currentCartId, long userId, long txnId, String paymentOption, long sourceId) {
19
    public long createPayment(long userId, long txnId, String paymentOption, int gatewayId) {
22
        log.info("Creating payment for the txn#: " + txnId + " for the user: " + userId + " for processing through COD");
20
        log.info("Creating payment for the txn#: " + txnId + " for the user: " + userId + " for processing through COD");
23
        CommonPaymentService cps = new CommonPaymentService();
21
        CommonPaymentService cps = new CommonPaymentService();
24
        if(!cps.createPayment(currentCartId, userId, txnId, gatewayId, sourceId)){
22
        if(!cps.createPayment(userId, txnId, gatewayId)){
25
            log.error("Error while creating the basic payment");
23
            log.error("Error while creating the basic payment");
26
            return PAYMENT_NOT_CREATED;
24
            return PAYMENT_NOT_CREATED;
27
        }
25
        }
28
        paymentId = cps.getPaymentId();
26
        paymentId = cps.getPaymentId();
29
        
27