Subversion Repositories SmartDukaan

Rev

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

Rev 23568 Rev 36625
Line 1... Line 1...
1
package com.spice.profitmandi.web.payment;
1
package com.spice.profitmandi.web.payment;
2
 
2
 
3
import java.util.Collections;
3
import java.util.Collections;
4
import java.util.HashMap;
4
import java.util.HashMap;
5
import java.util.List;
-
 
6
import java.util.Map;
5
import java.util.Map;
7
 
6
 
8
import org.apache.logging.log4j.Logger;
7
import org.apache.logging.log4j.Logger;
9
import org.apache.logging.log4j.LogManager;
8
import org.apache.logging.log4j.LogManager;
10
 
9
 
11
import in.shop2020.model.v1.order.EmiScheme;
-
 
12
import in.shop2020.payments.Attribute;
-
 
13
import in.shop2020.payments.Payment;
-
 
14
 
-
 
15
public class PaymentUtils {
10
public class PaymentUtils {
16
	
11
 
17
	private static List<EmiScheme> emiSchemes;
-
 
18
	private static final Logger logger=LogManager.getLogger(PaymentUtils.class);
12
	private static final Logger logger=LogManager.getLogger(PaymentUtils.class);
19
	
13
	
20
	public static enum PAYMENT_TYPE{
14
	public static enum PAYMENT_TYPE{
21
		NB("Net Banking"),
15
		NB("Net Banking"),
22
		CC("Credit Card"),
16
		CC("Credit Card"),
Line 32... Line 26...
32
		
26
		
33
		private final String value;
27
		private final String value;
34
	    public String value() { return value; }
28
	    public String value() { return value; }
35
	}
29
	}
36
	
30
	
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
	}
-
 
46
	
-
 
47
	
-
 
48
    @SuppressWarnings("serial")
31
    @SuppressWarnings("serial")
49
	public static final Map<String, String> PAYU_NET_BANKING_CODES_MAP = Collections.unmodifiableMap(
32
	public static final Map<String, String> PAYU_NET_BANKING_CODES_MAP = Collections.unmodifiableMap(
50
    		new HashMap<String, String>(){
33
    		new HashMap<String, String>(){
51
	    		{
34
	    		{
52
	    			put("1004","AXIB");
35
	    			put("1004","AXIB");