1

複数の支払いプロファイル (CIM) で顧客プロファイルを作成する方法は?

単一の支払いプロファイルを使用して顧客プロファイルを作成すると、正常に機能します。しかし、2 つ以上の支払いプロファイルを顧客プロファイルに追加しようとすると、次のエラーが発生します。

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>
4

1 に答える 1

1

他の誰かが興味を持っている場合は<paymentProfiles></paymentProfiles>、作成する支払いプロファイルごとに繰り返す必要があります.

<?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>
于 2015-07-23T19:23:23.270 に答える