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/Model/SetupIntent/SetupIntent.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\Model\SetupIntent;
11
12
use Shapin\Stripe\Model\ContainsMetadata;
13
use Shapin\Stripe\Model\CreatableFromArray;
14
use Shapin\Stripe\Model\Intent;
15
use Shapin\Stripe\Model\IntentNextAction;
16
use Shapin\Stripe\Model\LivemodeTrait;
17
use Shapin\Stripe\Model\MetadataCollection;
18
use Shapin\Stripe\Model\MetadataTrait;
19
20
final class SetupIntent extends Intent implements CreatableFromArray, ContainsMetadata
21
{
22
    use LivemodeTrait;
23
    use MetadataTrait;
24
25
    const CANCELLATION_REASON_ABANDONED = 'abandoned';
26
    const CANCELLATION_REASON_REQUESTED_BY_CUSTOMER = 'requested_by_customer';
27
    const CANCELLATION_REASON_DUPLICATE = 'duplicate';
28
29
    const USAGE_ON_SESSION = 'on_session';
30
    const USAGE_OFF_SESSION = 'off_session';
31
32
    /**
33
     * @var string
34
     */
35
    private $id;
36
37
    /**
38
     * @var ?string
39
     */
40
    private $applicationId;
41
42
    /**
43
     * @var ?string
44
     */
45
    private $cancellationReason;
46
47
    /**
48
     * @var ?string
49
     */
50
    private $clientSecret;
51
52
    /**
53
     * @var string
54
     */
55
    private $confirmationMethod;
56
57
    /**
58
     * @var \DateTimeImmutable
59
     */
60
    private $createdAt;
61
62
    /**
63
     * @var string
64
     */
65
    private $customerId;
66
67
    /**
68
     * @var string
69
     */
70
    private $description;
71
72
    /**
73
     * @var ?string
74
     */
75
    private $onBehalfOfId;
76
77
    /**
78
     * @var ?string
79
     */
80
    private $paymentMethodId;
81
82
    /**
83
     * @var array
84
     */
85
    private $paymentMethodTypes;
86
87
    /**
88
     * @var string
89
     */
90
    private $usage;
91
92 3
    public static function createFromArray(array $data): self
93
    {
94 3
        $model = new self();
95 3
        $model->id = $data['id'];
96 3
        $model->applicationId = $data['application'];
97 3
        $model->cancellationReason = $data['cancellation_reason'] ?? null;
98 3
        $model->clientSecret = $data['client_secret'];
99 3
        $model->createdAt = new \DateTimeImmutable('@'.$data['created']);
100 3
        $model->customerId = $data['customer'];
101 3
        $model->description = $data['description'];
102 3
        $model->live = $data['livemode'];
103 3
        $model->metadata = MetadataCollection::createFromArray($data['metadata']);
0 ignored issues
show
Documentation Bug introduced by
It seems like \Shapin\Stripe\Model\Met...rray($data['metadata']) of type object<self> is incompatible with the declared type object<Shapin\Stripe\Model\MetadataCollection> of property $metadata.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
104 3
        $model->nextAction = isset($data['next_action']) ? IntentNextAction::createFromArray($data['next_action']) : null;
105 3
        $model->onBehalfOfId = $data['on_behalf_of'];
106 3
        $model->paymentMethodId = $data['payment_method'];
107 3
        $model->paymentMethodTypes = $data['payment_method_types'];
108 3
        $model->status = $data['status'];
109 3
        $model->usage = $data['usage'];
110
111 3
        return $model;
112
    }
113
114 1
    public function getId(): string
115
    {
116 1
        return $this->id;
117
    }
118
119 1
    public function getApplicationId(): ?string
120
    {
121 1
        return $this->applicationId;
122
    }
123
124 1
    public function getCancellationReason(): ?string
125
    {
126 1
        return $this->cancellationReason;
127
    }
128
129 1
    public function getClientSecret(): ?string
130
    {
131 1
        return $this->clientSecret;
132
    }
133
134 1
    public function getCreatedAt(): \DateTimeInterface
135
    {
136 1
        return $this->createdAt;
137
    }
138
139 1
    public function getCustomerId(): ?string
140
    {
141 1
        return $this->customerId;
142
    }
143
144 1
    public function getDescription(): ?string
145
    {
146 1
        return $this->description;
147
    }
148
149 1
    public function getOnBehalfOfId(): ?string
150
    {
151 1
        return $this->onBehalfOfId;
152
    }
153
154 1
    public function getPaymentMethodId(): ?string
155
    {
156 1
        return $this->paymentMethodId;
157
    }
158
159 1
    public function getPaymentMethodTypes(): array
160
    {
161 1
        return $this->paymentMethodTypes;
162
    }
163
164 1
    public function getUsage(): string
165
    {
166 1
        return $this->usage;
167
    }
168
}
169