PluginProbe
Flexible Subscriptions / trunk
Flexible Subscriptions vtrunk
1.8.5 1.8.4 1.8.3 1.8.2 1.8.1 1.8.0 1.7.19 1.7.18 1.7.17 1.7.16 1.7.15 1.7.14 1.7.13 1.7.12 1.7.11 trunk 1.0.0 1.0.1 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.2.1 1.2.2 All 62 releases
flexible-subscriptions / src / Admin / Settings / PaymentsTab.php

PaymentsTab.php in Flexible Subscriptions trunk, at src/Admin/Settings/PaymentsTab.php

41 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace WPDesk\FlexibleSubscriptions\Admin\Settings;
6
7 use WPDesk\FlexibleSubscriptions\Form\Fields\Section;
8 use WPDesk\FlexibleSubscriptions\Form\Fields\Tab;
9 use WPDesk\FlexibleSubscriptions\Settings\PaymentOptions;
10 use WPDesk\FlexibleSubscriptions\Vendor\WPDesk\Forms\Field\CheckboxField;
11
12 class PaymentsTab extends Tab {
13
14 public function __construct() {
15 parent::__construct( $this->fields() );
16 }
17
18 private function fields(): array {
19 return [
20 ( new Section(
21 [
22 ( new CheckboxField() )
23 ->set_name( PaymentOptions::REQUIRE_PAYMENT_ON_ZERO_TOTAL )
24 ->set_default_value( CheckboxField::VALUE_FALSE )
25 ->set_label( __( 'Zero initial payment', 'flexible-subscriptions' ) )
26 ->set_sublabel( __( 'Require a payment method when the initial subscription order total is zero', 'flexible-subscriptions' ) )
27 ->set_description( __( 'Allows a supported payment gateway to save the payment method for automatic renewals when a future subscription payment is due.', 'flexible-subscriptions' ) ),
28 ( new CheckboxField() )
29 ->set_name( PaymentOptions::MANUAL_RENEWAL_ENABLED )
30 ->set_default_value( CheckboxField::VALUE_FALSE )
31 ->set_label( __( 'Manual payments', 'flexible-subscriptions' ) )
32 ->set_sublabel( __( 'Allow payment methods that require manual subscription renewals', 'flexible-subscriptions' ) )
33 ->set_description( __( 'When disabled, only payment gateways supporting automatic subscription renewals are available during checkout.', 'flexible-subscriptions' ) ),
34 ]
35 ) )
36 ->set_label( __( 'Payment options', 'flexible-subscriptions' ) )
37 ->set_description( __( 'Configure how payment methods are collected and which gateways can be used for subscriptions.', 'flexible-subscriptions' ) ),
38 ];
39 }
40 }
41