* This software may be modified and distributed under the terms
7
* of the MIT license. See the LICENSE file for details.
8
*/
9
10
namespace Shapin\Stripe\Configuration;
11
12
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
13
use Symfony\Component\Config\Definition\ConfigurationInterface;
14
15
class PlanUpdate implements ConfigurationInterface
16
{
17
public function getConfigTreeBuilder()
18
{
19
$treeBuilder = new TreeBuilder('shapin_stripe');
20
$rootNode = $treeBuilder->getRootNode();
21
22
$rootNode
23
->children()
24
->scalarNode('plan')
25
->isRequired()
26
->info('The identifier of the plan to be updated.')
27
->end()
28
->booleanNode('active')
29
->info('Whether the plan is currently available for new subscriptions.')
30
->end()
31
->arrayNode('metadata')
32
->scalarPrototype()->end()
33
->info('A set of key-value pairs that you can attach to a plan object. It can be useful for storing additional information about the plan in a structured format. ')
34
->end()
35
->scalarNode('nickname')
36
->info('A brief description of the plan, hidden from customers. This will be unset if you POST an empty value.')
37
->end()
38
->scalarNode('product')
39
->info('The product the plan belongs to. Note that after updating, statement descriptors and line items of the plan in active subscriptions will be affected.')
40
->end()
41
->integerNode('trial_period_days')
42
->info('Default number of trial days when subscribing a customer to this plan using trial_from_plan=true.')