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 = AuthorizeNet::API::CustomerPaymentProfileExType.new profile.customerPaymentProfileId = current_profile.customerPaymentProfileId profile.billTo = billTo profile.payment = AuthorizeNet::API::PaymentType.new(AuthorizeNet::API::CreditCardType.new(cc_data.cardNumber, cc_data.expirationDate)) profile.taxId = user.tax_id if user.tax_id profile.defaultPaymentProfile = true profile.customerType = 'individual' request = AuthorizeNet::API::UpdateCustomerPaymentProfileRequest.new 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!
10-01-2021 03:36 PM
Anyone from Authorize.Net can confirm this / advise what to do?
Thanks
10-06-2021 02:11 AM
I dumped the raw XML sent by the request when I patch the SDK:
<updateCustomerPaymentProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> <merchantAuthentication> <name>REDACTED</name> <transactionKey>REDACTED</transactionKey> </merchantAuthentication> <customerProfileId>REDACTED</customerProfileId> <paymentProfile> <customerType>individual</customerType> <billTo> <firstName>REDACTED</firstName> <lastName>REDACTED</lastName> <address>REDACTED</address> <city>REDACTED</city> <state>REDACTED</state> <zip>REDACTED</zip> <country>REDACTED</country> <phoneNumber>REDACTED</phoneNumber> </billTo> <payment> <creditCard> <cardNumber>XXXX4242</cardNumber> <expirationDate>2022-03</expirationDate> </creditCard> </payment> <customerPaymentProfileId>REDACTED</customerPaymentProfileId> <defaultPaymentProfile>true</defaultPaymentProfile> </paymentProfile> <validationMode>liveMode</validationMode> </updateCustomerPaymentProfileRequest>
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
10-06-2021 07:51 AM
10-12-2021 07:57 AM