Skip to content

Commit f48bda8

Browse files
committed
Merge fixes
1 parent 8e29e59 commit f48bda8

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

api/src/Http/PaymentHttpClient.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ public function refundOrder(string $captureId, array $payload): ResponseInterfac
8484
*/
8585
public function captureAuthorization(string $authorizationId, array $payload = []): ResponseInterface
8686
{
87-
$body = $this->generatePayloadString($payload);
87+
$payloadString = !empty($payload) && json_encode($payload) ? json_encode($payload) : '{}';
8888

89-
return $this->sendRequest(new Request('POST', "authorizations/$authorizationId/capture", [], $body));
89+
return $this->sendRequest(new Request('POST', "authorizations/$authorizationId/capture", [], $payloadString));
9090
}
9191

9292
/**
@@ -99,16 +99,6 @@ public function voidAuthorization(string $authorizationId, array $payload = []):
9999
return $this->sendRequest(new Request('POST', "authorizations/$authorizationId/void", [], $body));
100100
}
101101

102-
/**
103-
* {@inheritdoc}
104-
*/
105-
public function captureAuthorization(string $authorizationId, array $payload = []): ResponseInterface
106-
{
107-
$payloadString = !empty($payload) && json_encode($payload) ? json_encode($payload) : '{}';
108-
109-
return $this->sendRequest(new Request('POST', "authorizations/$authorizationId/capture", [], $payloadString));
110-
}
111-
112102
/**
113103
* @inheritDoc
114104
*/

ps17/phpstan-baseline.neon

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -276,24 +276,12 @@ parameters:
276276
count: 4
277277
path: ../api/src/Http/PaymentHttpClient.php
278278

279-
-
280-
message: '#^Parameter \#4 \$body of class GuzzleHttp\\Psr7\\Request constructor expects Psr\\Http\\Message\\StreamInterface\|resource\|string\|null, string\|false given\.$#'
281-
identifier: argument.type
282-
count: 1
283-
path: ../api/src/Http/PaymentHttpClient.php
284-
285279
-
286280
message: '#^Possibly invalid array key type mixed\.$#'
287281
identifier: array.invalidKey
288282
count: 1
289283
path: ../api/src/Http/PaymentHttpClient.php
290284

291-
-
292-
message: '#^Method PsCheckout\\Api\\Http\\PaymentHttpClientInterface\:\:refundOrder\(\) has parameter \$payload with no value type specified in iterable type array\.$#'
293-
identifier: missingType.iterableValue
294-
count: 1
295-
path: ../api/src/Http/PaymentHttpClientInterface.php
296-
297285
-
298286
message: '#^Method PsCheckout\\Api\\Http\\PsrHttpClientAdapter\:\:__construct\(\) has parameter \$configuration with no value type specified in iterable type array\.$#'
299287
identifier: missingType.iterableValue

0 commit comments

Comments
 (0)