Authorize.Net 无法更新到期日期

Authorize.Net unable to update expiration date

我正在尝试更新现有配置文件的到期日期 Authorize.Net。我能够检索个人资料信息,但是当我用 updateCustomerPaymentProfileRequest xml 调用 api 时,我得到:

E00003 The 'AnetApi/xml/v1/schema/AnetApiSchema.xsd:number' element is invalid - The value XX is invalid according to its datatype 'String' - The actual length is less than the MinLength value.

这是xml:

<updateCustomerPaymentProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
    <merchantAuthentication xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
        <name xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">bob123</name>
        <transactionKey xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">somesecretehere</transactionKey>
    </merchantAuthentication>
    <refId xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">id1</refId>
    <customerProfileId xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">12345</customerProfileId>
    <paymentProfile xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
        <billTo xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
            <firstName xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">Bilbo</firstName>
            <lastName xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">Baggins</lastName>
            <address xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">100 Main St.</address>
            <city xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">Some City</city>
            <state xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">ME</state>
            <zip xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">12345</zip>
        </billTo>
        <payment xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
            <creditCard xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
                <cardNumber xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">XXXX1111</cardNumber>
                <expirationDate xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">2049-04</expirationDate>
            </creditCard>
        </payment>
    </paymentProfile>
    <validationMode xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">liveMode</validationMode>
</updateCustomerPaymentProfileRequest>

实际发送的 XML 更像这样:

<updateCustomerPaymentProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
    <merchantAuthentication xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
        <name xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">bob123</name>
        <transactionKey xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">somesecretehere</transactionKey>
    </merchantAuthentication>
    <refId xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">id1</refId>
    <customerProfileId xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">12345</customerProfileId>
    <paymentProfile xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
        <billTo xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
            <firstName xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">Bilbo</firstName>
            <lastName xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">Baggins</lastName>
            <address xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">100 Main St.</address>
            <city xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">The Shire</city>
            <state xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">ME</state>
            <zip xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">12345</zip>
        </billTo>
        <payment xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
            <creditCard xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
                <cardNumber xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">XXXX1111</cardNumber>
                <expirationDate xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">2049-04</expirationDate>
            </creditCard>
        </payment>
        <driversLicense xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
            <number xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"></number>
            <state xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"></state> 
            <dateOfBirth xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"></dateOfBirth>
        </driversLicense>
        <customerPaymentProfileId xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">999</customerPaymentProfileId>
    </paymentProfile>
    <validationMode xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">liveMode</validationMode>
</updateCustomerPaymentProfileRequest>

注意空 driversLicense 元素。数字元素是真正的罪魁祸首。一旦我从 XML 中删除了整个 driversLicense 元素,所有这些都按预期工作。仔细检查实际的 XML.

是值得的