Ejemplo n.º 1
0
 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())
Ejemplo n.º 2
0
def getAuthorizationStringForMac(authorizationXml):
    stringForMac = authorizationXml.find(
        TagConstants.getAuthorizationTypeTag()).text
    stringForMac = append_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getTransactionIDTag()).text)
    stringForMac = append_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getNetworkTag()).text)

    if authorizationXml.find(TagConstants.getOrderIDTag()) is not None:
        stringForMac = append_field_for_verification(
            stringForMac,
            authorizationXml.find(TagConstants.getOrderIDTag()).text)
    else:
        stringForMac = append_field_for_verification(
            stringForMac,
            authorizationXml.find(TagConstants.getOrderIdTag()).text)

    stringForMac = append_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getTransactionAmountTag()).text)
    stringForMac = append_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getAuthorizedAmountTag()).text)

    stringForMac = append_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getCurrencyTag()).text)
    stringForMac = append_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getAccountedAmountTag()).text)
    stringForMac = append_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getRefundedAmountTag()).text)
    stringForMac = append_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getTransactionResultTag()).text)
    stringForMac = append_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getTimestampTag()).text)
    stringForMac = append_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getAuthorizationNumberTag()).text)
    stringForMac = append_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getAcquirerBinTag()).text)
    stringForMac = append_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getMerchantIdTag()).text)
    stringForMac = append_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getTransactionStatusTag()).text)
    # OPTIONAL
    stringForMac = append_optional_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getResponseCodeIsoTag()))
    stringForMac = append_optional_field_for_verification(
        stringForMac, authorizationXml.find(TagConstants.getPanTailTag()))
    stringForMac = append_optional_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getPanExpiryDateTag()))
    stringForMac = append_optional_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getPaymentTypePPTag()))
    stringForMac = append_optional_field_for_verification(
        stringForMac, authorizationXml.find(TagConstants.getRRNTag()))

    stringForMac = append_optional_field_for_verification(
        stringForMac, authorizationXml.find(TagConstants.getCardType()))

    stringForMac = append_optional_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getCardHolderInfoTag()))
    stringForMac = append_optional_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getInstallmentsNumberTag()))
    stringForMac = append_optional_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getTicklerMerchantCodeTag()))
    stringForMac = append_optional_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getTicklerPlanCodeTag()))
    stringForMac = append_optional_field_for_verification(
        stringForMac,
        authorizationXml.find(TagConstants.getTicklerSubscriptionCodeTag()))

    return stringForMac