Subscription module: add gateway capability flow and UX fixes

This commit is contained in:
Dwindi Ramadhana
2026-06-02 00:38:42 +07:00
parent fec786daa6
commit df969b442d
15 changed files with 2375 additions and 138 deletions

View File

@@ -288,6 +288,12 @@ class CheckoutController
'next_payment_date' => $sub->next_payment_date,
'end_date' => $sub->end_date,
'recurring_amount' => (float) $sub->recurring_amount,
// §9 — Renewal messaging. The order-pay page can choose between
// "auto-renew enabled" and "manual renewal only" copy.
'payment_method' => $sub->payment_method,
'gateway_supports_auto_renew' => !empty($sub->payment_method)
? \WooNooW\Modules\Subscription\GatewayCapabilities::should_attempt_auto_renew($sub->payment_method)
: false,
];
}
@@ -324,7 +330,9 @@ class CheckoutController
}
// Create order
$order = wc_create_order();
$order = wc_create_order([
'created_via' => 'checkout'
]);
if (is_wp_error($order)) {
return ['error' => $order->get_error_message()];
}