Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing parameters #68

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions build/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@
<rule ref="SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly">
<properties>
<property name="searchAnnotations" value="true"/>
<property name="fullyQualifiedKeywords" type="array" value=""/>
<property name="allowFallbackGlobalFunctions" value="false"/>
<property name="allowFallbackGlobalConstants" value="false"/>
<property name="allowFullyQualifiedExceptions" value="false"/>
Expand Down Expand Up @@ -378,7 +377,6 @@
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
<properties>
<property name="enableNativeTypeHint" value="true"/>
<property name="enableMixedTypeHint" value="true"/>
<property name="enableUnionTypeHint" value="true"/>
<property name="traversableTypeHints" type="array" value="
Expand Down
4 changes: 4 additions & 0 deletions src/Call/ApplePay/InitApplePayRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use SlevomatCsobGateway\Call\InvalidJsonPayloadException;
use SlevomatCsobGateway\Crypto\SignatureDataFormatter;
use SlevomatCsobGateway\EncodeHelper;
use SlevomatCsobGateway\Language;
use SlevomatCsobGateway\Price;
use SlevomatCsobGateway\Validator;
use function array_filter;
Expand Down Expand Up @@ -40,6 +41,7 @@ public function __construct(
private ?Order $order = null,
private ?bool $sdkUsed = null,
private ?string $merchantData = null,
private ?Language $language = null,
private ?int $ttlSec = null,
)
{
Expand Down Expand Up @@ -81,6 +83,7 @@ public function send(ApiClient $apiClient): ActionsPaymentResponse
'order' => $this->order?->encode(),
'sdkUsed' => $this->sdkUsed,
'merchantData' => $this->merchantData !== null ? base64_encode($this->merchantData) : null,
'language' => $this->language?->value,
'ttlSec' => $this->ttlSec,
], EncodeHelper::filterValueCallback());

Expand All @@ -102,6 +105,7 @@ public function send(ApiClient $apiClient): ActionsPaymentResponse
'order' => Order::encodeForSignature(),
'sdkUsed' => null,
'merchantData' => null,
'language' => null,
'ttlSec' => null,
]),
new SignatureDataFormatter(ActionsPaymentResponse::encodeForSignature()),
Expand Down
4 changes: 4 additions & 0 deletions src/Call/GooglePay/InitGooglePayRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use SlevomatCsobGateway\Call\InvalidJsonPayloadException;
use SlevomatCsobGateway\Crypto\SignatureDataFormatter;
use SlevomatCsobGateway\EncodeHelper;
use SlevomatCsobGateway\Language;
use SlevomatCsobGateway\Price;
use SlevomatCsobGateway\Validator;
use function array_filter;
Expand All @@ -34,6 +35,7 @@ public function __construct(
private ?Order $order = null,
private ?bool $sdkUsed = null,
private ?string $merchantData = null,
private ?Language $language = null,
private ?int $ttlSec = null,
)
{
Expand Down Expand Up @@ -70,6 +72,7 @@ public function send(ApiClient $apiClient): ActionsPaymentResponse
'order' => $this->order?->encode(),
'sdkUsed' => $this->sdkUsed,
'merchantData' => $this->merchantData !== null ? base64_encode($this->merchantData) : null,
'language' => $this->language?->value,
'ttlSec' => $this->ttlSec,
], EncodeHelper::filterValueCallback());

Expand All @@ -91,6 +94,7 @@ public function send(ApiClient $apiClient): ActionsPaymentResponse
'order' => Order::encodeForSignature(),
'sdkUsed' => null,
'merchantData' => null,
'language' => null,
'ttlSec' => null,
]),
new SignatureDataFormatter(ActionsPaymentResponse::encodeForSignature()),
Expand Down
7 changes: 7 additions & 0 deletions src/Call/OneClick/InitOneClickPaymentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use SlevomatCsobGateway\Call\ActionsPaymentResponse;
use SlevomatCsobGateway\Crypto\SignatureDataFormatter;
use SlevomatCsobGateway\EncodeHelper;
use SlevomatCsobGateway\Language;
use SlevomatCsobGateway\Price;
use SlevomatCsobGateway\Validator;
use function array_filter;
Expand All @@ -31,6 +32,8 @@ public function __construct(
private ?bool $clientInitiated = null,
private ?bool $sdkUsed = null,
private ?string $merchantData = null,
private ?Language $language = null,
private ?int $ttlSec = null,
)
{
Validator::checkPayId($this->origPayId);
Expand Down Expand Up @@ -59,6 +62,8 @@ public function send(ApiClient $apiClient): ActionsPaymentResponse
'clientInitiated' => $this->clientInitiated,
'sdkUsed' => $this->sdkUsed,
'merchantData' => $this->merchantData !== null ? base64_encode($this->merchantData) : null,
'language' => $this->language?->value,
'ttlSec' => $this->ttlSec,
], EncodeHelper::filterValueCallback());

$response = $apiClient->post(
Expand All @@ -80,6 +85,8 @@ public function send(ApiClient $apiClient): ActionsPaymentResponse
'clientInitiated' => null,
'sdkUsed' => null,
'merchantData' => null,
'language' => null,
'ttlSec' => null,
]),
new SignatureDataFormatter(ActionsPaymentResponse::encodeForSignature()),
);
Expand Down
8 changes: 8 additions & 0 deletions src/RequestFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ public function createOneclickInitPayment(
?bool $clientInitiated = null,
?bool $sdkUsed = null,
?string $merchantData = null,
?Language $language = null,
?int $ttlSec = null,
): InitOneClickPaymentRequest
{
return new InitOneClickPaymentRequest(
Expand All @@ -184,6 +186,8 @@ public function createOneclickInitPayment(
$clientInitiated,
$sdkUsed,
$merchantData,
$language,
$ttlSec,
);
}

Expand Down Expand Up @@ -240,6 +244,7 @@ public function createApplePayInitRequest(
?\SlevomatCsobGateway\AdditionalData\Order $order = null,
?bool $sdkUsed = null,
?string $merchantData = null,
?Language $language = null,
?int $ttlSec = null,
): InitApplePayRequest
{
Expand All @@ -256,6 +261,7 @@ public function createApplePayInitRequest(
$order,
$sdkUsed,
$merchantData,
$language,
$ttlSec,
);
}
Expand Down Expand Up @@ -368,6 +374,7 @@ public function createGooglePayInitRequest(
?\SlevomatCsobGateway\AdditionalData\Order $order = null,
?bool $sdkUsed = null,
?string $merchantData = null,
?Language $language = null,
?int $ttlSec = null,
): InitGooglePayRequest
{
Expand All @@ -384,6 +391,7 @@ public function createGooglePayInitRequest(
$order,
$sdkUsed,
$merchantData,
$language,
$ttlSec,
);
}
Expand Down
Loading