<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: The element 'subscription' has invalid child element 'customer' in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68906#M42031</link>
    <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/26959"&gt;@Renaissance&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're trying to create a subscription with ARB when we get the error.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Aug 2019 23:13:45 GMT</pubDate>
    <dc:creator>cartpauj</dc:creator>
    <dc:date>2019-08-29T23:13:45Z</dc:date>
    <item>
      <title>The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68741#M41896</link>
      <description>&lt;PRE&gt;Error E00003 The element 'subscription' in namespace 'AnetApi/sml/v1/schema/AnetApiSchema.xsd' has invalid child element 'cusotmer' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'shipTo', profile' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Getting this error when trying to add an ARB subscription. We're not using profiles, but according to the API docs, "customer" should be a valid sub element of "subscription".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developer.authorize.net/api/reference/#recurring-billing-create-a-subscription" target="_blank"&gt;https://developer.authorize.net/api/reference/#recurring-billing-create-a-subscription&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Full code:&lt;/P&gt;&lt;PRE&gt;&amp;lt;?php
  ...
  public function create_subscription($transaction) {
    global $custom_options;

    if(isset($transaction) and $transaction instanceof Transaction) {
      $usr = $transaction-&amp;gt;user();
      $prd = $transaction-&amp;gt;product();
      $sub = $transaction-&amp;gt;subscription();
    }
    else {
      throw new CustomGatewayException( 'Payment was unsuccessful, please check your payment details and try again.' );
    }

    $invoice = $this-&amp;gt;create_new_order_invoice($sub);

    // Default to 9999 for infinite occurrences
    $total_occurrences = $sub-&amp;gt;limit_cycles ? $sub-&amp;gt;limit_cycles_num : 9999;

    $args = array( "refId" =&amp;gt; $invoice,
                   "subscription" =&amp;gt; array(
                     "name" =&amp;gt; $prd-&amp;gt;post_title,
                     "paymentSchedule" =&amp;gt; array(
                       "interval" =&amp;gt; $this-&amp;gt;arb_subscription_interval($sub),
                       "startDate" =&amp;gt; Utils::get_date_from_ts((time() + (($sub-&amp;gt;trial)?Utils::days($sub-&amp;gt;trial_days):0)), 'Y-m-d'),
                       "totalOccurrences" =&amp;gt; $total_occurrences,
                     ),
                     "amount" =&amp;gt; Utils::format_float($sub-&amp;gt;total),
                     "payment" =&amp;gt; array(
                       "creditCard" =&amp;gt; array(
                         "cardNumber" =&amp;gt; sanitize_text_field($_POST['custom_cc_num']),
                         "expirationDate" =&amp;gt; sanitize_text_field($_POST['custom_cc_exp_month']) . '-' . sanitize_text_field($_POST['custom_cc_exp_year']),
                         "cardCode" =&amp;gt; sanitize_text_field($_POST['custom_cvv_code'])
                       )
                     ),
                     "order" =&amp;gt; array(
                       "invoiceNumber" =&amp;gt; $invoice,
                       "description" =&amp;gt; $prd-&amp;gt;post_title
                     ),
                     "billTo" =&amp;gt; array(
                       "firstName" =&amp;gt; $usr-&amp;gt;first_name,
                       "lastName" =&amp;gt; $usr-&amp;gt;last_name
                     ),
                     "customer" =&amp;gt; array(
                       "email" =&amp;gt; $usr-&amp;gt;user_email
                     )
                   )
                 );

    if($custom_options-&amp;gt;show_address_fields &amp;amp;&amp;amp; $custom_options-&amp;gt;require_address_fields) {
      $args['subscription']['billTo'] =
        array_merge($args['subscription']['billTo'],
                    array("address" =&amp;gt; str_replace('&amp;amp;', '&amp;amp;amp;', get_user_meta($usr-&amp;gt;ID, 'custom-address-one', true)),
                          "city"    =&amp;gt; get_user_meta($usr-&amp;gt;ID, 'custom-address-city', true),
                          "state"   =&amp;gt; get_user_meta($usr-&amp;gt;ID, 'custom-address-state', true),
                          "zip"     =&amp;gt; get_user_meta($usr-&amp;gt;ID, 'custom-address-zip', true),
                          "country" =&amp;gt; get_user_meta($usr-&amp;gt;ID, 'custom-address-country', true)));
    }

    $res = $this-&amp;gt;send_arb_request('ARBCreateSubscriptionRequest', $args);
    ...
  
  protected function send_arb_request($method, $args, $http_method = 'post') {
    $args = array_merge(
      array(
        "merchantAuthentication" =&amp;gt; array(
          "name" =&amp;gt; $this-&amp;gt;settings-&amp;gt;login_name,
          "transactionKey" =&amp;gt; $this-&amp;gt;settings-&amp;gt;transaction_key
        )
      ),
      $args
    );

    $content = $this-&amp;gt;arb_array_to_xml($method, $args);

    $remote_array = array('method' =&amp;gt; strtoupper($http_method),
                          'timeout' =&amp;gt; 30,
                          'redirection' =&amp;gt; 5,
                          'httpversion' =&amp;gt; '1.0',
                          'blocking' =&amp;gt; true,
                          'headers' =&amp;gt; array('content-type' =&amp;gt; 'application/xml'),
                          'body' =&amp;gt; $content,
                          'cookies' =&amp;gt; array());

    $response = wp_remote_post('https://api2.authorize.net/xml/v1/request.api', $remote_array);
    ...&lt;/PRE&gt;&lt;P&gt;Is the (&lt;A href="https://api2.authorize.net/xml/v1/request.api" target="_blank"&gt;https://api2.authorize.net/xml/v1/request.api&lt;/A&gt;) endpoint the problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any help!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 20:03:57 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68741#M41896</guid>
      <dc:creator>cartpauj</dc:creator>
      <dc:date>2019-08-14T20:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68871#M42001</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/26959"&gt;@Renaissance&lt;/a&gt;&amp;nbsp;any ideas? I've tried different endpoints, but I can't seem to get around the Email required error. I disabled email as required in the Form Fields, but the processor must be requiring the email. So we have to provide the email.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2019 17:31:17 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68871#M42001</guid>
      <dc:creator>cartpauj</dc:creator>
      <dc:date>2019-08-27T17:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68905#M42030</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/13801"&gt;@cartpauj&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The customer object is a direct property of the TransactionRequestType.&amp;nbsp; Try that and it should work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 22:44:17 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68905#M42030</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-08-29T22:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68906#M42031</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/26959"&gt;@Renaissance&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're trying to create a subscription with ARB when we get the error.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Aug 2019 23:13:45 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68906#M42031</guid>
      <dc:creator>cartpauj</dc:creator>
      <dc:date>2019-08-29T23:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68913#M42037</link>
      <description>&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/13801"&gt;@cartpauj&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;I do not use ARB and was thinking that subscription was under a transaction request. I am not sure about your endpoint. I would have to look it up. I would say if you’re getting a response you are fine. I’m leaving breakfast now and will be busy all day, but I’ll look at your code again tomorrow morning or maybe later tonight. You should be able to pass the customer.</description>
      <pubDate>Fri, 30 Aug 2019 11:34:42 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68913#M42037</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-08-30T11:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68918#M42042</link>
      <description>&lt;P&gt;The error message has "cusotmer" where your code says "customer"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;customer is a child of subscription.&lt;/P&gt;</description>
      <pubDate>Sat, 31 Aug 2019 01:02:12 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68918#M42042</guid>
      <dc:creator>kabutotx</dc:creator>
      <dc:date>2019-08-31T01:02:12Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68920#M42044</link>
      <description>&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/18439"&gt;@kabutotx&lt;/a&gt;&lt;BR /&gt;&lt;BR /&gt;Good catch.</description>
      <pubDate>Sat, 31 Aug 2019 11:42:20 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68920#M42044</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-08-31T11:42:20Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68933#M42046</link>
      <description>&lt;P&gt;Sometimes simple spelling mistakes can generate this kind of errors. Recently this literally happened with me and It took more than 2 hours to solve that problem.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Sep 2019 10:34:08 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68933#M42046</guid>
      <dc:creator>levinho</dc:creator>
      <dc:date>2019-09-01T10:34:08Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68945#M42053</link>
      <description>&lt;P&gt;I had to type the error manually as it was given to me in a screenshot. I made a typo there. The code is correctly using "customer" and the error message is correctly reflecting "customer" as well. Just a typo in the OP is all. Screenshot:&amp;nbsp;&lt;A href="http://cspf.co/fb4c81da8add" target="_blank"&gt;http://cspf.co/fb4c81da8add&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 15:00:24 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68945#M42053</guid>
      <dc:creator>cartpauj</dc:creator>
      <dc:date>2019-09-03T15:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68946#M42054</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/13801"&gt;@cartpauj&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where are you creating the customer object in this request?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 21:04:27 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68946#M42054</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-09-03T21:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68947#M42055</link>
      <description>&lt;P&gt;Are you using the API endpoints? Or do you do this through SIM?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 21:05:44 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68947#M42055</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-09-03T21:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68948#M42056</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/26959"&gt;@Renaissance&lt;/a&gt;&amp;nbsp;we do not create a customer object. We're creating a subscription via ARB and trying to send the customer email address is all.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 21:09:01 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68948#M42056</guid>
      <dc:creator>cartpauj</dc:creator>
      <dc:date>2019-09-03T21:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68949#M42057</link>
      <description>&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/13801"&gt;@cartpauj&lt;/a&gt;that is your problem.&lt;BR /&gt;&lt;BR /&gt;The customer property of the request only accepts customer type objects. This is through SIM/DPM or through the modern API?</description>
      <pubDate>Tue, 03 Sep 2019 21:17:12 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68949#M42057</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-09-03T21:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68950#M42058</link>
      <description>&lt;P&gt;We use&amp;nbsp;ARBCreateSubscriptionRequest&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code from the OP is exactly how we're doing it.&amp;nbsp; It works fine if we remove the customer -&amp;gt; email from the data.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 22:08:05 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68950#M42058</guid>
      <dc:creator>cartpauj</dc:creator>
      <dc:date>2019-09-03T22:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68951#M42059</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/13801"&gt;@cartpauj&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That can't be the whole picture. All of those properties have to be assigned to objects.&amp;nbsp; Your function where you pass your arguments may not have a place for the customer object. I am not good with XML but if you are using php code through the API with that function, they have to be passed as objects.&amp;nbsp; Copy and paste the function definition that is doing the ARBCreateSubscriptionRequest. The one that you pass the $args array to.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 22:33:15 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68951#M42059</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-09-03T22:33:15Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68952#M42060</link>
      <description>&lt;P&gt;It's the second function in the OP code that sends the request (using WordPress Request API).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This was written probably back in 2013 using the XML api, so it is definitely old.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It works fine except in the rare case where we need to send an email address along with the subscription data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The $args get converted to XML in this function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  protected function arb_array_to_xml($method, $array, $level=0) {
    if($level==0) {
      $xml = "&amp;lt;?xml version=\"1.0\" encoding=\"utf-8\" ?&amp;gt;\n";
      $xml .= "&amp;lt;{$method} xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\"&amp;gt;\n";
    }
    else
      $xml = '';

    foreach($array as $key =&amp;gt; $value ) {
      // Print indentions
      for($i=0; $i &amp;lt; $level+1; $i++) { $xml .= "  "; }

      // Print open tag (looks like we don't need
      // to worry about attributes with this schema)
      $xml .= "&amp;lt;{$key}&amp;gt;";

      // Print value or recursively render sub arrays
      if(is_array($value)) {
        $xml .= "\n";
        $xml .= $this-&amp;gt;arb_array_to_xml($method,$value,$level+1);
        // Print indentions for end tag
        for($i=0; $i &amp;lt; $level+1; $i++) { $xml .= "  "; }
      }
      else
        $xml .= $value;

      // Print End tag
      $xml .= "&amp;lt;/{$key}&amp;gt;\n";
    }

    if($level==0)
      $xml .= "&amp;lt;/{$method}&amp;gt;\n";

    return $xml;
  }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 22:40:16 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68952#M42060</guid>
      <dc:creator>cartpauj</dc:creator>
      <dc:date>2019-09-03T22:40:16Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68953#M42061</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/13801"&gt;@cartpauj&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So you are creating XML with that. In your code below, I think it is the customer and billTo properties being out of order.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; $args = array( "refId" =&amp;gt; $invoice,
                   "subscription" =&amp;gt; array(
                     "name" =&amp;gt; $prd-&amp;gt;post_title,
                     "paymentSchedule" =&amp;gt; array(
                       "interval" =&amp;gt; $this-&amp;gt;arb_subscription_interval($sub),
                       "startDate" =&amp;gt; Utils::get_date_from_ts((time() + (($sub-&amp;gt;trial)?Utils::days($sub-&amp;gt;trial_days):0)), 'Y-m-d'),
                       "totalOccurrences" =&amp;gt; $total_occurrences,
                     ),
                     "amount" =&amp;gt; Utils::format_float($sub-&amp;gt;total),
                     "payment" =&amp;gt; array(
                       "creditCard" =&amp;gt; array(
                         "cardNumber" =&amp;gt; sanitize_text_field($_POST['custom_cc_num']),
                         "expirationDate" =&amp;gt; sanitize_text_field($_POST['custom_cc_exp_month']) . '-' . sanitize_text_field($_POST['custom_cc_exp_year']),
                         "cardCode" =&amp;gt; sanitize_text_field($_POST['custom_cvv_code'])
                       )
                     ),
                     "order" =&amp;gt; array(
                       "invoiceNumber" =&amp;gt; $invoice,
                       "description" =&amp;gt; $prd-&amp;gt;post_title
                     ),
                     "billTo" =&amp;gt; array(
                       "firstName" =&amp;gt; $usr-&amp;gt;first_name,
                       "lastName" =&amp;gt; $usr-&amp;gt;last_name
                     ),
                     "customer" =&amp;gt; array(
                       "email" =&amp;gt; $usr-&amp;gt;user_email
                     )
                   )
                 );

&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;you are getting this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;error E00003 The element 'subscription' in namespace 'AnetApi/sml/v1/schema/AnetApiSchema.xsd' has invalid child element 'customer' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'. List of possible elements expected: 'shipTo', profile' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because the next child element following billTo is shipTo, but your request gives customer. Put customer after order and billTo after customer and it should work.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 22:56:46 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68953#M42061</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-09-03T22:56:46Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68954#M42062</link>
      <description>&lt;P&gt;If that does it, please kindly mark this thread as solved. Just an FYI, if you use the sample code and php SDK package, you never run into this issue.&amp;nbsp; Your request is aligned with the schema for you no matter what you do. You should try it.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 22:59:12 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68954#M42062</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-09-03T22:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68955#M42063</link>
      <description>&lt;P&gt;I will test that now and update this if that resolves it. I was not aware the order would matter either.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, we are in need of a complete rewrite at this point :)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully this isn't against forum rules, but &lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/26959"&gt;@Renaissance&lt;/a&gt;&amp;nbsp;are you available off-forums anywhere for consulting/development work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll follow up soon.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 23:10:13 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68955#M42063</guid>
      <dc:creator>cartpauj</dc:creator>
      <dc:date>2019-09-03T23:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: The element 'subscription' has invalid child element 'customer'</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68956#M42064</link>
      <description>&lt;P&gt;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/13801"&gt;@cartpauj&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I will be in the auth.net certified developer program soon.&amp;nbsp; Feel free to IM me on this website if you need additional help. Click my name then click send this user a private message.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 23:17:02 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/The-element-subscription-has-invalid-child-element-customer/m-p/68956#M42064</guid>
      <dc:creator>Renaissance</dc:creator>
      <dc:date>2019-09-03T23:17:02Z</dc:date>
    </item>
  </channel>
</rss>

