Skip to content

Commit

Permalink
Fix: set idci_payment.apple_pay.root_ca_file_path optionnal
Browse files Browse the repository at this point in the history
  • Loading branch information
BeBlood committed Jan 6, 2025
1 parent a38fa80 commit 126daf6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Gateway/ApplePayPaymentGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ApplePayPaymentGateway extends AbstractPaymentGateway
private $logger;

/**
* @var string
* @var string|null
*/
private $rootCaFilePath;

Expand All @@ -51,7 +51,7 @@ public function __construct(
EventDispatcherInterface $dispatcher,
RequestStack $requestStack,
LoggerInterface $logger,
string $rootCaFilePath
?string $rootCaFilePath = null
) {
parent::__construct($templating, $dispatcher);

Expand Down Expand Up @@ -114,6 +114,10 @@ public function decryptPaymentToken(
throw new \LogicException('You must enable the "token_self_decrypt" to allow payment token self decryption. Becareful, you must be PCI-compliant to enable it.');
}

if (null === $this->rootCaFilePath) {
throw new \LogicException('You must configure "idci_payment.apple_pay.root_ca_file_path" parameter to use self decryption.');
}

$applePayDecodingServiceFactory = new ApplePayDecodingServiceFactory();
$applePayDecodingService = $applePayDecodingServiceFactory->make();
$applePayValidator = new ApplePayValidator();
Expand Down

0 comments on commit 126daf6

Please sign in to comment.