Code Duplication    Length = 25-27 lines in 2 locations

src/Configuration/InvoicePay.php 1 location

@@ 17-43 (lines=27) @@
14
15
class InvoicePay implements ConfigurationInterface
16
{
17
    public function getConfigTreeBuilder()
18
    {
19
        $treeBuilder = new TreeBuilder('shapin_stripe');
20
        $rootNode = $treeBuilder->getRootNode();
21
22
        $rootNode
23
            ->children()
24
                ->booleanNode('forgive')
25
                    ->info('In cases where the source used to pay the invoice has insufficient funds, passing forgive=true controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due. Passing forgive=false will fail the charge if the source hasn’t been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference.')
26
                ->end()
27
                ->booleanNode('off_session')
28
                    ->info('Indicates if a customer is on or off-session while an invoice payment is attempted.')
29
                ->end()
30
                ->booleanNode('paid_out_of_band')
31
                    ->info('Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made.')
32
                ->end()
33
                ->scalarNode('payment_method')
34
                    ->info('A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid.')
35
                ->end()
36
                ->scalarNode('source')
37
                    ->info('A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid.')
38
                ->end()
39
            ->end()
40
        ;
41
42
        return $treeBuilder;
43
    }
44
}
45

src/Configuration/PaymentIntentConfirm.php 1 location

@@ 17-41 (lines=25) @@
14
15
class PaymentIntentConfirm implements ConfigurationInterface
16
{
17
    public function getConfigTreeBuilder()
18
    {
19
        $treeBuilder = new TreeBuilder('shapin_stripe');
20
        $rootNode = $treeBuilder->getRootNode();
21
22
        $rootNode
23
            ->children()
24
                ->booleanNode('off_session')
25
                    ->info('Set to true to indicate that the customer is not in your checkout flow during this payment attempt, and therefore is unable to authenticate. This parameter is intended for scenarios where you collect card details and charge them later.')
26
                ->end()
27
                ->scalarNode('payment_method')
28
                    ->info('ID of the payment method (a PaymentMethod, Card, BankAccount, or saved Source object) to attach to this PaymentIntent.')
29
                ->end()
30
                ->booleanNode('save_payment_method')
31
                    ->info('If the PaymentIntent has a payment_method and a customer or if you’re attaching a payment method to the PaymentIntent in this request, you can pass save_payment_method=true to save the payment method to the customer. Defaults to false. If the payment method is already saved to a customer, this does nothing. If this type of payment method cannot be saved to a customer, the request will error.')
32
                ->end()
33
                ->enumNode('setup_future_usage')
34
                    ->values(['on_session', 'off_session'])
35
                    ->info('Indicates that you intend to make future payments with this PaymentIntent’s payment method.')
36
                ->end()
37
            ->end()
38
        ;
39
40
        return $treeBuilder;
41
    }
42
}
43