Subversion Repositories SmartDukaan

Rev

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

Rev 1627 Rev 1731
Line 6... Line 6...
6
from shop2020.payments.impl import DataService
6
from shop2020.payments.impl import DataService
7
from shop2020.utils.Utils import log_entry
7
from shop2020.utils.Utils import log_entry
8
from shop2020.payments.impl.DataAccessor import create_payment,\
8
from shop2020.payments.impl.DataAccessor import create_payment,\
9
    get_payments_for_user, get_payments, get_payment, get_payment_for_txn,\
9
    get_payments_for_user, get_payments, get_payment, get_payment_for_txn,\
10
    get_payment_gateway, update_payment_details, close_session,\
10
    get_payment_gateway, update_payment_details, close_session,\
11
    get_max_payment_amount, get_min_payment_amount
11
    get_successful_payments_amount_range
12
from shop2020.payments.impl.converters import to_t_payment, to_t_payment_gateway
12
from shop2020.payments.impl.converters import to_t_payment, to_t_payment_gateway
13
 
13
 
14
class PaymentsHandler:
14
class PaymentsHandler:
15
    
15
    
16
    def __init__(self, dbname='payment'):
16
    def __init__(self, dbname='payment'):
Line 131... Line 131...
131
        try:
131
        try:
132
            return update_payment_details(id, gatewayPaymentId, sessionId, gatewayTxnStatus, description, gatewayTxnId, authCode, referenceCode, errorCode, status, gatewayTxnDate, attributes)
132
            return update_payment_details(id, gatewayPaymentId, sessionId, gatewayTxnStatus, description, gatewayTxnId, authCode, referenceCode, errorCode, status, gatewayTxnDate, attributes)
133
        finally:
133
        finally:
134
            close_session()
134
            close_session()
135
            
135
            
136
    def getMaxPaymentAmount(self, ):
-
 
137
        """
-
 
138
        Returns the maximum amount of a single payment.
-
 
139
        """
-
 
140
        return get_max_payment_amount()
-
 
141
 
136
 
142
    def getMinPaymentAmount(self, ):
137
    def getSuccessfulPaymentsAmountRange(self, ):
143
        """
138
        """
144
        Returns the minimum amount of a single payment.
139
        Returns the minimum and maximum amounts among successful payments.
-
 
140
        List contains two double values, first minimum and second maximum amount.
145
        """
141
        """
146
        return get_min_payment_amount()
142
        return get_successful_payments_amount_range()
147
            
143
            
148
    def closeSession(self, ):
144
    def closeSession(self, ):
149
        close_session()
145
        close_session()
150
146