def map_three_ds_authorize1(response): response_xml = Utils.stringToXML(response) response = ThreeDSAuthorize1Response() response.timestamp = get_tag_value(response_xml, TagConstants.getTimestampTag()) response.result = get_tag_value(response_xml, TagConstants.getResultTag()) data = response_xml.find(TagConstants.getDataTag()) if (data is not None) and (data.find(TagConstants.getAuthorizationTag()) is not None): operation_xml = data.find(TagConstants.getAuthorizationTag()) operation = Authorization(operation_xml) response.operation = operation if (data is not None) and (data.find(TagConstants.getPanAliasDataTag()) is not None): pan_alias_xml = PanAliasData( data.find(TagConstants.getPanAliasDataTag())) response.pan_alias_data = pan_alias_xml if (data is not None) and (data.find(TagConstants.getThreeDSChallengeTag()) is not None): three_ds_challenge_xml = ThreeDSChallenge( data.find(TagConstants.getThreeDSChallengeTag())) response.three_DS_Challenge = three_ds_challenge_xml return response
def map_order_status_response(response): response_xml = Utils.stringToXML(response) response_status = OrderStatusResponse() response_status.timestamp = get_tag_value(response_xml, TagConstants.getTimestampTag()) response_status.result = get_tag_value(response_xml, TagConstants.getResultTag()) data = response_xml.find(TagConstants.getDataTag()) if (data is not None) and (data.find(TagConstants.getAuthorizationTag()) is not None): for auth_xml in data.findall(TagConstants.getAuthorizationTag()): auth_dto = Authorization(auth_xml) response_status.auth_list.append(auth_dto) if (data is not None) and (data.find(TagConstants.getPanAliasDataTag()) is not None): pan_alias_xml = PanAliasData( data.find(TagConstants.getPanAliasDataTag())) response_status.pan_alias_data = pan_alias_xml if (data is not None) and (data.find(TagConstants.getCardHolderDataTag()) is not None): card_holder_data_xml = CardHolderData( data.find(TagConstants.getCardHolderDataTag())) response_status.card_holder_info = card_holder_data_xml return response_status
def map_three_ds_authorize0(response_threeDS): response_xml = Utils.stringToXML(response_threeDS) response_threeDS = ThreeDSAuthorize0Response() response_threeDS.timestamp = get_tag_value(response_xml, TagConstants.getTimestampTag()) response_threeDS.result = get_tag_value(response_xml, TagConstants.getResultTag()) data = response_xml.find(TagConstants.getDataTag()) if (data is not None) and (data.find(TagConstants.getAuthorizationTag()) is not None): authorization_xml = data.find(TagConstants.getAuthorizationTag()) authorization = Authorization(authorization_xml) response_threeDS.authorization = authorization if (data is not None) and (data.find(TagConstants.getPanAliasDataTag()) is not None): pan_alias_xml = PanAliasData( data.find(TagConstants.getPanAliasDataTag())) response_threeDS.pan_alias_data = pan_alias_xml if (data is not None) and (data.find(TagConstants.getThreeDSMtdTag()) is not None): three_ds_mtd_xml = ThreeDSMethod( data.find(TagConstants.getThreeDSMtdTag())) response_threeDS.three_DS_Method = three_ds_mtd_xml if (data is not None) and (data.find(TagConstants.getThreeDSChallengeTag()) is not None): three_ds_challenge_xml = ThreeDSChallenge( data.find(TagConstants.getThreeDSChallengeTag())) response_threeDS.three_DS_Challenge = three_ds_challenge_xml return response_threeDS
def map_authorize_response(response): response_xml = Utils.stringToXML(response) response_authorize = AuthorizeResponse() response_authorize.timestamp = get_tag_value( response_xml, TagConstants.getTimestampTag()) response_authorize.result = get_tag_value(response_xml, TagConstants.getResultTag()) data = response_xml.find(TagConstants.getDataTag()) if (data is not None) and (data.find(TagConstants.getAuthorizationTag()) is not None): auth_dto = Authorization(data.find(TagConstants.getAuthorizationTag())) response_authorize.authorization = auth_dto if (data is not None) and (data.find(TagConstants.getPanAliasDataTag()) is not None): pan_alias_xml = PanAliasData( data.find(TagConstants.getPanAliasDataTag())) response_authorize.pan_alias_data = pan_alias_xml return response_authorize
def map_three_ds_authorize2(response_ThreeDS): response_xml = Utils.stringToXML(response_ThreeDS) response_ThreeDS = ThreeDSAuthorize2Response() response_ThreeDS.timestamp = get_tag_value(response_xml, TagConstants.getTimestampTag()) response_ThreeDS.result = get_tag_value(response_xml, TagConstants.getResultTag()) data = response_xml.find(TagConstants.getDataTag()) if (data is not None) and (data.find(TagConstants.getAuthorizationTag()) is not None): operation_xml = data.find(TagConstants.getAuthorizationTag()) operation = Authorization(operation_xml) response_ThreeDS.operation = operation if (data is not None) and (data.find(TagConstants.getPanAliasDataTag()) is not None): pan_alias_xml = PanAliasData( data.find(TagConstants.getPanAliasDataTag())) response_ThreeDS.pan_alias_data = pan_alias_xml return response_ThreeDS
def __init__(self, operation_xml): self.transaction_id = get_tag_value(operation_xml, TagConstants.getTransactionIDTag()) self.timestamp_req = get_tag_value(operation_xml, TagConstants.getTimestampReqTag()) self.timestamp_elab = get_tag_value(operation_xml, TagConstants.getTimestampElabTag()) self.src_type = get_tag_value(operation_xml, TagConstants.getSrcTypeTag()) self.amount = get_tag_value(operation_xml, TagConstants.getAmountTag()) self.result = get_tag_value(operation_xml, TagConstants.getResultTag()) self.status = get_tag_value(operation_xml, TagConstants.getStatusTag()) self.op_descr = get_tag_value(operation_xml, TagConstants.getOpDescrTag()) self.operation = get_tag_value(operation_xml, TagConstants.getOperationTag()) auth = operation_xml.find(TagConstants.getAuthorizationTag()) if auth is not None: self.authorization = Authorization(auth)