예제 #1
0
파일: dummy.py 프로젝트: Dragon-Born/payit
    def verify_transaction(self, transaction: Transaction, data):
        if data['id'] == 'false':
            raise TransactionError('Invalid transaction ID')

        transaction.pan = data.get('cardNumber')
        print('Transaction verified: \n%s' % transaction.__repr__())
        return transaction
예제 #2
0
파일: dummy.py 프로젝트: Dragon-Born/payit
 def validate_transaction(self, data: dict) -> Transaction:
     transaction = Transaction()
     transaction.id = data['id']
     transaction.meta = data
     transaction.validate_status = data.get('validateStatus', True)
     print('Transaction validated: \n%s' % transaction.__repr__())
     return transaction
예제 #3
0
파일: dummy.py 프로젝트: meyt/payit
    def verify_transaction(self, transaction: Transaction, data):
        if data["id"] == "false":
            raise TransactionError("Invalid transaction ID")

        transaction.pan = data.get("cardNumber")
        print("Transaction verified: \n%s" % transaction.__repr__())
        return transaction
예제 #4
0
파일: dummy.py 프로젝트: meyt/payit
 def validate_transaction(self, data: dict) -> Transaction:
     transaction = Transaction()
     transaction.id = data["id"]
     transaction.meta = data
     transaction.validate_status = data.get("validateStatus", True)
     print("Transaction validated: \n%s" % transaction.__repr__())
     return transaction
예제 #5
0
파일: dummy.py 프로젝트: Dragon-Born/payit
    def request_transaction(self, transaction: Transaction) -> Transaction:
        if int(transaction.amount) > self.maximum_amount:
            raise TransactionError('Amount is larger than %s' %
                                   self.maximum_amount)

        transaction.id = int(time.time())
        print('New transaction requested: \n%s' % transaction.__repr__())
        return transaction