Subversion Repositories SmartDukaan

Rev

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

Rev 1946 Rev 2391
Line 19... Line 19...
19
		Payment payment = new Payment();
19
		Payment payment = new Payment();
20
		payment.setUserId(3);
20
		payment.setUserId(3);
21
		payment.setAmount(122.05);
21
		payment.setAmount(122.05);
22
		payment.setGatewayId(1);
22
		payment.setGatewayId(1);
23
		payment.setMerchantTxnId(899999);
23
		payment.setMerchantTxnId(899999);
24
		
-
 
25
		long id=psh.insertPayment(payment);
24
		long id=psh.insertPayment(payment);
26
		
25
		
27
		System.out.println("Inserted Id: " + id);
26
		System.out.println("Inserted Id: " + id);
28
		
27
		
29
		Map<String, String> attributes = new HashMap<String, String>();
28
		Map<String, String> attributes = new HashMap<String, String>();
30
		attributes.put("udf1", "VAL1");
29
		attributes.put("udf1", "VAL1");
31
		attributes.put("ATR2", "VAL2");
30
		attributes.put("ATR2", "VAL2");
-
 
31
		payment.setGatewayPaymentId("XXXXYYYYYTTTTSSSS");
32
		psh.updatePayment(payment, attributes);
32
		psh.updatePayment(payment, attributes);
33
		
33
		
34
		System.out.println(psh.getPayment(id));
-
 
35
		
-
 
36
		Map<String, Float> minMaxAmounts = psh.getMinMaxPaymentAmount();
-
 
37
		for(String key: minMaxAmounts.keySet()){
-
 
38
			System.out.println(key + ":" + Double.parseDouble(Float.toString(minMaxAmounts.get(key))));
34
		payment.setGatewayPaymentId(null); //This test is to check that the if clause is working in the payment mapper
39
		}
-
 
40
		
-
 
41
		System.out.println(psh.getPayment(422));
-
 
42
		
-
 
43
		System.out.println(psh.getPaymentForTxn(899999));
35
		psh.updatePayment(payment, attributes);
44
		
36
		
-
 
37
		payment.setGatewayPaymentId("YYYZZZZ");
-
 
38
		psh.updatePayment(payment, attributes);
-
 
39
//		System.out.println(psh.getPayment(id));
-
 
40
//		
-
 
41
//		Map<String, Float> minMaxAmounts = psh.getMinMaxPaymentAmount();
-
 
42
//		for(String key: minMaxAmounts.keySet()){
-
 
43
//			System.out.println(key + ":" + Double.parseDouble(Float.toString(minMaxAmounts.get(key))));
-
 
44
//		}
-
 
45
//		
-
 
46
//		System.out.println(psh.getPayment(422));
-
 
47
//		
-
 
48
//		System.out.println(psh.getPaymentForTxn(899999));
-
 
49
//		
45
		for(Payment pmnt: psh.getPaymentsForUser(3, 0L, new Date().getTime() + 86400000, 0, 1)){
50
//		for(Payment pmnt: psh.getPaymentsForUser(3, 0L, new Date().getTime() + 86400000, 0, 1)){
46
			System.out.println(pmnt);
51
//			System.out.println(pmnt);
47
		}
52
//		}
48
	}
53
	}
49
}
54
}