Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/Handlers/ResponseHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function retrieveH000ReportText(DOMDocument $xml): string
public function extractInitializationSegment(Response $response, Keyring $keyring): InitializationSegment
{
$transactionKeyEncoded = $this->retrieveH00XTransactionKey($response);
$transactionKey = $this->base64Service->decode($transactionKeyEncoded);
$transactionKey = $transactionKeyEncoded !== null ? $this->base64Service->decode($transactionKeyEncoded) : '';
$orderDataEncrypted = $this->base64Service->decode($this->retrieveH00XOrderData($response));

$orderDataCompressed = $this->cryptService->decryptOrderDataCompressed(
Expand All @@ -154,7 +154,7 @@ public function extractDownloadSegment(Response $response): DownloadSegment
$transactionId = $this->retrieveH00XTransactionId($response);
$transactionPhase = $this->retrieveH00XTransactionPhase($response);
$transactionKeyEncoded = $this->retrieveH00XTransactionKey($response);
$transactionKey = $this->base64Service->decode($transactionKeyEncoded);
$transactionKey = $transactionKeyEncoded !== null ? $this->base64Service->decode($transactionKeyEncoded) : '';
$numSegments = $this->retrieveH00XNumSegments($response);
$segmentNumber = $this->retrieveH00XSegmentNumber($response);
$orderDataEncrypted = $this->retrieveH00XOrderData($response);
Expand Down
8 changes: 4 additions & 4 deletions src/Services/Processor/Base64Encoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
*/
final class Base64Encoder implements Base64EncoderInterface
{
/** Max encoded length = 10 * 1024 * 1024 (10 MB) */
private const MAX_ENCODED_LENGTH = 10485760;
/** Max raw length = MAX_ENCODED_LENGTH * 3 / 4 (~7.5 MB) */
private const MAX_RAW_LENGTH = 7864320;
/** Max encoded length = 512 * 1024 * 1024 (512 MB) */
private const MAX_ENCODED_LENGTH = 536870912;
/** Max raw length = MAX_ENCODED_LENGTH * 3 / 4 (~384 MB) */
private const MAX_RAW_LENGTH = 402653184;

public function encode(string $data): string
{
Expand Down