pronamic/wp-pronamic-pay-woocommerce

Sequence type `first` set for subscriptions requiring manual renewals

rvdsteege opened this issue · 0 comments

A customer encountered an issue while trying to pay for a WooCommerce order with the bank transfer payment method. When attempting to complete a purchase for a subscription product, an error occurs:

Unprocessable Entity - The payment method does not support sequence type.

This issue arises from the fact that the Mollie sequence type is set to first even though the bank transfer payment method does not support sequence types:

/**
* Subscriptions.
*/
$subscriptions = $this->get_pronamic_subscriptions( $order );
foreach ( $subscriptions as $subscription ) {
// Add subscription and period.
$payment->add_subscription( $subscription );
$start_date = $subscription->get_start_date();
if ( null !== $start_date ) {
$period = $subscription->get_period_for_date( $start_date );
if ( null !== $period ) {
$payment->add_period( $period );
}
}
$payment->set_meta( 'mollie_sequence_type', 'first' );

If all subscription products in the cart require manual renewal (e.g. through the Pronamic WooCommerce Renew Style plugin), the sequence type should not be set in the payment request.