Subscription module: add gateway capability flow and UX fixes
This commit is contained in:
@@ -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()];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user