Closed pandaiolo closed 3 weeks ago
As seen in this SO answer the server only accepts XML children in the right order. Hence the issue using the provided SDK type (which missed the prop alltogether) or monkey patched type (which would add the missing type in the wrong order)
Anybody experiencing the same can use this custom type until this is fixed:
module AuthorizeNet::API
class CustomerPaymentProfileExTypePatched
include ROXML
xml_accessor :customerType
xml_accessor :billTo, as: AuthorizeNet::API::CustomerAddressType
xml_accessor :payment, as: AuthorizeNet::API::PaymentType
xml_accessor :driversLicense, as: AuthorizeNet::API::DriversLicenseType
xml_accessor :taxId
xml_accessor :defaultPaymentProfile
xml_accessor :subsequentAuthInformation
xml_accessor :customerPaymentProfileId
def initialize(customerType = nil, billTo = nil, payment = nil, driversLicense = nil, taxId = nil, defaultPaymentProfile = nil, subsequentAuthInformation = nil, customerPaymentProfileId = nil)
@customerType = customerType
@billTo = billTo
@payment = payment
@driversLicense = driversLicense
@taxId = taxId
@defaultPaymentProfile = defaultPaymentProfile
@subsequentAuthInformation = subsequentAuthInformation
@customerPaymentProfileId = customerPaymentProfileId
end
end
end
Closing this as the fix has been added as part of a commit.
Considering the following
CustomerPaymentProfileType
:Why is
CustomerPaymentProfileExType
defined in the following way?Given the relevant portion of the
xsd
schema:Expected instead:
I would expect the
CustomerPaymentProfileExType
to include the same properties as theCustomerPaymentProfileType
does, which means:defaultPaymentProfile
andsubsequentAuthInformation
Or am I missing something?
Extra question:
As asked in the community, I patched the above on my local copy of the sdk, but the server responded with an error:
Is this from the server or from the lib? In any case, why is the
defaultPaymentProfile
property refused from that request , despite it is clearly defined in the schema, and, also, necessary to update the underlying concept of a default payment profile in a customer profile...Thanks for your help.