@@ -73,7 +73,7 @@ |
||
73 | 73 | { |
74 | 74 | $parts = explode('_', $field); |
75 | 75 | array_map('ucfirst', $parts); |
76 | - $name = 'set' . implode('', $parts); |
|
76 | + $name = 'set'.implode('', $parts); |
|
77 | 77 | |
78 | 78 | return $name; |
79 | 79 | } |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | public function __construct($message, ConstraintViolationListInterface $violations) |
13 | 13 | { |
14 | - $message .= ' Violations: ' . $violations->__toString(); |
|
14 | + $message .= ' Violations: '.$violations->__toString(); |
|
15 | 15 | parent::__construct($message); |
16 | 16 | |
17 | 17 | $this->violations = $violations; |
@@ -15,7 +15,7 @@ |
||
15 | 15 | */ |
16 | 16 | public function __construct(\Exception $previous = null, ResultObjectInterface $result = null) |
17 | 17 | { |
18 | - $this->message .= ' Response data: ' . serialize($result); |
|
18 | + $this->message .= ' Response data: '.serialize($result); |
|
19 | 19 | parent::__construct($this->message, $this->code, $previous); |
20 | 20 | |
21 | 21 | $this->result = $result; |
@@ -16,7 +16,7 @@ |
||
16 | 16 | * @param STRING authorize data 'cres' or 'authorize_data' |
17 | 17 | * @param BOOL should it be 3D secure v2 ? |
18 | 18 | */ |
19 | - public function __construct(string $paymentId, string $authorizeData, $isV2=false) |
|
19 | + public function __construct(string $paymentId, string $authorizeData, $isV2 = false) |
|
20 | 20 | { |
21 | 21 | $this->paymentId = $paymentId; |
22 | 22 | $this->authorizeData = $authorizeData; |
@@ -405,7 +405,7 @@ |
||
405 | 405 | */ |
406 | 406 | public function setThreeds2Data( |
407 | 407 | ThreeDS2AuthorizationInformation $threeDS2AuthorizationInformation |
408 | - ){ |
|
408 | + ) { |
|
409 | 409 | $this->threeDS2AuthorizationInformation = $threeDS2AuthorizationInformation; |
410 | 410 | } |
411 | 411 |
@@ -413,10 +413,10 @@ |
||
413 | 413 | $this->threeDS2AuthorizationInformation = $threeDS2AuthorizationInformation; |
414 | 414 | } |
415 | 415 | |
416 | - /** |
|
417 | - * Gets the value of statementDescriptorSuffix. |
|
418 | - * @return mixed |
|
419 | - */ |
|
416 | + /** |
|
417 | + * Gets the value of statementDescriptorSuffix. |
|
418 | + * @return mixed |
|
419 | + */ |
|
420 | 420 | public function getStatementDescriptorSuffix() |
421 | 421 | { |
422 | 422 | return $this->statementDescriptorSuffix; |
@@ -12,6 +12,6 @@ |
||
12 | 12 | const RESTRICTED_DOMAIN = 'localhost'; |
13 | 13 | const RESTRICTED_IP = '127.0.0.1'; |
14 | 14 | |
15 | - public $message = 'The url "{{ param }}" contains restricted values. Do not use "' . |
|
16 | - self::RESTRICTED_DOMAIN . '" or "' . self::RESTRICTED_IP . '".'; |
|
15 | + public $message = 'The url "{{ param }}" contains restricted values. Do not use "'. |
|
16 | + self::RESTRICTED_DOMAIN.'" or "'.self::RESTRICTED_IP.'".'; |
|
17 | 17 | } |
@@ -44,12 +44,12 @@ discard block |
||
44 | 44 | { |
45 | 45 | return new Assert\Collection([ |
46 | 46 | 'amount' => $this->buildElement('float', 1), |
47 | - 'currency' => $this->buildElement('string', 1, ['min' => 3,'max' => 3]), |
|
47 | + 'currency' => $this->buildElement('string', 1, ['min' => 3, 'max' => 3]), |
|
48 | 48 | 'settle' => $this->buildElement('bool'), |
49 | - 'order_id' => $this->buildElement('string', 0, ['min' => 2,'max' => 50]), |
|
49 | + 'order_id' => $this->buildElement('string', 0, ['min' => 2, 'max' => 50]), |
|
50 | 50 | 'description' => $this->buildElement('string', 0, ['max' => 255]), |
51 | 51 | 'statement_descriptor_suffix' => $this->buildElement('string', 0, ['max' => 25]), |
52 | - 'country' => $this->buildElement('string', 1, ['min' => 2,'max' => 2]), |
|
52 | + 'country' => $this->buildElement('string', 1, ['min' => 2, 'max' => 2]), |
|
53 | 53 | 'payment_method' => new Assert\Required([ |
54 | 54 | new Assert\Type([ |
55 | 55 | 'type' => 'string', |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | ]), |
83 | 83 | 'exp_year' => $this->buildElement( |
84 | 84 | 'integer', 1, |
85 | - ['min' => 4,'max' => 4], |
|
85 | + ['min' => 4, 'max' => 4], |
|
86 | 86 | new Assert\Range(['min' => date('Y')]) |
87 | 87 | ), |
88 | 88 | 'exp_month' => $this->buildElement('integer', 1), |
@@ -204,9 +204,15 @@ |
||
204 | 204 | ): object |
205 | 205 | { |
206 | 206 | $inside_array = $this->getInsideArray($typeValue); |
207 | - if ($isRequired) array_unshift($inside_array, new Assert\NotBlank()); |
|
208 | - if ($length) array_push($inside_array, new Assert\Length($length)); |
|
209 | - if ($args) array_push($inside_array, $args); |
|
207 | + if ($isRequired) { |
|
208 | + array_unshift($inside_array, new Assert\NotBlank()); |
|
209 | + } |
|
210 | + if ($length) { |
|
211 | + array_push($inside_array, new Assert\Length($length)); |
|
212 | + } |
|
213 | + if ($args) { |
|
214 | + array_push($inside_array, $args); |
|
215 | + } |
|
210 | 216 | |
211 | 217 | return $isRequired |
212 | 218 | ? new Assert\Required($inside_array) |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | |
115 | - public function __serialize(): array {return[];} |
|
115 | + public function __serialize(): array {return[]; } |
|
116 | 116 | public function __unserialize(array $data): void {} |
117 | 117 | |
118 | 118 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | private function classGetters($class) |
123 | 123 | { |
124 | 124 | $methods = get_class_methods($class); |
125 | - return array_filter($methods, function ($value) use ($methods) { |
|
125 | + return array_filter($methods, function($value) use ($methods) { |
|
126 | 126 | if ($value == 'getErrors') { |
127 | 127 | return false; |
128 | 128 | } |
@@ -159,6 +159,6 @@ discard block |
||
159 | 159 | $parts = array_map('ucfirst', $parts); |
160 | 160 | $property = implode('', $parts); |
161 | 161 | |
162 | - return 'set' . ucfirst($property); |
|
162 | + return 'set'.ucfirst($property); |
|
163 | 163 | } |
164 | 164 | } |
@@ -7,60 +7,60 @@ discard block |
||
7 | 7 | class PaymentLink extends ResultObject |
8 | 8 | { |
9 | 9 | /** |
10 | - * @type string ID of the payment link. |
|
11 | - * Value assigned by Cardinity. |
|
12 | - */ |
|
10 | + * @type string ID of the payment link. |
|
11 | + * Value assigned by Cardinity. |
|
12 | + */ |
|
13 | 13 | private $id; |
14 | 14 | |
15 | 15 | /** @type string URL of the payment link. |
16 | - * Value assigned by Cardinity. |
|
17 | - */ |
|
16 | + * Value assigned by Cardinity. |
|
17 | + */ |
|
18 | 18 | private $url; |
19 | 19 | |
20 | 20 | /** |
21 | - * @type float Amount charged shown in #0.00 format. |
|
22 | - */ |
|
21 | + * @type float Amount charged shown in #0.00 format. |
|
22 | + */ |
|
23 | 23 | private $amount; |
24 | 24 | |
25 | 25 | /** |
26 | - * @type string Three-letter ISO currency code representing the currency in |
|
27 | - * which the charge was made. |
|
28 | - * Supported currencies: EUR, USD. |
|
29 | - */ |
|
26 | + * @type string Three-letter ISO currency code representing the currency in |
|
27 | + * which the charge was made. |
|
28 | + * Supported currencies: EUR, USD. |
|
29 | + */ |
|
30 | 30 | private $currency; |
31 | 31 | |
32 | 32 | /** |
33 | - * @type string Country of a customer provided by a merchant. |
|
34 | - * ISO 3166-1 alpha-2 country code. |
|
35 | - */ |
|
33 | + * @type string Country of a customer provided by a merchant. |
|
34 | + * ISO 3166-1 alpha-2 country code. |
|
35 | + */ |
|
36 | 36 | private $country; |
37 | 37 | |
38 | 38 | /** |
39 | - * @type string Payment Link description provided by a merchant. |
|
40 | - * Maximum length 255 characters. |
|
41 | - */ |
|
39 | + * @type string Payment Link description provided by a merchant. |
|
40 | + * Maximum length 255 characters. |
|
41 | + */ |
|
42 | 42 | private $description; |
43 | 43 | |
44 | 44 | /** |
45 | - * @type string Payment Link Expiration datetime as defined in RFC 3339 Section 5.6. |
|
46 | - * UTC timezone. |
|
47 | - * optional, if not defined default will be 7 days from now |
|
48 | - */ |
|
45 | + * @type string Payment Link Expiration datetime as defined in RFC 3339 Section 5.6. |
|
46 | + * UTC timezone. |
|
47 | + * optional, if not defined default will be 7 days from now |
|
48 | + */ |
|
49 | 49 | private $expiration_date; |
50 | 50 | |
51 | 51 | /** |
52 | - * @type boolean Indicates whether the payment link can be used more than once |
|
53 | - * mode. |
|
54 | - * Value assigned by Cardinity. |
|
55 | - * Default value is false |
|
56 | - */ |
|
52 | + * @type boolean Indicates whether the payment link can be used more than once |
|
53 | + * mode. |
|
54 | + * Value assigned by Cardinity. |
|
55 | + * Default value is false |
|
56 | + */ |
|
57 | 57 | private $multiple_use; |
58 | 58 | |
59 | 59 | /** |
60 | - * @type boolean Indicates whether the payment link is enabled |
|
61 | - * mode. |
|
62 | - * Value assigned by Cardinity. |
|
63 | - */ |
|
60 | + * @type boolean Indicates whether the payment link is enabled |
|
61 | + * mode. |
|
62 | + * Value assigned by Cardinity. |
|
63 | + */ |
|
64 | 64 | private $enabled; |
65 | 65 | |
66 | 66 | |
@@ -170,11 +170,11 @@ discard block |
||
170 | 170 | return $this->expiration_date; |
171 | 171 | } |
172 | 172 | |
173 | - /** |
|
174 | - * Sets the value of expiration_date. |
|
175 | - * @param mixed $expiration_date the expiration_date |
|
176 | - * @return void |
|
177 | - */ |
|
173 | + /** |
|
174 | + * Sets the value of expiration_date. |
|
175 | + * @param mixed $expiration_date the expiration_date |
|
176 | + * @return void |
|
177 | + */ |
|
178 | 178 | public function setExpirationDate($expiration_date) |
179 | 179 | { |
180 | 180 | $this->expiration_date = $expiration_date; |