示例#1
0
 def validate_transaction(self, data: dict) -> Transaction:
     transaction = Transaction()
     transaction.id = data['transId']
     transaction.meta = data
     if int(data['status']) == 1:
         transaction.validate_status = True
     return transaction
示例#2
0
文件: irankish.py 项目: iRhonin/payit
 def validate_transaction(self, data: dict) -> Transaction:
     transaction = Transaction()
     transaction.id = data['token']
     transaction.meta = data
     if 'resultCode' in data and int(data['resultCode']) == 100:
         transaction.validate_status = True
     return transaction
示例#3
0
文件: parsian.py 项目: meyt/payit
 def validate_transaction(self, data: dict) -> Transaction:
     transaction = Transaction()
     transaction.id = data["Token"]
     transaction.meta = data
     if "status" in data and int(data["status"]) == 0:
         transaction.validate_status = True
     return transaction
示例#4
0
 def validate_transaction(self, data: dict) -> Transaction:
     transaction = Transaction()
     transaction.id = data["bill_id"]
     transaction.meta = data
     if data["state"] in ("pay", "request"):
         transaction.validate_status = True
     return transaction
示例#5
0
 def validate_transaction(self, data: dict) -> Transaction:
     transaction = Transaction()
     transaction.id = data['bill_id']
     transaction.meta = data
     if data['state'] in ('pay', 'request'):
         transaction.validate_status = True
     return transaction
示例#6
0
 def validate_transaction(self, data: dict) -> Transaction:
     transaction = Transaction()
     transaction.id = data['Token']
     transaction.meta = data
     if 'status' in data and int(data['status']) == 0:
         transaction.validate_status = True
     return transaction
示例#7
0
 def validate_transaction(self, data: dict) -> Transaction:
     transaction = Transaction()
     transaction.id = data["RefId"]
     transaction.meta = data
     if int(data["ResCode"]) == 0:
         transaction.validate_status = True
     return transaction
示例#8
0
 def validate_transaction(self, data: dict) -> Transaction:
     transaction = Transaction()
     transaction.id = data['Authority']
     transaction.meta = data
     if data['Status'] == 'OK':
         transaction.validate_status = True
     return transaction
示例#9
0
文件: zarinpal.py 项目: meyt/payit
 def validate_transaction(self, data: dict) -> Transaction:
     transaction = Transaction()
     transaction.id = data["Authority"]
     transaction.meta = data
     if data["Status"] == "OK":
         transaction.validate_status = True
     return transaction
示例#10
0
 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
示例#11
0
 def validate_transaction(self, data: dict) -> Transaction:
     transaction = Transaction()
     transaction.id = data["token"]
     transaction.meta = data
     if "resultCode" in data and int(data["resultCode"]) == 100:
         transaction.validate_status = True
     return transaction
示例#12
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
示例#13
0
 def validate_transaction(self, data: dict) -> Transaction:
     parsed_data = self._parse_callback_data(data)
     transaction = Transaction()
     transaction.id = parsed_data['ref_id']
     transaction.meta = parsed_data
     if int(parsed_data['res_code']) == 0:
         transaction.validate_status = True
     return transaction
示例#14
0
 def validate_transaction(self, data: dict) -> Transaction:
     transaction = Transaction()
     transaction.id = data.get("transid")
     transaction.amount = int(data.get("amount", 0))
     transaction.pan = data.get("cardnumber")
     transaction.meta = data
     transaction.validate_status = transaction.id is not None
     return transaction
示例#15
0
文件: payir.py 项目: meyt/payit
 def validate_transaction(self, data: dict) -> Transaction:
     transaction = Transaction()
     transaction.id = data["token"]
     transaction.meta = data
     transaction.validate_status = int(data["status"]) == 1
     return transaction