cancel
Showing results for 
Search instead for 
Did you mean: 

E00040 When validating Customer Payment Profile.

    I am writting code in python 2.7 using the SDK from the github repo to validate the information given by the user before giving them access to my websites paid content. The user is to enter their card number and expiration date.

 

    I take this information and create a subscription with it. Once the subscription is created I attempt to validate the payment information via the payment profile. When I do this in my sandbox environment (in live mode) I simply get an "E00040 Customer Profile ID or Customer Payment Profile ID not found" message.

 

    When I look for these ids myself I find that they do exist and are connected with eachother properly. Here are the python functions being used to validate the payment information.

 

def get_subscription_from_id(self, subscription_id):
        getSubscription = apicontractsv1.ARBGetSubscriptionRequest()
        getSubscription.merchantAuthentication = self.merchant_auth
        getSubscription.subscriptionId = str(subscription_id)

        getSubscriptionController =\
            ARBGetSubscriptionController(getSubscription)
        getSubscriptionController.execute()

        response = getSubscriptionController.getresponse()
        if(response.messages.resultCode == "Ok"):
            return response.subscription
        else:
            raise Exception("Subscription id is invalid or could not be found")

    def validate_payment_profile(self, profile_id, payment_profile_id):
        print("DEBUG::: profile: " + str(profile_id))
        print("DEBUG::: payment: " + str(payment_profile_id))
        validate_customer_payment_profile =\
            apicontractsv1.validateCustomerPaymentProfileRequest()
        validate_customer_payment_profile.merchantAuthentication =\
            self.merchant_auth
        validate_customer_payment_profile.customerProfileId = str(profile_id)
        validate_customer_payment_profile.customerPaymentProfileId =\
            str(payment_profile_id)
        validate_customer_payment_profile.validationMode = "liveMode"

        validate_customer_payment_profile_controller =\
            validateCustomerPaymentProfileController(
                validate_customer_payment_profile)
        validate_customer_payment_profile_controller.execute()

        response = validate_customer_payment_profile_controller.getresponse()

        if(response.messages.resultCode == "Ok"):
            return True
        else:
            print("DEBUG::: " + response.messages.message[0]['code'])
            print("DEBUG::: " + response.messages.message[0]['text'])
            return False

Any ideas of what could be the problem for validating this information?

P.S. the merchant_auth object is define globally and used in all other method which do work properly. If needed I can post its definition as well.

inuasha880
Member
10 REPLIES 10

Hi Richard

 

This happens to me as well on the production API endpoint. 

 

Has this already been addressed on the production endpoint? 

 

Thanks

Tushar