diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 73d072c..bbf16c8 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -15,6 +15,8 @@ 'yoda_style' => false, 'no_superfluous_phpdoc_tags' => false, 'multiline_whitespace_before_semicolons' => false, + 'global_namespace_import' => false, + 'single_line_empty_body' => false, ]) ->setCacheFile(__DIR__.'/.php_cs.cache') ->setFinder($finder); diff --git a/CHANGELOG.md b/CHANGELOG.md index e1c8404..dc2f366 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.1.3 - 2023-10-17 + +### Fixed +- Always return response as raw data + ## 1.1.2 - 2022-09-22 ### Changed diff --git a/composer.json b/composer.json index 138fa19..9efe463 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "robuust/craft-commerce-pay", "description": "PAY integration for Craft Commerce 4.0+", - "version": "1.1.2", + "version": "1.1.3", "type": "craft-plugin", "keywords": [ "pay", diff --git a/src/gateways/Gateway.php b/src/gateways/Gateway.php index 4b30ab7..e892804 100644 --- a/src/gateways/Gateway.php +++ b/src/gateways/Gateway.php @@ -183,12 +183,13 @@ public function supportsWebhooks(): bool public function processWebHook(): Response { $response = Craft::$app->getResponse(); + $response->format = Response::FORMAT_RAW; $transactionHash = $this->getTransactionHashFromWebhook(); $transaction = Commerce::getInstance()->getTransactions()->getTransactionByHash($transactionHash); if (!$transaction) { - Craft::warning('Transaction with the hash “' . $transactionHash . '“ not found.', 'commerce'); + Craft::warning('Transaction with the hash “'.$transactionHash.'“ not found.', 'commerce'); $response->data = 'FALSE|Transaction not found'; return $response; @@ -202,7 +203,7 @@ public function processWebHook(): Response ])->count(); if ($successfulPurchaseChildTransaction) { - Craft::warning('Successful child transaction for “' . $transactionHash . '“ already exists.', 'commerce'); + Craft::warning('Successful child transaction for “'.$transactionHash.'“ already exists.', 'commerce'); $response->data = 'TRUE'; return $response; @@ -402,6 +403,6 @@ protected function createGateway(): AbstractGateway */ protected function getGatewayClassName(): ?string { - return '\\' . OmnipayGateway::class; + return '\\'.OmnipayGateway::class; } }