Subversion Repositories SmartDukaan

Rev

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

Rev 21734 Rev 21805
Line 7... Line 7...
7
 
7
 
8
import org.slf4j.Logger;
8
import org.slf4j.Logger;
9
import org.slf4j.LoggerFactory;
9
import org.slf4j.LoggerFactory;
10
 
10
 
11
import in.shop2020.model.v1.order.EmiScheme;
11
import in.shop2020.model.v1.order.EmiScheme;
-
 
12
import in.shop2020.payments.Attribute;
-
 
13
import in.shop2020.payments.Payment;
12
 
14
 
13
public class PaymentUtils {
15
public class PaymentUtils {
14
	
16
	
15
	private static List<EmiScheme> emiSchemes;
17
	private static List<EmiScheme> emiSchemes;
16
	private static final Logger logger=LoggerFactory.getLogger(PaymentUtils.class);
18
	private static final Logger logger=LoggerFactory.getLogger(PaymentUtils.class);
17
	
19
	
18
	public static enum PAYMENT_TYPE{
20
	public static enum PAYMENT_TYPE{
-
 
21
		NB("Net Banking"),
19
		NB,CC,DC,WAL,COD,CAS,EMI
22
		CC("Cash on Delivery"),
-
 
23
		DC("Debit Card"),
-
 
24
		WAL("Wallet"),
-
 
25
		COD("Cash on Delivery"),
-
 
26
		CAS("Cash Card"),
-
 
27
		EMI("EMI");
-
 
28
		
-
 
29
		PAYMENT_TYPE(String value){
-
 
30
			this.value = value;
-
 
31
		}
-
 
32
		
-
 
33
		private final String value;
-
 
34
	    public String value() { return value; }
20
	} 
35
	}
-
 
36
	
-
 
37
	public static PAYMENT_TYPE getPaymentType(Payment payment){
-
 
38
		List<Attribute> attributes = payment.getAttributes();
-
 
39
		for(Attribute attribute : attributes) {
-
 
40
			if(attribute.getName().equals(IPaymentService.PAYMENT_TYPE)) {
-
 
41
				return PAYMENT_TYPE.valueOf(attribute.getValue());
-
 
42
			}
-
 
43
		}
-
 
44
		return null;
-
 
45
	}
21
	
46
	
22
	
47
	
23
    @SuppressWarnings("serial")
48
    @SuppressWarnings("serial")
24
	public static final Map<String, String> PAYU_NET_BANKING_CODES_MAP = Collections.unmodifiableMap(
49
	public static final Map<String, String> PAYU_NET_BANKING_CODES_MAP = Collections.unmodifiableMap(
25
    		new HashMap<String, String>(){
50
    		new HashMap<String, String>(){