Subversion Repositories SmartDukaan

Rev

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

Rev 1946 Rev 2976
Line 4... Line 4...
4
import java.util.Map;
4
import java.util.Map;
5
 
5
 
6
import org.apache.ibatis.annotations.Param;
6
import org.apache.ibatis.annotations.Param;
7
 
7
 
8
import in.shop2020.payment.domain.Payment;
8
import in.shop2020.payment.domain.Payment;
9
//import in.shop2020.payments.Payment;
-
 
10
import in.shop2020.payment.domain.PaymentAttribute;
9
import in.shop2020.payment.domain.PaymentAttribute;
11
 
10
 
12
public interface PaymentMapper {
11
public interface PaymentMapper {
13
	int insertPayment(Payment payment);
12
	int insertPayment(Payment payment);
14
	
13
	
Line 23... Line 22...
23
			@Param("fromTime") String fromTime, @Param("toTime") String toTime,
22
			@Param("fromTime") String fromTime, @Param("toTime") String toTime,
24
			@Param("status") int status, @Param("gatewayId") long gatewayId);
23
			@Param("status") int status, @Param("gatewayId") long gatewayId);
25
	
24
	
26
	List<Payment> getPayments(@Param("fromTime") String fromTime, @Param("toTime") String toTime,
25
	List<Payment> getPayments(@Param("fromTime") String fromTime, @Param("toTime") String toTime,
27
			@Param("status") int status, @Param("gatewayId") long gatewayId);
26
			@Param("status") int status, @Param("gatewayId") long gatewayId);
28
	
27
 
-
 
28
    /**
-
 
29
     * Currently, it returns the last payment for a transaction assuming that
-
 
30
     * it is the only one which can be successful.
-
 
31
     * 
-
 
32
     * @param merchantTxnId
-
 
33
     *            The merchant transaction for which payments are required.
-
 
34
     * @return A list of payments
-
 
35
     */
29
	List<Payment> getPaymentForTxn(long merchantTxnId);
36
	List<Payment> getPaymentForTxn(long merchantTxnId);
30
	
37
 
-
 
38
    /**
-
 
39
     * Finds the maximum and minimum amount among the successful payments.
-
 
40
     * 
-
 
41
     * @return A map containing the maximum and minimum amount keyed using MAX
-
 
42
     *         and MIN as keys respectively.
-
 
43
     */
31
	Map<String, Float> getMinMaxPaymentAmount();
44
	Map<String, Float> getMinMaxPaymentAmount();
32
	
45
 
-
 
46
    /**
-
 
47
     * Get the list of attributes of a payment.
-
 
48
     * 
-
 
49
     * @param id
-
 
50
     *            Id of the payment whose attributes are required.
-
 
51
     * @return A list of all the attributes of a payment.
-
 
52
     */
33
	List<PaymentAttribute> getAttributesForPayment(long id);
53
	List<PaymentAttribute> getAttributesForPayment(long id);
34
	
54
 
-
 
55
    /**
-
 
56
     * Inserts an attribute for the given payments. If the attribute is already
-
 
57
     * present, just updates its value.
-
 
58
     * 
-
 
59
     * @param paymentId
-
 
60
     *            Id of the payment for which the attribute has to be added or
-
 
61
     *            updated.
-
 
62
     * @param name
-
 
63
     *            Name of the attribute
-
 
64
     * @param value
-
 
65
     *            Value of the attribute
-
 
66
     */
35
	void insertPaymentAttribute(@Param("paymentId") long paymentId,
67
	void insertPaymentAttribute(@Param("paymentId") long paymentId,
36
			@Param("name") String name, @Param("value") String value);
68
			@Param("name") String name, @Param("value") String value);
37
}
69
}