def __init__(self, three_ds_method_xml): self.three_ds_mtd_url = get_tag_value( three_ds_method_xml, TagConstants.getThreeDSMtdUrlTag()) self.three_ds_method_data = get_tag_value( three_ds_method_xml, TagConstants.getThreeDSMtdDataTag()) self.three_ds_tran_id = get_tag_value( three_ds_method_xml, TagConstants.getThreeDSTransactionIDTag())
def __init__(self, three_ds_challenge): self.acs_url = get_tag_value(three_ds_challenge, TagConstants.getACSUrlTag()) self.creq = get_tag_value(three_ds_challenge, TagConstants.getCreqTag()) self.three_ds_tran_id = get_tag_value( three_ds_challenge, TagConstants.getThreeDSTransactionIDTag())
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 __init__(self, pan_alias_xml): self.pan_alias = get_tag_value(pan_alias_xml, TagConstants.getCreatePanAliasTag()) self.pan_alias_rev = get_tag_value(pan_alias_xml, TagConstants.getPanAliasRevTag()) self.pan_alias_exp_date = get_tag_value( pan_alias_xml, TagConstants.getPanExpiryDateTag()) self.pan_alias_tail = get_tag_value(pan_alias_xml, TagConstants.getPanTailTag())
def map_operation_response(response_operation): response_xml = Utils.stringToXML(response_operation) response_operation = OperationResponse() response_operation.timestamp = get_tag_value( response_xml, TagConstants.getTimestampTag()) response_operation.result = get_tag_value(response_xml, TagConstants.getResultTag()) data = response_xml.find(TagConstants.getDataTag()) if (data is not None) and (data.find(TagConstants.getOperationTag()) is not None): operation_xml = data.find(TagConstants.getOperationTag()) operation = Operation(operation_xml) response_operation.operation = operation return response_operation
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)
def __init__(self, card_holder_info_xml): self.card_holder_name = get_tag_value( card_holder_info_xml, TagConstants.getCardHolderNameTag()) self.card_holder_email = get_tag_value( card_holder_info_xml, TagConstants.getCardHolderEmailTag()) self.billing_address_postal_code = get_tag_value( card_holder_info_xml, TagConstants.getBillingAddressPostalcodeTag()) self.billing_address_city = get_tag_value( card_holder_info_xml, TagConstants.getBillingAddressCityTag()) self.billing_address_line_1 = get_tag_value( card_holder_info_xml, TagConstants.getBillingAddressLine1Tag()) self.billing_address_line_2 = get_tag_value( card_holder_info_xml, TagConstants.getBillingAddressLine2Tag()) self.billing_address_line_3 = get_tag_value( card_holder_info_xml, TagConstants.getBillingAddressLine3Tag()) self.billing_address_state = get_tag_value( card_holder_info_xml, TagConstants.getBillingAddressStateTag()) self.billing_address_country = get_tag_value( card_holder_info_xml, TagConstants.getBillingAddressCountryTag())
def __init__(self, authorization_xml): self.payment_type = get_tag_value(authorization_xml, TagConstants.getPaymentTypeTag()) self.authorization_type = get_tag_value( authorization_xml, TagConstants.getAuthorizationTypeTag()) self.transaction_ID = get_tag_value(authorization_xml, TagConstants.getTransactionIDTag()) self.network = get_tag_value(authorization_xml, TagConstants.getNetworkTag()) self.order_ID = get_tag_value(authorization_xml, TagConstants.getOrderIDTag()) self.transaction_amount = get_tag_value( authorization_xml, TagConstants.getTransactionAmountTag()) self.authorized_amount = get_tag_value( authorization_xml, TagConstants.getAuthorizedAmountTag()) self.refunded_amount = get_tag_value( authorization_xml, TagConstants.getRefundedAmountTag()) self.transaction_result = get_tag_value( authorization_xml, TagConstants.getTransactionResultTag()) self.timestamp = get_tag_value(authorization_xml, TagConstants.getTimestampTag()) self.authorization_number = get_tag_value( authorization_xml, TagConstants.getAuthorizationNumberTag()) self.acquire_BIN = get_tag_value(authorization_xml, TagConstants.getAcquirerBinTag()) self.merchant_ID = get_tag_value(authorization_xml, TagConstants.getMerchantIdTag()) self.transaction_status = get_tag_value( authorization_xml, TagConstants.getTransactionStatusTag()) self.response_code_ISO = get_tag_value( authorization_xml, TagConstants.getResponseCodeIsoTag()) self.pan_tail = get_tag_value(authorization_xml, TagConstants.getPanTailTag()) self.pan_expiry_date = get_tag_value( authorization_xml, TagConstants.getPanExpiryDateTag()) self.payment_type_PP = get_tag_value( authorization_xml, TagConstants.getPaymentTypePPTag()) self.rRN = get_tag_value(authorization_xml, TagConstants.getRRNTag()) self.card_type = get_tag_value(authorization_xml, TagConstants.getCardType()) self.card_holder_info = get_tag_value( authorization_xml, TagConstants.getCardHolderInfoTag()) self.installments_number = get_tag_value( authorization_xml, TagConstants.getInstallmentsNumberTag()) self.tickler_merchant_code = get_tag_value( authorization_xml, TagConstants.getTicklerMerchantCodeTag()) self.tickler_plan_code = get_tag_value( authorization_xml, TagConstants.getTicklerPlanCodeTag()) self.tickler_subscription_code = get_tag_value( authorization_xml, TagConstants.getTicklerSubscriptionCodeTag())