Authorize.net使用ARB更新周期性结算

时间:2014-01-27 10:45:56

标签: php xml authorize.net

如果数据字段为空,Authorize.net ARP API是否接受XML数据?我们是否需要拥有所有XML元素的数据?

我使用以下XML来更新订阅。

<?xml version="1.0" encoding="utf-8"?>
<ARBUpdateSubscriptionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
  <merchantAuthentication>
    <name>435345345345</name>
    <transactionKey>sdfsdfsdfsdf</transactionKey>
  </merchantAuthentication>
  <refId>155969e50PGj</refId>
  <subscriptionId>234324</subscriptionId>
  <subscription>
    <amount>75</amount>
    <customer>
      <id>155969</id>
      <email></email>
      <phoneNumber></phoneNumber>
    </customer>
    <billTo>
      <firstName></firstName>
      <lastName></lastName>
      <company></company>
      <address></address>
      <city></city>
      <state></state>
      <zip></zip>
      <country></country>
    </billTo>
    <shipTo>
      <firstName></firstName>
      <lastName></lastName>
      <company></company>
      <address></address>
      <city></city>
      <state></state>
      <zip></zip>
      <country></country>
    </shipTo>
  </subscription>
</ARBUpdateSubscriptionRequest>

我收到以下错误:

<?xml version="1.0" encoding="utf-8"?>
<ARBUpdateSubscriptionResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
  <refId>155969e50PGj</refId>
  <messages>
    <resultCode>Error</resultCode>
    <message>
      <code>E00014</code>
      <text>Bill-To First Name is required.</text>
    </message>
    <message>
      <code>E00014</code>
      <text>Bill-To Last Name is required.</text>
    </message>
  </messages>
</ARBUpdateSubscriptionResponse>

1 个答案:

答案 0 :(得分:0)

ARBUpdateSubscriptionRequest需要请求中的其他XML

<?xml version="1.0" encoding="utf-8"?>
<ARBUpdateSubscriptionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
<merchantAuthentication>
   <name>mytestacct</name>
   <transactionKey>112223344</transactionKey>
</merchantAuthentication>
<refId>Sample</refId>
<subscriptionId>100748</subscriptionId>
<subscription>
  <payment>
    <creditCard>
      <cardNumber>4111111111111111</cardNumber>
      <expirationDate>2010-08</expirationDate>
    </creditCard>
 </payment>
 </subscription>
</ARBUpdateSubscriptionRequest>