【问题标题】:How to create customer Profile with multiple payment profiles(CIM)?如何创建具有多个付款配置文件(COM)的客户配置文件?
【发布时间】:2013-02-18 17:33:18
【问题描述】:

如何创建具有多个付款配置文件(CIM)的客户配置文件?

使用单一付款资料创建客户资料可以正常工作。但是当我尝试将两个或多个付款资料添加到客户资料时,我收到以下错误。

E00003 - 命名空间“AnetApi/xml/v1/schema/AnetApiSchema.xsd”中的元素“paymentProfiles”在命名空间“AnetApi/xml/v1/schema/AnetApiSchema.xsd”中具有无效的子元素“customerType”。预期的可能元素列表:命名空间“AnetApi/xml/v1/schema/AnetApiSchema.xsd”中的“driversLicense, taxId”。

for (int 1=0;i< n;i++){
    list.add (createPaymentProfile());
}

Transaction.setPaymentProfileList(list);

上面的代码生成如下的xml。

<?xml version="1.0" encoding="UTF-8"?>

<createCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
   <merchantAuthentication>
      <name>33k7hYV736488Bs8</name>
      <transactionKey>86SV776773Ac6tMV22313fE</transactionKey>
   </merchantAuthentication>
   <refId>1361101257555</refId>
   <profile>
      <merchantCustomerId>2CLINC056</merchantCustomerId>
      <description>hiiiiii.</description>
      <email />
      <paymentProfiles>
         <customerType>individual</customerType>
         <billTo>
            <firstName>Joe</firstName>
            <lastName>Test</lastName>
            <company>CompanyA</company>
            <address>hello</address>
            <city>Bangalore</city>
            <state>Delhi</state>
            <zip>560078</zip>
            <country>IN</country>
            <phoneNumber>415-555-1212</phoneNumber>
            <faxNumber>415-555-1313</faxNumber>
         </billTo>
         <payment>
            <creditCard>
               <cardNumber>370000000000002</cardNumber>
               <expirationDate>2029-12</expirationDate>
            </creditCard>
         </payment>
         <customerType>individual</customerType>
         <billTo>
            <firstName>Joe</firstName>
            <lastName>Test</lastName>
            <company>CompanyA</company>
            <address>vel</address>
            <city>Chennai</city>
            <state>AK</state>
            <zip>560089</zip>
            <country>US</country>
            <phoneNumber>415-555-1212</phoneNumber>
            <faxNumber>415-555-1313</faxNumber>
         </billTo>
         <payment>
            <creditCard>
               <cardNumber>38000000000006</cardNumber>
               <expirationDate>2029-12</expirationDate>
            </creditCard>
         </payment>
      </paymentProfiles>
   </profile>
   <validationMode>testMode</validationMode>
    </createCustomerProfileRequest>

【问题讨论】:

    标签: xml-parsing payment-gateway authorize.net authorize.net-cim


    【解决方案1】:

    如果其他人好奇,您必须为要创建的每个付款资料重复 &lt;paymentProfiles&gt;&lt;/paymentProfiles&gt;

    <?xml version="1.0" encoding="UTF-8"?>
    
    <createCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
       <merchantAuthentication>
          <name>33k7hYV736488Bs8</name>
          <transactionKey>86SV776773Ac6tMV22313fE</transactionKey>
       </merchantAuthentication>
       <refId>1361101257555</refId>
       <profile>
          <merchantCustomerId>2CLINC056</merchantCustomerId>
          <description>hiiiiii.</description>
          <email />
          <paymentProfiles>
             <customerType>individual</customerType>
             <billTo>
                <firstName>Joe</firstName>
                <lastName>Test</lastName>
                <company>CompanyA</company>
                <address>hello</address>
                <city>Bangalore</city>
                <state>Delhi</state>
                <zip>560078</zip>
                <country>IN</country>
                <phoneNumber>415-555-1212</phoneNumber>
                <faxNumber>415-555-1313</faxNumber>
             </billTo>
             <payment>
                <creditCard>
                   <cardNumber>370000000000002</cardNumber>
                   <expirationDate>2029-12</expirationDate>
                </creditCard>
             </payment>
            </paymentProfiles>
            <paymentProfiles>
             <customerType>individual</customerType>
             <billTo>
                <firstName>Joe</firstName>
                <lastName>Test</lastName>
                <company>CompanyA</company>
                <address>vel</address>
                <city>Chennai</city>
                <state>AK</state>
                <zip>560089</zip>
                <country>US</country>
                <phoneNumber>415-555-1212</phoneNumber>
                <faxNumber>415-555-1313</faxNumber>
             </billTo>
             <payment>
                <creditCard>
                   <cardNumber>38000000000006</cardNumber>
                   <expirationDate>2029-12</expirationDate>
                </creditCard>
             </payment>
          </paymentProfiles>
       </profile>
       <validationMode>testMode</validationMode>
        </createCustomerProfileRequest>
    

    【讨论】:

      猜你喜欢
      • 2021-09-17
      • 1970-01-01
      • 2011-07-24
      • 2014-02-23
      • 2015-02-25
      • 1970-01-01
      • 2012-10-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多