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
Comment #1
Anonymous (not verified) commentedAlmare created an issue. See original summary.
Comment #2
Anonymous (not verified) commentedComment #3
bojanz commentedMollie 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...
Comment #4
swentel commentedNote that there's a working MR at #2939739: Recurring billing with Commerce recurring for mollie and recurring payments!