Showing results for 
Search instead for 
Did you mean: 

Cannot set default payment profile when using updateCustomerPaymentProfile in ruby

Hi everyone,


I am using updateCustomerPaymentProfile endpoint to try to update a payment profile. This works well, except one field, defaultPaymentProfile


The docs say it is an expected field, but the type does not allow it in ruby SDK, see in the official source code:


Even after monkey patching the type, it sends the request but I receive an error response as following:


AuthorizeNetException: E00003: The element 'paymentProfile' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'defaultPaymentProfile' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd

As a reference, the block of code that I am using:


        profile =
        profile.customerPaymentProfileId = current_profile.customerPaymentProfileId
        profile.billTo = billTo
        profile.payment =, cc_data.expirationDate)) 
        profile.taxId = user.tax_id if user.tax_id
        profile.defaultPaymentProfile = true
        profile.customerType = 'individual'

        request =
        request.paymentProfile = profile
        request.customerProfileId = customer_profile_id
        request.validationMode = AuthorizeNet::API::ValidationModeEnum::LiveMode

        response = transaction.update_customer_payment_profile(request)

What am i doing wrong?


Thanks for your help!


Anyone from Authorize.Net can confirm this / advise what to do?




I dumped the raw XML sent by the request when I patch the SDK:


<updateCustomerPaymentProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">

Yes, this returns a malformed request response from the srever:


E00003 : The element 'paymentProfile' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has invalid child element 'defaultPaymentProfile' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.


This appears to be the same XML structure as shown in the API docs, yet it does not work.


Any help appreciated