After debugging my checkout process caused by the reason that no subscriptions were created, I found out that the payment method variable is always null.

In the function onPlaceTransition in the OrderSubscriber I found this peace of code.

    $payment_method = $order->get('payment_method')->entity;
    if (empty($payment_method)) {
      return;
    }

At first I thought this is caused by my "manual" payment that the value is not set correctly. This payment method is just for local debugging purposes during my development process. So I switched to commerce_mollie and started again. The behavior is even with the mollie payment the same. The variable $payment_method is always null. For this reason no subscriptions were created.

Comments

Anonymous’s picture

Almare created an issue. See original summary.

Anonymous’s picture

Title: subscription can't be created caused by missing payment method » Subscription can't be created caused by missing payment method
bojanz’s picture

Status: Active » Closed (works as designed)

Mollie is an offsite payment gateway. It doesn't create payment methods. The code is working as expected.

Responded to https://www.drupal.org/project/commerce_recurring/issues/2924292#comment...

swentel’s picture

Note that there's a working MR at #2939739: Recurring billing with Commerce recurring for mollie and recurring payments!