|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +# |
| 3 | +# This class was auto-generated from the API references found at |
| 4 | +# https://apireference.connect.worldline-solutions.com/ |
| 5 | +# |
| 6 | +from typing import List, Optional |
| 7 | + |
| 8 | +from worldline.connect.sdk.domain.data_object import DataObject |
| 9 | + |
| 10 | + |
| 11 | +class CybersourceDecisionManager(DataObject): |
| 12 | + """ |
| 13 | + | This object contains the results of the Cybersource Decision Manager assessment. Cybersource is a fraud detection tool leveraging data networks, configurable rules, intelligence, and device fingerprinting to identify risky transactions. |
| 14 | + """ |
| 15 | + |
| 16 | + __clause_name: Optional[str] = None |
| 17 | + __fraud_score: Optional[int] = None |
| 18 | + __policy_applied: Optional[str] = None |
| 19 | + __reason_codes: Optional[List[str]] = None |
| 20 | + |
| 21 | + @property |
| 22 | + def clause_name(self) -> Optional[str]: |
| 23 | + """ |
| 24 | + | Name of the clause within the applied policy that was triggered during the evaluation of this transaction. |
| 25 | +
|
| 26 | + Type: str |
| 27 | + """ |
| 28 | + return self.__clause_name |
| 29 | + |
| 30 | + @clause_name.setter |
| 31 | + def clause_name(self, value: Optional[str]) -> None: |
| 32 | + self.__clause_name = value |
| 33 | + |
| 34 | + @property |
| 35 | + def fraud_score(self) -> Optional[int]: |
| 36 | + """ |
| 37 | + | Result of the Cybersource Decision Manager check. This contains the normalized fraud score from a scale of 0 to 100. A higher score indicates an increased risk of fraud. |
| 38 | +
|
| 39 | + Type: int |
| 40 | + """ |
| 41 | + return self.__fraud_score |
| 42 | + |
| 43 | + @fraud_score.setter |
| 44 | + def fraud_score(self, value: Optional[int]) -> None: |
| 45 | + self.__fraud_score = value |
| 46 | + |
| 47 | + @property |
| 48 | + def policy_applied(self) -> Optional[str]: |
| 49 | + """ |
| 50 | + | Name of the policy that was applied during the evaluation of this transaction. |
| 51 | +
|
| 52 | + Type: str |
| 53 | + """ |
| 54 | + return self.__policy_applied |
| 55 | + |
| 56 | + @policy_applied.setter |
| 57 | + def policy_applied(self, value: Optional[str]) -> None: |
| 58 | + self.__policy_applied = value |
| 59 | + |
| 60 | + @property |
| 61 | + def reason_codes(self) -> Optional[List[str]]: |
| 62 | + """ |
| 63 | + | List of one or more reason codes. |
| 64 | +
|
| 65 | + Type: list[str] |
| 66 | + """ |
| 67 | + return self.__reason_codes |
| 68 | + |
| 69 | + @reason_codes.setter |
| 70 | + def reason_codes(self, value: Optional[List[str]]) -> None: |
| 71 | + self.__reason_codes = value |
| 72 | + |
| 73 | + def to_dictionary(self) -> dict: |
| 74 | + dictionary = super(CybersourceDecisionManager, self).to_dictionary() |
| 75 | + if self.clause_name is not None: |
| 76 | + dictionary['clauseName'] = self.clause_name |
| 77 | + if self.fraud_score is not None: |
| 78 | + dictionary['fraudScore'] = self.fraud_score |
| 79 | + if self.policy_applied is not None: |
| 80 | + dictionary['policyApplied'] = self.policy_applied |
| 81 | + if self.reason_codes is not None: |
| 82 | + dictionary['reasonCodes'] = [] |
| 83 | + for element in self.reason_codes: |
| 84 | + if element is not None: |
| 85 | + dictionary['reasonCodes'].append(element) |
| 86 | + return dictionary |
| 87 | + |
| 88 | + def from_dictionary(self, dictionary: dict) -> 'CybersourceDecisionManager': |
| 89 | + super(CybersourceDecisionManager, self).from_dictionary(dictionary) |
| 90 | + if 'clauseName' in dictionary: |
| 91 | + self.clause_name = dictionary['clauseName'] |
| 92 | + if 'fraudScore' in dictionary: |
| 93 | + self.fraud_score = dictionary['fraudScore'] |
| 94 | + if 'policyApplied' in dictionary: |
| 95 | + self.policy_applied = dictionary['policyApplied'] |
| 96 | + if 'reasonCodes' in dictionary: |
| 97 | + if not isinstance(dictionary['reasonCodes'], list): |
| 98 | + raise TypeError('value \'{}\' is not a list'.format(dictionary['reasonCodes'])) |
| 99 | + self.reason_codes = [] |
| 100 | + for element in dictionary['reasonCodes']: |
| 101 | + self.reason_codes.append(element) |
| 102 | + return self |
0 commit comments