Issues (93)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/Configuration/CustomerCreate.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

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 Symfony\Component\Config\Definition\Builder\TreeBuilder;
13
use Symfony\Component\Config\Definition\ConfigurationInterface;
14
15 View Code Duplication
class CustomerCreate implements ConfigurationInterface
0 ignored issues
show
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
16
{
17
    public function getConfigTreeBuilder()
18
    {
19
        $treeBuilder = new TreeBuilder('shapin_stripe_customer_create');
20
        $rootNode = $treeBuilder->getRootNode();
21
22
        $rootNode
23
            ->children()
24
                ->integerNode('account_balance')
25
                    ->info('An integer amount in pence that represents the account balance for your customer. Account balances only affect invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice.')
26
                ->end()
27
                ->scalarNode('coupon')
28
                    ->info('The code of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. This can be unset by updating the value to null and then saving.')
29
                ->end()
30
                ->scalarNode('default_source')
31
                    ->info('ID of the default payment source for the customer.')
32
                ->end()
33
                ->scalarNode('description')
34
                    ->info('An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. This can be unset by updating the value to null and then saving.')
35
                ->end()
36
                ->scalarNode('email')
37
                    ->info('Customer’s email address. It’s displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to 512 characters. This can be unset by updating the value to null and then saving.')
38
                ->end()
39
                ->scalarNode('invoice_prefix')
40
                    ->info('The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers.')
41
                ->end()
42
                ->arrayNode('invoice_settings')
43
                    ->children()
44
                        ->arrayNode('custom_fields')
45
                            ->arrayPrototype()
46
                                ->children()
47
                                    ->scalarNode('name')
48
                                        ->isRequired()
49
                                        ->info('The name of the custom field. This may be up to 30 characters.')
50
                                    ->end()
51
                                    ->scalarNode('value')
52
                                        ->isRequired()
53
                                        ->info('The value of the custom field. This may be up to 30 characters.')
54
                                    ->end()
55
                                ->end()
56
                            ->end()
57
                            ->info('Default custom fields to be displayed on invoices for this customer.')
58
                        ->end()
59
                        ->scalarNode('footer')
60
                            ->info('Default footer to be displayed on invoices for this customer. This can be unset by updating the value to null and then saving.')
61
                        ->end()
62
                    ->end()
63
                    ->info('Default invoice settings for this customer.')
64
                ->end()
65
                ->arrayNode('metadata')
66
                    ->scalarPrototype()->end()
67
                    ->info('A set of key-value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format.')
68
                ->end()
69
                ->arrayNode('shipping')
70
                    ->children()
71
                        ->arrayNode('address')
72
                            ->isRequired()
73
                            ->children()
74
                                ->scalarNode('line1')
75
                                    ->isRequired()
76
                                    ->cannotBeEmpty()
77
                                ->end()
78
                                ->scalarNode('city')->end()
79
                                ->scalarNode('country')->end()
80
                                ->scalarNode('line2')->end()
81
                                ->scalarNode('postal_code')->end()
82
                                ->scalarNode('state')->end()
83
                            ->end()
84
                            ->info('Customer shipping address.')
85
                        ->end()
86
                        ->scalarNode('name')
87
                            ->isRequired()
88
                            ->cannotBeEmpty()
89
                            ->info('Customer name. This can be unset by updating the value to null and then saving.')
90
                        ->end()
91
                        ->scalarNode('phone')
92
                            ->info('Customer phone (including extension). This can be unset by updating the value to null and then saving.')
93
                        ->end()
94
                    ->end()
95
                    ->info('The customer’s shipping information. Appears on invoices emailed to this customer.')
96
                ->end()
97
                ->scalarNode('source')
98
                    ->info('The source can either be a Token or a Source, as returned by Elements, or a associative array containing a user’s credit card details (with the options shown below). You must provide a source if the customer does not already have a valid source attached, and you are subscribing the customer to be charged automatically for a plan that is not free. Passing source will create a new source object, make it the customer default source, and delete the old customer default if one exists. If you want to add an additional source, instead use the card creation API to add the card and then the customer update API to set it as the default. Whenever you attach a card to a customer, Stripe will automatically validate the card.')
99
                ->end()
100
                ->arrayNode('tax_info')
101
                    ->children()
102
                        ->scalarNode('tax_id')
103
                            ->isRequired(true)
104
                            ->info('The customer’s tax ID number. This can be unset by updating the value to null and then saving.')
105
                        ->end()
106
                        ->scalarNode('type')
107
                            ->isRequired(true)
108
                            ->info('The type of ID number. The only possible value is vat')
109
                        ->end()
110
                    ->end()
111
                    ->info('The customer’s tax information. Appears on invoices emailed to this customer.')
112
                ->end()
113
            ->end()
114
        ;
115
116
        return $treeBuilder;
117
    }
118
}
119