Billing address missing for recurring orders I'm using Datatrans module as payment gateway. Module does not fully support recurring payment, so I had to add some missing functionality. I added method createPayment:
  public function createPayment(PaymentInterface $payment, $capture = TRUE) {

    // Allowing only new payments
    $this-&gt;assertPaymentState($payment, ['new']);

    $payment_method = $payment-&gt;getPaymentMethod();
    $amount = strval(floor(floatval($payment-&gt;getAmount()-&gt;getNumber())*100));


    // Calling Datatrans API and handling response
    $transaction_data = [
      'apiUrl' =&gt; $this-&gt;configuration['r_api_url'],
      'errorEmail' =&gt; $this-&gt;configuration['r_error_email'],
      'successEmail' =&gt; $this-&gt;configuration['r_success_email'],
      'transactionRefNo' =&gt; $payment-&gt;getOrderId(),
      'merchantAccountId' =&gt; $this-&gt;configuration['r_merchant_id'],
      'merchantAccountPassword' =&gt; $this-&gt;configuration['r_merchant_password'],
      'sign' =&gt; $this-&gt;configuration['r_sign'],
      'req_type' =&gt; $this-&gt;configuration['req_type'],
      'expm' =&gt; $payment_method-&gt;expm-&gt;getValue()[0]['value'],
      'expy' =&gt; $payment_method-&gt;expy-&gt;getValue()[0]['value'],
      'amount' =&gt; $amount,
      'currencyCode' =&gt; $payment-&gt;getAmount()-&gt;getCurrencyCode(),
      'aliasCC' =&gt; $payment_method-&gt;getRemoteId(),
    ];

    $transaction = DatatransHelper::makeTransaction($transaction_data);

    // Saving payment locally

    $next_state = $capture ? 'completed' : 'authorization';
    $payment-&gt;setState($next_state);
    $payment-&gt;setRemoteId($transaction[&quot;uppTransactionId&quot;]);
    $payment-&gt;setExpiresTime(strtotime('+5 days'));
    $payment-&gt;save();

  }

And it works, but problem I have is that all recurring orders created by recurring module do not have billing addresses.
Looked at database and condition for an order to have billing address (table &quot;commerce_order&quot;) it must have id of user profile set in fields &quot;billing_profile__target_id&quot; and &quot;billing_profile__target_revision_id&quot;. If I put some billing profile ids there directly, by editing database billing profile for that order appear and everything works as expected.
What (and where) should I add to my code to set that billing address?
Inside RecurringOrderManager() , refreshOrder() and createOrder() methods I saw row like:
 $billing_profile = $payment_method ? $payment_method-&gt;getBillingProfile() : NULL;

and that getBillingProfile() may be the method I'm missing (I do have null instead of billing profile id in database), but what confuses me is that it's defined in PaymentMethodInterface and Datatrans module is not implementing it at all?!
Is it up to Datatrans module to do something in order to set billing profile? How can I do that? I'm not very familiar with this and any hint is welcome.
Some workaround:
  // For unknown reason recurring orders are not getting billing profiles.
  // This method is checking of order has billing profile and if not
  // it finds it's initial order over subscription and copies it's
  // billing profile.
  public static function addMissingBillingAddress (Order $order)
  {
    if ($order-&gt;getBillingProfile() == null) {
      $subscriptions = self::collectSubscriptions($order);
      $subscription = array_shift($subscriptions);
      $initialOrder = $subscription-&gt;getInitialOrder();
      $billingProfile = $initialOrder-&gt;getBillingProfile();
      $order-&gt;setBillingProfile($billingProfile);
      $order-&gt;save();
      return;
    }
  }

  public static function collectSubscriptions($order) {
    $subscriptions = [];
    foreach ($order-&gt;getItems() as $order_item) {
      if ($order_item-&gt;get('subscription')-&gt;isEmpty()) {
        // A recurring order item without a subscription ID is malformed.
        continue;
      }
      /** @var \Drupal\commerce_recurring\Entity\SubscriptionInterface $subscription */
      $subscription = $order_item-&gt;get('subscription')-&gt;entity;
      // Guard against deleted subscription entities.
      if ($subscription) {
        $subscriptions[$subscription-&gt;id()] = $subscription;
      }
    }
    return $subscriptions;
  }

When I'm processing recurring order I'm checking if billing address is missing and if it does I'm collecting one from initial order (over subscription) and injecting that one.
Of course, I would like to know why it's not added at first place.