Completed
Push — master ( abb491...352f9f )
by Olivier
01:38
created

SetupIntentCreate   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 41
ccs 32
cts 32
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getConfigTreeBuilder() 0 38 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * 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 Shapin\Stripe\Model\SetupIntent\SetupIntent;
13
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
14
use Symfony\Component\Config\Definition\ConfigurationInterface;
15
16
class SetupIntentCreate implements ConfigurationInterface
17
{
18 1
    public function getConfigTreeBuilder()
19
    {
20 1
        $treeBuilder = new TreeBuilder('shapin_stripe');
21 1
        $rootNode = $treeBuilder->getRootNode();
22
23
        $rootNode
24 1
            ->children()
25 1
                ->booleanNode('confirm')
26 1
                    ->info('Set to true to attempt to confirm this SetupIntent immediately. This parameter defaults to false. If the payment method attached is a card, a return_url may be provided in case additional authentication is required.')
27 1
                ->end()
28 1
                ->scalarNode('customer')
29 1
                    ->info('ID of the Customer this SetupIntent belongs to, if one exists.')
30 1
                ->end()
31 1
                ->scalarNode('description')
32 1
                    ->info('An arbitrary string attached to the object. Often useful for displaying to users. This can be unset by updating the value to null and then saving.')
33 1
                ->end()
34 1
                ->arrayNode('metadata')
35 1
                    ->scalarPrototype()->end()
36 1
                    ->info('Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.')
37 1
                ->end()
38 1
                ->scalarNode('on_behalf_of')
39 1
                    ->info('The Stripe account ID for which this SetupIntent is created.')
40 1
                ->end()
41 1
                ->scalarNode('payment_method')
42 1
                    ->info('ID of the payment method (a PaymentMethod, Card, BankAccount, or saved Source object) to attach to this SetupIntent.')
43 1
                ->end()
44 1
                ->scalarNode('return_url')
45 1
                    ->info('The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method’s app or site. If you’d prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with confirm=true.')
46 1
                ->end()
47 1
                ->enumNode('usage')
48 1
                    ->values([SetupIntent::USAGE_ON_SESSION, SetupIntent::USAGE_OFF_SESSION])
49 1
                    ->info('Indicates how the payment method is intended to be used in the future.')
50 1
                ->end()
51 1
            ->end()
52
        ;
53
54 1
        return $treeBuilder;
55
    }
56
}
57