コード例 #1
0
def get_customer_profile(apiLoginId, apiTransactionKey, customerProfileId):
    merchantAuth = apicontractsv1.merchantAuthenticationType()
    merchantAuth.name = apiLoginId
    merchantAuth.transactionKey = apiTransactionKey

    getCustomerProfile = apicontractsv1.getCustomerProfileRequest()
    getCustomerProfile.merchantAuthentication = merchantAuth
    getCustomerProfile.customerProfileId = customerProfileId
    controller = getCustomerProfileController(getCustomerProfile)
    controller.execute()

    response = controller.getresponse()

    if (response.messages.resultCode == "Ok"):
        print("Successfully retrieved a customer with profile ")

    else:
        print("response code: %s" % response.messages.resultCode)
        print("Failed to get customer profile information with id %s" %
              getCustomerProfile.customerProfileId)

    return response


#if(os.path.basename(__file__) == os.path.basename(sys.argv[0])):
# get_customer_profile(constants.customerProfileId)
コード例 #2
0
    def get_customer_profile(self):
        """Used to retrive payment profiles"""

        if not self.instance.authorizenet_customer_profile_id:
            raise AuthorizeNetError('No profile id has been set')

        getCustomerProfile = apicontractsv1.getCustomerProfileRequest()
        getCustomerProfile.merchantAuthentication = self.merchantAuth
        getCustomerProfile.customerProfileId = str(
            self.instance.authorizenet_customer_profile_id)
        controller = getCustomerProfileController(getCustomerProfile)
        controller.setenvironment(self.post_url)
        controller.execute()

        self.customer_profile = controller.getresponse()
        response = self.customer_profile

        # raise 404 if you can't reach Authorize.net
        if not hasattr(self.customer_profile, 'messages'):
            raise Http404('Unable to retrieve payment data')

        print(response.messages.message.text)

        if (self.customer_profile.messages.resultCode == OK):
            if hasattr(self.customer_profile, 'profile'):
                if hasattr(self.customer_profile.profile, 'paymentProfiles'):
                    ppfs = self.customer_profile.profile.paymentProfiles
                    self.payment_profiles = [PaymentProfile(pp) for pp in ppfs]
                    self.payment_profiles_dict = {
                        pp.customer_payment_profile_id: pp
                        for pp in self.payment_profiles
                    }
                else:
                    self.payment_profiles = None
                    self.payment_profiles_dict = None
            else:
                print('\t\t\tno profile attribute')

            # This section needs to be abstracted into objects
            # similar to PaymentProfile
            if hasattr(response, 'profile'):
                if hasattr(response.profile, 'shipToList'):
                    for ship in response.profile.shipToList:
                        print("Shipping Details:")
                        print("First Name %s" % ship.firstName)
                        print("Last Name %s" % ship.lastName)
                        print("Address %s" % ship.address)
                        print("Customer Address ID %s" %
                              ship.customerAddressId)
            if hasattr(response, 'subscriptionIds'):
                if hasattr(response.subscriptionIds, 'subscriptionId'):
                    print("list of subscriptionid:")
                    for subscriptionid in (
                            response.subscriptionIds.subscriptionId):
                        print(subscriptionid)
        else:
            raise AuthorizeNetError(response.messages.message[0]['text'].text)
コード例 #3
0
    def testGetCustomerProfile(self):
        getCustomerProfile = apicontractsv1.getCustomerProfileRequest()
        getCustomerProfile.merchantAuthentication = self.merchantAuthentication

        CustomerProfileID = self.testCreateCustomerProfile()
        getCustomerProfile.customerProfileId = CustomerProfileID
        controller = getCustomerProfileController(getCustomerProfile)
        controller.execute()
        response = controller.getresponse()
        self.assertEquals('Ok', response.messages.resultCode)
        if hasattr(response, 'messages') == True:
            if hasattr(response.messages, 'resultCode') == True:
                self.assertEquals('Ok', response.messages.resultCode)
コード例 #4
0
 def testGetCustomerProfile(self):
     getCustomerProfile = apicontractsv1.getCustomerProfileRequest()
     getCustomerProfile.merchantAuthentication = self.merchantAuthentication
       
     CustomerProfileID = self.testCreateCustomerProfile()   
     getCustomerProfile.customerProfileId = CustomerProfileID 
     controller = getCustomerProfileController(getCustomerProfile)
     controller.execute()
     response = controller.getresponse()
     self.assertEquals('Ok', response.messages.resultCode)
     if hasattr(response, 'messages') == True:
         if hasattr(response.messages, 'resultCode') == True:
             self.assertEquals('Ok', response.messages.resultCode)
コード例 #5
0
def get_customer_profile(customerProfileId):
    merchantAuth = apicontractsv1.merchantAuthenticationType()
    merchantAuth.name = CONSTANTS.apiLoginId
    merchantAuth.transactionKey = CONSTANTS.transactionKey

    getCustomerProfile = apicontractsv1.getCustomerProfileRequest()
    getCustomerProfile.merchantAuthentication = merchantAuth
    getCustomerProfile.customerProfileId = customerProfileId
    controller = getCustomerProfileController(getCustomerProfile)
    controller.execute()

    response = controller.getresponse()

    if (response.messages.resultCode == "Ok"):
        print(
            f"Successfully retrieved a customer with profile id {getCustomerProfile.customerProfileId} and customer id {response.profile.merchantCustomerId}"
        )
        if hasattr(response, 'profile') == True:
            if hasattr(response.profile, 'paymentProfiles') == True:
                for paymentProfile in response.profile.paymentProfiles:
                    print("paymentProfile in get_customerprofile is:" %
                          paymentProfile)
                    print("Payment Profile ID %s" %
                          str(paymentProfile.customerPaymentProfileId))
                if hasattr(response.profile, 'shipToList') == True:
                    for ship in response.profile.shipToList:
                        print("Shipping Details:")
                        print("First Name %s" % ship.firstName)
                        print("Last Name %s" % ship.lastName)
                        print("Address %s" % ship.address)
                        print("Customer Address ID %s" %
                              ship.customerAddressId)
        if hasattr(response, 'subscriptionIds') == True:
            if hasattr(response.subscriptionIds, 'subscriptionId') == True:
                print("list of subscriptionid:")
                for subscriptionid in (
                        response.subscriptionIds.subscriptionId):
                    print(subscriptionid)
    else:
        print("response code: %s" % response.messages.resultCode)
        print("Failed to get customer profile information with id %s" %
              getCustomerProfile.customerProfileId)

    return response
コード例 #6
0
ファイル: __init__.py プロジェクト: vonq/saleor
def list_client_sources(config: GatewayConfig,
                        customer_id: str) -> List[CustomerSource]:
    merchant_auth = _get_merchant_auth(config.connection_params)

    get_customer_profile = apicontractsv1.getCustomerProfileRequest()
    get_customer_profile.merchantAuthentication = merchant_auth
    get_customer_profile.customerProfileId = customer_id
    get_customer_profile.unmaskExpirationDate = True
    controller = getCustomerProfileController(get_customer_profile)
    controller.execute()

    response = controller.getresponse()
    results = []

    if hasattr(response, "profile") and hasattr(response.profile,
                                                "paymentProfiles"):
        for payment_profile in response.profile.paymentProfiles:
            if hasattr(payment_profile, "payment") and hasattr(
                    payment_profile.payment, "creditCard"):
                name = None
                if hasattr(payment_profile, "billTo"):
                    first = payment_profile.billTo.firstName.pyval
                    last = payment_profile.billTo.lastName.pyval
                    if first:
                        name = first + " " + last
                    else:
                        name = last
                card = payment_profile.payment.creditCard
                expiration_year, expiration_month = _normalize_card_expiration(
                    card.expirationDate.pyval)
                results.append(
                    CustomerSource(
                        id=payment_profile.customerPaymentProfileId.pyval,
                        gateway="authorize.net",
                        credit_card_info=PaymentMethodInfo(
                            exp_year=expiration_year,
                            exp_month=expiration_month,
                            last_4=_normalize_last_4(card.cardNumber.pyval),
                            brand=card.cardType.pyval,
                            name=name,
                        ),
                    ))
    return results
コード例 #7
0
def get_customer_profile(customerProfileId):
    merchantAuth = apicontractsv1.merchantAuthenticationType()
    merchantAuth.name = constants.apiLoginId
    merchantAuth.transactionKey = constants.transactionKey
 
    getCustomerProfile = apicontractsv1.getCustomerProfileRequest()
    getCustomerProfile.merchantAuthentication = merchantAuth
    getCustomerProfile.customerProfileId = customerProfileId
    controller = getCustomerProfileController(getCustomerProfile)
    controller.execute()
 
    response = controller.getresponse()
 
    if (response.messages.resultCode=="Ok"):
        print "Successfully retrieved a customer with profile id %s and customer id %s" % (getCustomerProfile.customerProfileId, response.profile.merchantCustomerId)
        if hasattr(response, 'profile') == True:
            if hasattr(response.profile, 'paymentProfiles') == True:
                for paymentProfile in response.profile.paymentProfiles:
                     print ("paymentProfile in get_customerprofile is:" %paymentProfile)
                     print ("Payment Profile ID %s" % str(paymentProfile.customerPaymentProfileId))
             if hasattr(response.profile, 'shipToList') == True:
                 for ship in response.profile.shipToList:
                     print ("Shipping Details:")
                     print ("First Name %s" % ship.firstName)
                     print ("Last Name %s" % ship.lastName)
                     print ("Address %s" % ship.address
                     print ("Customer Address ID %s" % ship.customerAddressId)
        if hasattr(response, 'subscriptionIds') == True:
            if hasattr(response.subscriptionIds, 'subscriptionId') == True:
                print ("list of subscriptionid:")
                 for subscriptionid in (response.subscriptionIds.subscriptionId):
                    print (subscriptionid)
    else:
        print ("response code: %s" % response.messages.resultCode)
        print ("Failed to get customer profile information with id %s" % getCustomerProfile.customerProfileId)
 
    return response
 
if(os.path.basename(__file__) == os.path.basename(sys.argv[0])):
    get_customer_profile(constants.customerProfileId)
コード例 #8
0
ファイル: utils.py プロジェクト: pramodpalIndia/onhand
def provider_get_subscriptiondetails_from_customer_profile(profileId):
    # Setting the merchant details
    merchantAuth = apicontractsv1.merchantAuthenticationType()
    merchantAuth.name = get_secret("API_LOGIN_ID")
    merchantAuth.transactionKey = get_secret("API_TRANSACTION_KEY")
    customerProfileId = None
    # setting the customer profile details
    profile = apicontractsv1.customerProfileIdType()

    getCustomerProfile = apicontractsv1.getCustomerProfileRequest()
    getCustomerProfile.merchantAuthentication = merchantAuth
    getCustomerProfile.customerProfileId = str(profileId)
    controller = getCustomerProfileController(getCustomerProfile)
    controller.execute()

    response = controller.getresponse()

    paymentProfileId = None
    if (response.messages.resultCode == "Ok"):
        print(
            "Successfully retrieved a customer with profile id %s and customer id %s"
            % (getCustomerProfile.customerProfileId,
               response.profile.merchantCustomerId))
        if hasattr(response, 'profile') == True:
            profile.customerProfileId = getCustomerProfile.customerProfileId
            customerProfileId = getCustomerProfile.customerProfileId
            if hasattr(response.profile, 'paymentProfiles') == True:
                for paymentProfile in response.profile.paymentProfiles:
                    print("paymentProfile in get_customerprofile is:" %
                          paymentProfile)
                    print("Payment Profile ID %s" %
                          str(paymentProfile.customerPaymentProfileId))
                    paymentProfileId = str(
                        paymentProfile.customerPaymentProfileId)
        else:
            print("Failed to get customer profile information with id %s" %
                  getCustomerProfile.customerProfileId)

    return customerProfileId
コード例 #9
0
ファイル: testpyxb.py プロジェクト: ceolson01/AuthorizeNet
    def testGetCustomerProfile(self):
        loggingfilename = utility.helper.getproperty(
            constants.propertiesloggingfilename)
        logginglevel = utility.helper.getproperty(
            constants.propertiesexecutionlogginglevel)
        logging.basicConfig(filename=loggingfilename,
                            level=logginglevel,
                            format=constants.defaultlogformat)

        merchantAuth = apicontractsv1.merchantAuthenticationType()
        merchantAuth.name = "unknown"
        merchantAuth.transactionKey = "anon"

        getCustomerProfileRequest = apicontractsv1.getCustomerProfileRequest()
        getCustomerProfileRequest.merchantAuthentication = merchantAuth
        getCustomerProfileRequest.customerProfileId = '36152115'
        getCustomerProfileRequest.abc = 'aaaaaaaa'  #extra property not in getCustomerProfileRequest object

        logging.debug("Request: %s " % datetime.datetime.now())
        logging.debug("       : %s " % getCustomerProfileRequest)

        try:
            '''serialzing object to XML '''
            xmlRequest = getCustomerProfileRequest.toxml(
                encoding=constants.xml_encoding,
                element_name='getCustomerProfileRequest')
            xmlRequest = xmlRequest.replace(constants.nsNamespace1, b'')
            xmlRequest = xmlRequest.replace(constants.nsNamespace2, b'')
            logging.debug("Xml Request: %s" % xmlRequest)
            #print( "Xml Request: %s" % xmlRequest)
        except Exception as ex:
            logging.debug("Xml Exception: %s" % ex)

        try:
            '''deserialize XML to object '''
            deserializedObject = None
            deserializedObject = apicontractsv1.CreateFromDocument(xmlRequest)
            self.assertIsNotNone(deserializedObject,
                                 "Null deserializedObject ")

            if type(getCustomerProfileRequest) == type(deserializedObject):
                #print ("objects are equal")
                logging.debug(
                    "createtransactionrequest object is equal to deserializedObject"
                )
            else:
                #print ("some error: objects are NOT equal" )
                logging.debug(
                    "createtransactionrequest object is NOT equal to deserializedObject"
                )

            deseriaziedObjectXmlRequest = deserializedObject.toxml(
                encoding=constants.xml_encoding,
                element_name='deserializedObject')
            deseriaziedObjectXmlRequest = deseriaziedObjectXmlRequest.replace(
                constants.nsNamespace1, '')
            deseriaziedObjectXmlRequest = deseriaziedObjectXmlRequest.replace(
                constants.nsNamespace2, '')
            logging.debug("Good Dom Request: %s " %
                          deseriaziedObjectXmlRequest)
            #print( "Good Dom Request: %s " % deseriaziedObjectXmlRequest )
            #print("de-serialized successfully. GOOD CASE COMPLETE  \n ")
        except Exception as ex:

            logging.error('Create Document Exception: %s, %s', type(ex),
                          ex.args)

        self.assertEqual(type(getCustomerProfileRequest),
                         type(deserializedObject),
                         "deseriaziedObject does not match original object")

        try:
            #print("starting with element in mid")
            newxml = '<?xml version="1.0" encoding="utf-8"?><getCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><name>unknown</name><transactionKey>anon</transactionKey></merchantAuthentication><kriti>11Jan</kriti><customerProfileId>36152115</customerProfileId></getCustomerProfileRequest>'

            #print ("newxml: %s" %newxml)
            DEserializedNEWObject = apicontractsv1.CreateFromDocument(newxml)
            self.assertIsNotNone(DEserializedNEWObject,
                                 "Null deserializedObject ")

            DEseriaziedNEWObjectXmlRequest = DEserializedNEWObject.toxml(
                encoding=constants.xml_encoding,
                element_name='deserializedObject')
            DEseriaziedNEWObjectXmlRequest = DEseriaziedNEWObjectXmlRequest.replace(
                constants.nsNamespace1, '')
            DEseriaziedNEWObjectXmlRequest = DEseriaziedNEWObjectXmlRequest.replace(
                constants.nsNamespace2, '')
            logging.debug("Good Dom Request: %s " %
                          DEseriaziedNEWObjectXmlRequest)
            #print( " DEseriaziedNEWObjectXmlRequest Request: %s " % DEseriaziedNEWObjectXmlRequest )
            #print("de-serialized successfully")
            #print("FINISHED element in mid \n ")
        except Exception as ex:
            #print("DEseriaziedNEWObjectXmlRequest is NOT DESerialized")
            logging.error('Create Document Exception: %s, %s', type(ex),
                          ex.args)

        try:
            #print("starting with element at last")
            newxmlATLAst = '<?xml version="1.0" encoding="utf-8"?><getCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><name>unknown</name><transactionKey>anon</transactionKey></merchantAuthentication><customerProfileId>36152115</customerProfileId><gupta>11Jan</gupta></getCustomerProfileRequest>'
            #print ("newxmlATLAst: %s" %newxmlATLAst)
            DEserializedNEWObject = apicontractsv1.CreateFromDocument(
                newxmlATLAst)
            self.assertIsNotNone(DEserializedNEWObject,
                                 "Null deserializedObject ")
            DEseriaziedNEWObjectXmlRequest = DEserializedNEWObject.toxml(
                encoding=constants.xml_encoding,
                element_name='deserializedObject')
            DEseriaziedNEWObjectXmlRequest = DEseriaziedNEWObjectXmlRequest.replace(
                constants.nsNamespace1, '')
            DEseriaziedNEWObjectXmlRequest = DEseriaziedNEWObjectXmlRequest.replace(
                constants.nsNamespace2, '')
            logging.debug("Good Dom Request: %s " %
                          DEseriaziedNEWObjectXmlRequest)
            #print( " DEseriaziedNEWATLASTObjectXmlRequest Request: %s " % DEseriaziedNEWObjectXmlRequest )
            #print("de-serialized successfully")
            #print("Finished element at last \n " )
        except Exception as ex:
            #print("DEseriaziedNEWATLASTObjectXmlRequest is NOT DESerialized")
            logging.error('Create Document Exception: %s, %s', type(ex),
                          ex.args)
コード例 #10
0
from authorizenet import apicontractsv1
from authorizenet.apicontrollers import *

merchantAuth = apicontractsv1.merchantAuthenticationType()
merchantAuth.name = '5KP3u95bQpv'
merchantAuth.transactionKey = '4Ktq966gC55GAX7S'

getCustomerProfile = apicontractsv1.getCustomerProfileRequest()
getCustomerProfile.merchantAuthentication = merchantAuth
getCustomerProfile.customerProfileId = '36152115'

getCustomerProfileController = getCustomerProfileController(getCustomerProfile)
getCustomerProfileController.execute()

response = getCustomerProfileController.getresponse()

if (response.messages.resultCode == "Ok"):
    print "Successfully retrieved a customer with profile id %s and customer id %s" % (
        getCustomerProfile.customerProfileId,
        response.profile.merchantCustomerId)
    for paymentProfile in response.profile.paymentProfiles:
        print "Payment Profile ID %s" % paymentProfile.customerPaymentProfileId
    for ship in response.profile.shipToList:
        print "Shipping Details:"
        print "First Name %s" % ship.firstName
        print "Last Name %s" % ship.lastName
        print "Address %s" % ship.address
        print "Customer Address ID %s" % ship.customerAddressId
else:
    print "response code: %s" % response.messages.resultCode
    print "Failed to get customer profile information with id %s" % getCustomerProfile.customerProfileId
コード例 #11
0
ファイル: utils.py プロジェクト: pramodpalIndia/onhand
def provider_create_subscriptiondetails_from_customer_profile(
        amount, days, startdate, profileId):
    # Setting the merchant details
    merchantAuth = apicontractsv1.merchantAuthenticationType()
    merchantAuth.name = get_secret("API_LOGIN_ID")
    merchantAuth.transactionKey = get_secret("API_TRANSACTION_KEY")
    # Setting payment schedule
    paymentschedule = apicontractsv1.paymentScheduleType()
    paymentschedule.interval = apicontractsv1.paymentScheduleTypeInterval(
    )  # apicontractsv1.CTD_ANON() #modified by krgupta
    paymentschedule.interval.length = days
    paymentschedule.interval.unit = apicontractsv1.ARBSubscriptionUnitEnum.days
    paymentschedule.startDate = startdate
    paymentschedule.totalOccurrences = 999
    paymentschedule.trialOccurrences = 0

    # setting the customer profile details
    profile = apicontractsv1.customerProfileIdType()

    getCustomerProfile = apicontractsv1.getCustomerProfileRequest()
    getCustomerProfile.merchantAuthentication = merchantAuth
    getCustomerProfile.customerProfileId = str(profileId)
    controller = getCustomerProfileController(getCustomerProfile)
    controller.execute()

    response = controller.getresponse()

    paymentProfileId = None
    if (response.messages.resultCode == "Ok"):
        print(
            "Successfully retrieved a customer with profile id %s and customer id %s"
            % (getCustomerProfile.customerProfileId,
               response.profile.merchantCustomerId))
        if hasattr(response, 'profile') == True:
            profile.customerProfileId = getCustomerProfile.customerProfileId
            if hasattr(response.profile, 'paymentProfiles') == True:
                for paymentProfile in response.profile.paymentProfiles:
                    print("paymentProfile in get_customerprofile is:" %
                          paymentProfile)
                    print("Payment Profile ID %s" %
                          str(paymentProfile.customerPaymentProfileId))
                    paymentProfileId = str(
                        paymentProfile.customerPaymentProfileId)
        else:
            print("Failed to get customer profile information with id %s" %
                  getCustomerProfile.customerProfileId)

    profile.customerPaymentProfileId = paymentProfileId
    profile.customerAddressId = None

    # Setting subscription details
    subscription = apicontractsv1.ARBSubscriptionType()
    subscription.name = "Sample Subscription"
    subscription.paymentSchedule = paymentschedule
    subscription.amount = amount
    subscription.trialAmount = Decimal('0.00')
    subscription.profile = profile

    # Creating the request
    request = apicontractsv1.ARBCreateSubscriptionRequest()
    request.merchantAuthentication = merchantAuth
    request.subscription = subscription

    # Creating and executing the controller
    controller = ARBCreateSubscriptionController(request)
    controller.execute()
    # Getting the response
    response = controller.getresponse()

    if (response.messages.resultCode == "Ok"):
        print("SUCCESS:")
        print("Message Code : %s" % response.messages.message[0]['code'].text)
        print("Message text : %s" % response.messages.message[0]['text'].text)
        print("Subscription ID : %s" % response.subscriptionId)
    else:
        print("ERROR:")
        print("Message Code : %s" % response.messages.message[0]['code'].text)
        print("Message text : %s" % response.messages.message[0]['text'].text)

    return response
コード例 #12
0
from authorizenet import apicontractsv1
from authorizenet.apicontrollers import *

merchantAuth = apicontractsv1.merchantAuthenticationType()
merchantAuth.name = '5KP3u95bQpv'
merchantAuth.transactionKey = '4Ktq966gC55GAX7S'

getCustomerProfile = apicontractsv1.getCustomerProfileRequest()
getCustomerProfile.merchantAuthentication = merchantAuth
getCustomerProfile.customerProfileId = '36152115'

getCustomerProfileController = getCustomerProfileController(getCustomerProfile)
getCustomerProfileController.execute()

response = getCustomerProfileController.getresponse()

if (response.messages.resultCode=="Ok"):
	print "Successfully retrieved a customer with profile id %s and customer id %s" % (getCustomerProfile.customerProfileId, response.profile.merchantCustomerId)
	for paymentProfile in response.profile.paymentProfiles:
		print "Payment Profile ID %s" % paymentProfile.customerPaymentProfileId
	for ship in response.profile.shipToList:
		print "Shipping Details:"
		print "First Name %s" % ship.firstName
		print "Last Name %s" % ship.lastName
		print "Address %s" % ship.address
		print "Customer Address ID %s" % ship.customerAddressId
else:
	print "response code: %s" % response.messages.resultCode
	print "Failed to get customer profile information with id %s" % getCustomerProfile.customerProfileId
コード例 #13
0
ファイル: testpyxb.py プロジェクト: BrajeshKhare/sdk-python
 def testGetCustomerProfile(self):    
     loggingfilename = utility.helper.getproperty(constants.propertiesloggingfilename)
     logginglevel = utility.helper.getproperty(constants.propertiesexecutionlogginglevel) 
     logging.basicConfig(filename=loggingfilename, level=logginglevel, format=constants.defaultlogformat)
       
     merchantAuth = apicontractsv1.merchantAuthenticationType()
     merchantAuth.name = "unknown"
     merchantAuth.transactionKey = "anon"
     
     getCustomerProfileRequest = apicontractsv1.getCustomerProfileRequest() 
     getCustomerProfileRequest.merchantAuthentication = merchantAuth 
     getCustomerProfileRequest.customerProfileId = '36152115'   
     getCustomerProfileRequest.abc = 'aaaaaaaa' #extra property not in getCustomerProfileRequest object
     
     logging.debug( "Request: %s " % datetime.datetime.now())
     logging.debug( "       : %s " % getCustomerProfileRequest )
     
     try:    
         '''serialzing object to XML '''
         xmlRequest = getCustomerProfileRequest.toxml(encoding=constants.xml_encoding, element_name='getCustomerProfileRequest') 
         xmlRequest = xmlRequest.replace(constants.nsNamespace1, '')
         xmlRequest = xmlRequest.replace(constants.nsNamespace2, '')
         logging.debug( "Xml Request: %s" % xmlRequest)
         #print( "Xml Request: %s" % xmlRequest)
     except Exception as ex:
         logging.debug( "Xml Exception: %s" % ex)    
         
     try:
         '''deserialize XML to object '''    
         deserializedObject = None
         deserializedObject = apicontractsv1.CreateFromDocument(xmlRequest)           
         self.assertIsNotNone(deserializedObject, "Null deserializedObject ")
         
         if type(getCustomerProfileRequest) == type(deserializedObject):
             #print ("objects are equal")
             logging.debug( "createtransactionrequest object is equal to deserializedObject") 
         else:
             #print ("some error: objects are NOT equal" )
             logging.debug( "createtransactionrequest object is NOT equal to deserializedObject") 
         
         deseriaziedObjectXmlRequest = deserializedObject.toxml(encoding=constants.xml_encoding, element_name='deserializedObject') 
         deseriaziedObjectXmlRequest = deseriaziedObjectXmlRequest.replace(constants.nsNamespace1, '')
         deseriaziedObjectXmlRequest = deseriaziedObjectXmlRequest.replace(constants.nsNamespace2, '')
         logging.debug( "Good Dom Request: %s " % deseriaziedObjectXmlRequest )
         #print( "Good Dom Request: %s " % deseriaziedObjectXmlRequest )
         #print("de-serialized successfully. GOOD CASE COMPLETE  \n ")
     except Exception as ex:
         
         logging.error( 'Create Document Exception: %s, %s', type(ex), ex.args )
     
     self.assertEquals(type(getCustomerProfileRequest), type(deserializedObject), "deseriaziedObject does not match original object")
     
     try:
         #print("starting with element in mid")
         newxml = '<?xml version="1.0" encoding="utf-8"?><getCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><name>unknown</name><transactionKey>anon</transactionKey></merchantAuthentication><kriti>11Jan</kriti><customerProfileId>36152115</customerProfileId></getCustomerProfileRequest>'
         
         #print ("newxml: %s" %newxml)
         DEserializedNEWObject = apicontractsv1.CreateFromDocument(newxml)           
         self.assertIsNotNone(DEserializedNEWObject, "Null deserializedObject ")
         
         
         DEseriaziedNEWObjectXmlRequest = DEserializedNEWObject.toxml(encoding=constants.xml_encoding, element_name='deserializedObject') 
         DEseriaziedNEWObjectXmlRequest = DEseriaziedNEWObjectXmlRequest.replace(constants.nsNamespace1, '')
         DEseriaziedNEWObjectXmlRequest = DEseriaziedNEWObjectXmlRequest.replace(constants.nsNamespace2, '')
         logging.debug( "Good Dom Request: %s " % DEseriaziedNEWObjectXmlRequest )
         #print( " DEseriaziedNEWObjectXmlRequest Request: %s " % DEseriaziedNEWObjectXmlRequest )
         #print("de-serialized successfully")
         #print("FINISHED element in mid \n ")
     except Exception as ex:    
         #print("DEseriaziedNEWObjectXmlRequest is NOT DESerialized")
         logging.error( 'Create Document Exception: %s, %s', type(ex), ex.args )
         
         
     try:
         #print("starting with element at last")
         newxmlATLAst = '<?xml version="1.0" encoding="utf-8"?><getCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"><merchantAuthentication><name>unknown</name><transactionKey>anon</transactionKey></merchantAuthentication><customerProfileId>36152115</customerProfileId><gupta>11Jan</gupta></getCustomerProfileRequest>'
         #print ("newxmlATLAst: %s" %newxmlATLAst)
         DEserializedNEWObject = apicontractsv1.CreateFromDocument(newxmlATLAst)           
         self.assertIsNotNone(DEserializedNEWObject, "Null deserializedObject ")
         DEseriaziedNEWObjectXmlRequest = DEserializedNEWObject.toxml(encoding=constants.xml_encoding, element_name='deserializedObject') 
         DEseriaziedNEWObjectXmlRequest = DEseriaziedNEWObjectXmlRequest.replace(constants.nsNamespace1, '')
         DEseriaziedNEWObjectXmlRequest = DEseriaziedNEWObjectXmlRequest.replace(constants.nsNamespace2, '')
         logging.debug( "Good Dom Request: %s " % DEseriaziedNEWObjectXmlRequest )
         #print( " DEseriaziedNEWATLASTObjectXmlRequest Request: %s " % DEseriaziedNEWObjectXmlRequest )
         #print("de-serialized successfully")
         #print("Finished element at last \n " )
     except Exception as ex:    
         #print("DEseriaziedNEWATLASTObjectXmlRequest is NOT DESerialized")
         logging.error( 'Create Document Exception: %s, %s', type(ex), ex.args )